idiolect-cli
Source:
crates/idiolect-cli/This crate is
publish = falseand is not on docs.rs. The CLI is intended to be installed and run, not depended on as a library.
The idiolect command-line tool wraps the library crates so operators and end
users do not need to write Rust for common operations.
cargo install --path crates/idiolect-cli
The CLI hardcodes the idiolect-lens features it needs
(pds-reqwest, pds-resolve). There are no CLI-level features
to set.
Subcommand surface
idiolect resolve <did>
idiolect fetch <at-uri>
idiolect orchestrator <subcommand>
idiolect encounter record [...]
idiolect oauth <login|list|logout> [...]
idiolect publish <kind> --record <path> [...]
idiolect verify <kind> [...]
idiolect version
idiolect help
The full reference is the CLI reference.
Parser boundary
The CLI uses a hand-rolled subcommand parser. Two reasons:
- The orchestrator subcommand surface is partly codegen-emitted
from
orchestrator-spec/queries.json. A clap surface would put two layers of declarative wiring on top of each other. - Compile time and binary size matter for a tool meant to be installed broadly.
Codegen surface
The CLI's orchestrator … dispatcher is emitted from
orchestrator-spec/queries.json into
crates/idiolect-cli/src/generated.rs. Adding a query (per the
orchestrator guide) regenerates
the dispatcher. The new subcommand becomes available
automatically.
The hand-written subcommands (resolve, fetch, encounter record,
oauth, publish, verify, version, and help) live in
main.rs and their sibling modules.
Output
All commands print pretty-printed JSON to stdout on success.
Errors go to stderr with error: <message>.
Configuration
| Setting | Default | Override |
|---|---|---|
| Orchestrator URL | http://localhost:8787 | --url flag on orchestrator subcommands |
| Log level | warn | RUST_LOG environment variable |
| Session directory | $HOME/.config/idiolect/sessions | IDIOLECT_SESSION_DIR environment variable |
| Login app password | none | --app-password, ATPROTO_APP_PASSWORD, or ATPROTO_PASSWORD |
The CLI does not read a config file.