A modular and extensible command-line interface engine for real-world systems.
Softadastra CLI provides a clean and structured way to build command-line tools with:
- robust parsing
- command registry and handlers
- interactive REPL support
- extensible architecture
Designed to integrate seamlessly with the Softadastra ecosystem.
- 🧠 Structured command parsing (
--flag,--key=value, positional args) - ⚙️ Command registry with handlers
- 🔁 Interactive mode (REPL)
- 🧩 Modular architecture (parser, engine, command, io)
- ⚡ Lightweight and fast
- 🌍 Built for real-world environments
cli/
├── parser/ # tokenization + parsing
├── command/ # command definitions + handlers
├── engine/ # orchestration
├── core/ # config + context + session
├── io/ # input/output abstraction
└── utils/ # formatting helpers
#include <softadastra/cli/cli.hpp>
int main()
{
softadastra::cli::core::CliConfig config;
config.app_name = "my-cli";
softadastra::cli::CliService cli(config);
softadastra::cli::CliOptions options;
options.interactive = true;
return cli.run(options);
}Built-in commands:
| Command | Description |
|---|---|
help |
Show available commands |
version |
Display current version |
exit |
Quit the CLI |
Custom commands can be registered using:
registry.register_command(
CliCommand{ ... },
std::make_shared<MyHandler>()
);The CLI is built around a simple pipeline:
input string
↓
Tokenizer
↓
CommandLine
↓
ArgParser
↓
ParsedCommand
↓
CliEngine
↓
CommandRegistry
↓
ICommandHandler
> help
> run file.cpp
> exit
options.command = "run file.cpp";- Separation of concerns — each module has a single responsibility
- Minimal dependencies — no bloat, no unnecessary coupling
- Type-safe parsing — powered by
std::variant - Explicit error handling — no silent failures
- Extensible command system — plug in new commands without touching core logic
Softadastra CLI is designed to work with the full Softadastra stack:
| Module | Role |
|---|---|
core |
Config, context, session |
fs |
File system operations |
wal |
Write-ahead log |
store |
Local data store |
sync |
Synchronization layer |
transport |
Network transport |
metadata |
Metadata management |
Each module can expose its own commands via the CLI.
MIT