Command-line interface for Softadastra systems.
The cli module provides the user-facing interface to interact with Softadastra.
It allows users to:
Start, control, and inspect the system through simple commands.
The goal of softadastra/cli is simple:
Expose the system capabilities through a clean and minimal command-line interface.
Interface, not logic.
This module:
- Parses commands
- Triggers actions
- Displays results
It does not implement core logic.
The cli module provides:
- Command parsing
- Command execution
- User interaction (output, status)
- Entry points for application control
- No sync logic (sync module)
- No storage logic (store module)
- No network communication (transport module)
- No filesystem observation (fs module)
👉 It only connects the user to the system.
The CLI must remain minimal and lightweight.
All logic must be delegated to the app module.
Commands must be:
- Simple
- Consistent
- Explicit
The CLI should be usable in:
- Shell scripts
- Automation
- Dev workflows
modules/cli/
├── include/softadastra/cli/
│ ├── Command.hpp
│ ├── RunCommand.hpp
│ ├── StatusCommand.hpp
│ ├── PairCommand.hpp
│ └── InitCommand.hpp
└── src/
Base abstraction for all CLI commands.
Defines:
- Interface for execution
- Common utilities
Starts the system.
Example:
drive runDisplays current state.
Example:
drive statusConnects to another peer.
Example:
drive pair 192.168.1.10:9000Initializes a workspace.
Example:
drive initdrive init
drive run --folder ~/SoftadastraDrive
drive statusThe CLI interacts only with:
softadastra/app
It does not directly call:
- sync
- transport
- wal
- fs
- User runs command
- CLI parses input
- CLI calls app layer
- App orchestrates modules
- CLI displays result
The CLI should support:
- Human-readable output
- Structured output (future: JSON)
- softadastra/app
- softadastra/core
- Standard C++ libraries
-
Basic commands:
- init
- run
- status
- pair
-
Simple argument parsing
-
Minimal output
- JSON output mode
- Interactive CLI mode
- Command autocompletion
- Advanced diagnostics
- Remote control commands
- Never contain business logic
- Never bypass app layer
- Always keep commands simple
- Always fail with clear messages
The CLI is the interface, not the system.
It should make the system usable, not define how it works.
- Exposes commands
- Delegates to app
- Displays results
- Remains lightweight
See root LICENSE file.