Command tree defined in config.json
aethercli# show › system › cpu
- v0.7.1
- MCP · stdio
- TAB / ?
TAB / ? list the options at every level · MCP mode (stdio) for agents
INTELLIURB · PRODUCTS
aethercli
a hierarchical, discoverable command interface for administration and automation
aethercli is a Cisco IOS–style interactive shell for system and application administration. It does not ship a fixed set of commands: each application, or each deployment, supplies its own hierarchical command tree in a config.json file, mapping phrases such as show ip route to activations, that is, shell commands or scripts. Optional macros, localization and authentication build on that tree. Since version 0.7.0, an optional Model Context Protocol (MCP) server mode exposes that tree to AI agents as tools.
Index terms: command-line interface; automation; system administration; object-action paradigm; C++17.
Contents
Problem and motivation
Server and service administration tends to accumulate ad-hoc scripts, each with its own syntax, its own argument conventions and no common means of discovery. Operators must know in advance what exists, where it lives and what it is called; the knowledge is scattered across files, terminal histories and individual memory.
Network equipment solved a version of this problem long ago with hierarchical interfaces, in which commands are organised as a tree, accept unambiguous abbreviations and expose each level's options through ?. aethercli brings that model to system and application administration: instead of a scattered repertoire, a single declared, navigable and auditable tree whose leaves trigger the same commands and scripts that already existed.
What aethercli is
aethercli is an interactive shell, written in C++17, whose vocabulary is defined entirely by configuration. Each node of the tree in config.json has a name, an optional abbreviation, a short description, a syntax and an activation, the operating-system command or internal keyword to be executed.
Architecture and the object-action paradigm
The configuration is hierarchical, allowing subcommands organised in the manner of a professional router. The documentation recommends structuring trees according to the object-action paradigm:
- Level 1 (object): the managed resource, such as
service,database,network,systemoruser. - Level 2 (action): the operation on that resource, such as
start,stop,restart,status,backuporlist. - Level 3 / arguments: specific targets, identifiers or flags.
Three advantages are given: intuitive discovery (typing database ? shows every valid operation), collision-free verb reuse (service status and database status coexist) and a tidy root level for autocompletion.
Command fields
| Field | Purpose |
|---|---|
name | Name used in the terminal (required). |
abbrev | Explicit canonical abbreviation (optional). |
short_desc / description | Short description shown on double TAB; extended description. |
syntax | Help text with the command's syntax. |
activation | System command or internal keyword to execute. |
admin_only | Restricts execution to the authenticated admin user. |
args | "none" (default) rejects extra tokens; "append" appends them to the activation, each shell-escaped. |
subcommands | List of nested commands. |
Features
- Completion and discovery. TAB completes the token up to the longest common prefix; double TAB and
?instantly show the current level's options, without ENTER. Any unambiguous prefix works as the full command (sh ip ro=show ip route); ambiguous prefixes are reported. - Line editing. Arrows, Home/End, Ctrl+A/E, Ctrl+U/K, Ctrl+W and Ctrl+L, UTF-8 aware (accented characters take one column).
- History. Persistent across sessions in
~/.aethercli/history, mode 0600, last 500 entries. - Context prompts.
aethercli#andaethercli(config)#, with an optional status bar (CPU and memory metrics). - Headless mode. One-shot, non-interactive execution with
-p, suited to automation. - Macros.
.macrofiles whose lines are “typed” into the execution loop, with a recursion guard (MAX_MACRO_DEPTH). - Authentication. Optional, via
require_authenticationandusers.json; passwords hashed with PBKDF2-HMAC-SHA256 (600,000 iterations, random 16-byte salt per user). - Session limits. With
restricted_session, a user is limited to a single concurrent session, enforced with POSIX file locks. - Internationalisation.
lang_en.jsonandlang_pt.json, selectable with-l. - Dynamic configuration. In
configure terminal: user management, preferences and changes to the tree itself (add command,rm command), applied withreload confwithout restarting the shell. The/configuretree is protected. - Terminal robustness. Ctrl+C clears the line or interrupts only the running command; terminal settings are restored on exit, including on SIGINT, SIGTERM and SIGHUP. Non-zero exit codes and signals are reported.
Security and auditing
Execution model
aethercli only executes what is mapped in the activation field. Shell metacharacters in user input (for example, ; rm -rf /) are neutralised: extra tokens are passed as quoted, escaped arguments. By default a command accepts no arguments ("args": "none"); acceptance is opt-in, per command. When arguments are allowed, values starting with - are refused, to prevent flag injection, unless the activation explicitly ends with the -- end-of-options marker. All input, interactive, headless or from macros, is limited to 4096 characters.
Trust boundary. aethercli is not a privilege boundary: whoever can write the configuration file controls what runs. In restricted-shell deployments, the documentation recommends invoking it through a wrapper with a fixed -C and a root-owned configuration, with files 0644 and directories 0755.
Logs
Execution logging is disabled by default, to protect sensitive data. It is enabled with --log; the default location is ~/.aethercli/log/aethercli.log. The documentation warns against keeping logs on in production when commands handle passwords or private data, and notes that the interactive history also records typed commands.
Directory protection
Installation writes the configuration with explicit permissions, files 0644 and directories 0755, owned by the installing user (typically root); only the owner can edit config.json. Optional authentication uses the configuration below, and users must be created with the built-in tools (aethercli --adduser admin or add user), never by editing the file by hand.
{
"require_authentication": true,
"passwd-file": "/etc/aethercli/users.json",
"number_auth_fail": 3,
"restricted_session": true
}Agent integration via MCP
Since version 0.7.0, aethercli can act as a Model Context Protocol (MCP) server, allowing AI agents to use the same command tree offered to operators. The mode is optional: it exists only in binaries built with -DAETHERCLI_ENABLE_MCP=ON and is started with --mcp.
How it works
- Transport. JSON-RPC over stdio: one message per line on standard input.
- Protocol revisions. 2026-07-28 (per-request version in
params._meta,server/discover) and 2025-11-25 (initialize). - Tools. Every command with an
activationbecomes a tool, named by joining the path with underscores (database backup→database_backup).internal:activations are not exposed, nor areadmin_onlycommands for other users. - Schema and annotations. The input schema is generated from the typed parameters in
params(type,required,enum,pattern,minimum,maximum);effect(read,writeordestructive),idempotentandopen_worldare published as tool annotations. - Execution. Each command gets
/dev/nullas standard input; commands that set no output limit of their own are limited to 10 MiB per stream.
Security
With require_authentication, the server needs valid AETHERCLI_USER and AETHERCLI_PASSWORD variables in the environment and otherwise exits with status 1, because standard input belongs to the protocol. The first-use exception of the interactive login (becoming admin with no users.json) does not apply in MCP mode. The password is removed from the environment at startup and is not passed to commands.
Example
# build with MCP mode
cmake -DAETHERCLI_ENABLE_MCP=ON ..
# MCP server over stdio
aethercli -C /opt/ops/config.json --mcp
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"database_backup","arguments":{"banco":"estoque","retencao":30}}}' \
| aethercli -C /opt/ops/config.json --mcp | jq -c '.result|{isError,text:.content[0].text}'
{"isError":false,"text":"backup de estoque: retenção 30 dias, comprimir=false\n"}
$ printf '%s\n' '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"database_backup","arguments":{"banco":"vendas","retencao":999}}}' \
| aethercli -C /opt/ops/config.json --mcp | jq -c '.result|{isError,text:.content[0].text}'
{"isError":true,"text":"%% Erro: Parâmetro 'retencao' está fora da faixa permitida."}
tools/call requests to the database_backup tool, reproduced from RTFM.md, section 5 (in Portuguese in the source): the second is refused because the retention is outside the range declared in params.
Usage example
The example below uses the configuration shipped in the repository itself (etc/config.json), reduced to the relevant branches.
1. The command tree
// excerpt of etc/config.json (aether-cli repository; descriptions kept verbatim, in Portuguese)
{
"motd": "Welcome to AetherCLI - Advanced Management Shell\nType '?' or double-tab for help.\n",
"scripts_dir": "scripts",
"commands": [
{ "name": "show", "short_desc": "Exibir informações do sistema",
"subcommands": [
{ "name": "system", "short_desc": "Uso de recursos do sistema",
"subcommands": [
{ "name": "disk", "activation": "${AETHERCLI_SCRIPTS_DIR}/show-system-disk.sh" },
{ "name": "memory", "activation": "${AETHERCLI_SCRIPTS_DIR}/show-system-memory.sh" },
{ "name": "cpu", "activation": "${AETHERCLI_SCRIPTS_DIR}/show-system-cpu.sh" }
] },
{ "name": "files", "short_desc": "Listar arquivos",
"activation": "ls -la", "args": "append" }
] },
{ "name": "configure", "short_desc": "Entrar no modo de configuração",
"subcommands": [
{ "name": "terminal", "activation": "internal:config_mode" }
] },
{ "name": "time", "short_desc": "Mostrar a hora (atualizado)", "activation": "date" }
]
}
Excerpt of etc/config.json, with fields omitted for brevity.
2. An interactive session
$ aethercli -C /usr/local/etc/aethercli/config.json
Welcome to AetherCLI - Advanced Management Shell
Type '?' or double-tab for help.
aethercli# ?
configure find reload run show time …
aethercli# show system ?
cpu disk memory
aethercli# sh sys cpu # abbreviation of show system cpu
[output of show-system-cpu.sh]
aethercli# show files /var/log # args: append — /var/log is escaped into ls -la
aethercli# configure terminal
aethercli(config)# exit # back to exec mode
aethercli# quit
Illustrative transcript, consistent with the configuration above; script output is not reproduced and the root listing is abbreviated.
3. Automation: headless and wrapper
# one-shot, non-interactive execution
aethercli -C /path/to/your-app/config.json -p "show system cpu"
# wrapper pattern: one executable per service, with a fixed -C (RTFM, section 2)
#!/bin/sh
# /usr/local/bin/backup-cli
set -e
CONF="/opt/backup-system/etc/config.json"
exec /usr/local/bin/aethercli -C "$CONF" "$@"
The wrapper pattern avoids overloading a single config.json with unrelated utilities: each managed service gets an executable in $PATH that invokes aethercli with its own configuration.
4. Batch configuration macro
configure terminal
add user john
add user jane
set language portuguese-brasil
set statusbar on
reload conf
exit
initial_setup.macro (RTFM, section 4.2), applied with aethercli# run macro initial_setup.macro.
Build and install
Prerequisites: a C++17 compiler (GCC 9+, Clang or MSVC), CMake 3.14+ and network access on first configure (nlohmann/json may be fetched if not already installed).
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . -j"$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)"
sudo cmake --install .
# unit tests (Catch2), built by default
cd build && ctest --output-on-failure
With that prefix, the binary goes to /usr/local/bin/aethercli, configuration and scripts to /usr/local/etc/aethercli/ and the manual page to /usr/local/share/man/man1/aethercli.1 (man aethercli). The default config path is compiled in as AETHERCLI_CONFIG and can be overridden at runtime with -C.
Warning: installation copies etc/ into the configuration directory and can overwrite a customised config.json. Back it up first, or keep the application configuration elsewhere and always pass -C.
License and repository
aethercli is distributed under the BSD-3-Clause license. The source code, the full manual (RTFM, in Portuguese and English) and the UNIX man page are in the public repository.