Skip to content

About

The Rust implementation of osp: a plugin-driven CLI + REPL with layered config and consistent output rendering.

Resources

Contributing

Stars

9 stars

Watchers

0 watching

Forks

Repository files navigation

Verify Release Crates.io Docs.rs

osp-cli

osp-cli screenshot

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

As A Library

To build your own CLI with osp-cli, start with:

Install

From crates.io:

cargo install osp-cli --locked

From source:

cargo install --path . --locked

Run it:

osp --help
osp

Quick Start

CLI:

osp config show
osp theme list
osp plugins list

REPL:

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=false hides 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_on lists typing triggers: flag (default), space, and after_<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 -v
plugins list --json
plugins list --format table -v

Capabilities

  • 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

Configuration And Output

Default paths:

  • config: <platform-config-dir>/osp/config.toml (for example ~/.config/osp/config.toml on Linux)
  • secrets: <platform-config-dir>/osp/secrets.toml (for example ~/.config/osp/secrets.toml on 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:

Plugins

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:

Documentation

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:

Development

Useful commands:

python3 scripts/confidence.py --list
python3 scripts/confidence.py local

See:

License

GPLv3

About

The Rust implementation of osp: a plugin-driven CLI + REPL with layered config and consistent output rendering.

Resources

Contributing

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages