The command line (credencestack.cli*)¶
The credencestack command (Typer). Each command is a thin layer over the library: it parses options, calls the package function, prints and sets the exit code. python -m credencestack is the same CLI.
Responsibilities¶
- Expose every workflow: run, report, gate, sign and verify, export, packs, profiles, domain policies (
policy), warrant import, connectors, the benchmark and the MCP debug server. - Turn library errors into one-line messages on stderr with exit code 2, and failing results into exit code 1.
Non-goals¶
- Logic of its own. If a command needs new behaviour, add it to the package and call it from the command.
Examples¶
Every command and its help line, generated from the Typer app:
| Command | What it does |
|---|---|
credencestack bench brittleness |
Measure how agents hold up on generated scenarios at difficulty levels 1 to 5. |
credencestack bench run |
Run every agent × model configuration of a benchmark file, under a hard cost cap. |
credencestack config init |
Write a commented credencestack.toml with every setting at its default. |
credencestack config show |
Show every setting, its value, and where it came from (flag, env, file or default). |
credencestack connectors check |
Check that a connector delivers an agent's behaviour faithfully (the conformance kit). |
credencestack connectors list |
Show every connector: installed or not, versions, conformance and suspension. |
credencestack demo |
Run the offline demo: the naive and the safe reference agents on the same packs. |
credencestack doctor |
Check this installation: Python, extras, settings, paths and (optionally) telemetry. |
credencestack env episode |
Run one episode with an agent as the policy and show every step and the reward. |
credencestack env export |
Export generated tasks for training and evaluation pipelines. |
credencestack env serve |
Serve one scenario's environment over MCP until interrupted (Ctrl-C). |
credencestack evidence export |
Write a shareable copy of an output directory to <out>/export-<id>/, optionally redacted. |
credencestack evidence inspect |
Summarise any output directory; for a run, gate on its findings (for CI). |
credencestack evidence keygen |
Generate an Ed25519 signing key pair outside any git working tree. |
credencestack evidence verify |
Recompute every hash, trace chain and the Merkle root, and check the signature. |
credencestack generate |
Generate new scenarios from seed scenarios and mutators, labelled by the graders. |
credencestack mutators list |
List every mutator: shipped ones and plugins, confidential plugins by hash only. |
credencestack mutators show |
Describe one mutator and how many shipped scenarios it applies to. |
credencestack otel check |
Send one test span to the configured OTLP endpoint and report the result. |
credencestack otel print |
Run one small workflow offline and print the spans it emits (nothing is exported). |
credencestack packs init |
Create a new pack with one example scenario and a copy of the demo profile. |
credencestack packs list |
List packs with their scenario counts per pack and per pillar. |
credencestack packs schema |
Print a JSON Schema: scenarios, profiles, domain policies or output manifests. |
credencestack packs show |
Show one pack: its scenarios, with severity, pillars and target risks. |
credencestack packs validate |
Validate packs: schema, environment, references, profiles and graders. |
credencestack profiles explain |
Show the grader's decision for one proposed action, with reasons and rule ids. |
credencestack profiles import |
Turn a Tenuo warrant into an authority profile (needs credencestack[tenuo]). |
credencestack profiles init |
Write your own authority profile by answering eight questions. |
credencestack profiles validate |
Validate an authority profile or a domain policy and show what it grants. |
credencestack report |
Rebuild the report of an output directory and refresh its manifest. |
credencestack run |
Run an agent against scenario packs and write a signed-ready evidence bundle. |
credencestack test |
Test your agent as it is: no code changes, a report and what to fix first. |
credencestack version |
Print the CredenceStack version. |
The troubleshooting page shows real error output for 20 commands.
Invariants and gotchas¶
- Exit codes: 0 success, 1 a failing result (findings, FAIL, a gate breach), 2 a usage or input error.
- Error output is soft-wrapped, so long paths stay on one line and output does not depend on terminal width.
- Square brackets in help text must be escaped (
credencestack\\[mcp]), or Rich reads them as markup and drops them.
Where the tests are¶
Test files that import this package's modules (from the file index):
tests/integration/test_assess_cli.pytests/integration/test_confidential_bundles.pytests/integration/test_evidence_bundle.pytests/integration/test_manifests.pytests/unit/test_bench.pytests/unit/test_brittleness.pytests/unit/test_builtin_packs.pytests/unit/test_cli.pytests/unit/test_cli_authority.pytests/unit/test_cli_grammar.pytests/unit/test_conformance.pytests/unit/test_env_rl.pytests/unit/test_forge_mutators.pytests/unit/test_gate.pytests/unit/test_generate_cli.pytests/unit/test_otel.pytests/unit/test_otel_workflows.pytests/unit/test_policy_cli.pytests/unit/test_reports.pytests/unit/test_settings.pytests/unit/test_smoke.pytests/unit/test_tenuo.pytests/unit/test_verify.pytests/unit/test_visibility.py