osp-cli is a Rust command-line tool and interactive REPL for working with
structured data.
You can also use it as a library to build a CLI with your own commands, defaults, and integrations.
It combines:
- command execution
- interactive history, completion, and help
- layered configuration
- multiple render modes and output formats
- a small pipeline DSL
- external command plugins
Use it as:
- a normal command-line tool
- a long-running REPL with history, completion, inline help, and cached results
- a library for a site-specific CLI
To build your own CLI with osp-cli, start with:
From crates.io:
cargo install osp-cli --lockedFrom source:
cargo install --path . --lockedRun it:
osp --help
ospCLI:
osp config show
osp theme list
osp plugins listREPL:
osp> plugins list
osp> plugins list | P name about
osp> config explain ui.format
osp> help config
While you type in the REPL:
- Tab completes like a shell: a single match or the shared prefix first, then a menu of choices with their descriptions
- muted text after the cursor suggests the rest of the line from history or
the command tree; Right or End accepts it, Ctrl-Right cycles history choices,
and
repl.autosuggest=falsehides it - the line under the prompt explains the current command or flag, lists missing required flags, and names unknown words, which are shown in red
repl.complete_onlists typing triggers:flag(default),space, andafter_<n>_letters; an empty list leaves Tab and Ctrl-Space
See docs/COMPLETION.md.
Per-invocation flags work the same in the CLI and REPL:
osp plugins list --json
osp plugins list --format table -vplugins list --json
plugins list --format table -v
- CLI and REPL entrypoints with shared command semantics
- history, shell-style completion, inline suggestions, a status line, and error highlighting in the REPL, plus scoped shells
- invocation-local output and debug controls
- output formats including table, JSON, markdown, mreg, and value
- a row-oriented pipeline DSL for filtering, projection, grouping, sorting, aggregation, and quick search
- profile-aware config with file, env, secrets, CLI, and REPL-session layering
- theming, color policy, unicode policy, and presentation presets
- plugin discovery and dispatch through a JSON subprocess protocol
Default paths:
- config:
<platform-config-dir>/osp/config.toml(for example~/.config/osp/config.tomlon Linux) - secrets:
<platform-config-dir>/osp/secrets.toml(for example~/.config/osp/secrets.tomlon Linux)
On Linux, XDG_CONFIG_HOME overrides the base config directory when set.
Invocation flags such as --json, --format, --color,
-v, -q, and -d affect only the current
command. They do not mutate stored config.
See:
Drop an executable named osp-NAME on PATH or in a plugin directory.
It runs as osp NAME; optional metadata adds JSON rendering and completion.
See:
Start with:
If you are just using osp, read these first:
Core operator guides:
If you are building a product wrapper on top of osp-cli, read these:
If you are writing plugin executables or other extension-side integrations, read these:
If you are working on the repo itself, read:
Useful commands:
python3 scripts/confidence.py --list
python3 scripts/confidence.py localSee:
