Adds the kb binary with clap v4 derive subcommands mapping 1:1 to
kb-app facade functions:
init | ingest | list docs | inspect (doc|chunk) | search | ask
| doctor | eval run
Global flags: --config, --verbose, --debug, --json. On --json, output
conforms to wire schema v1 (e.g. doctor.v1 emitted by kb-app::doctor).
Exit-code mapping per design §10:
0 success
1 RefusalSignal / NoHitSignal (kb ask refusal, kb search no-hit)
2 any other anyhow::Error
3 DoctorUnhealthy
Tracing initialized at startup with the file appender from kb-app.
Verified via:
XDG_*=… cargo run -p kb-cli -- init → idempotent
XDG_*=… cargo run -p kb-cli -- doctor --json
→ {"schema_version":"doctor.v1","ok":true,…} exit 0
XDG_*=… cargo run -p kb-cli -- doctor (human form, ✓ marks)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
568 B
TOML
21 lines
568 B
TOML
[package]
|
|
name = "kb-cli"
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
repository = { workspace = true }
|
|
description = "kb command-line interface"
|
|
|
|
[[bin]]
|
|
name = "kb"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
kb-core = { path = "../kb-core" }
|
|
kb-config = { path = "../kb-config" }
|
|
kb-app = { path = "../kb-app" }
|
|
anyhow = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
clap = { version = "4", features = ["derive"] }
|