Documentation
¶
Overview ¶
Package cli is the kno binary, built on fang over cobra.
The bar: a developer should never wonder what just happened, what it cost, or what to do next. Every command answers all three. Cost is always visible and confirmed before it is spent, every command ends by naming the next one, interruption is boring (checkpoint, then --resume), and errors name the exact fix.
Index ¶
Constants ¶
const StatusSchemaVersion = 1
StatusSchemaVersion is the shape of docs/status.json, for a consumer that must refuse a shape it does not understand.
It bumps ONLY on a breaking change: a key renamed, removed or retyped, or a value's meaning changed. Adding a key does not bump it, and a consumer that breaks on an unknown key is broken. The PR that bumps it owes two things in the same PR: a CHANGELOG entry under Unreleased, and an issue on uknoAI/kno-www naming the changed keys. CONTRIBUTING.md carries the protocol.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute runs the CLI and returns the process exit code.
It returns the code rather than calling os.Exit so that main stays a one-liner and every path here is testable — an Execute that exited could only be tested by spawning a subprocess. stdin is the consent prompt's and the wizard's input: a terminal in an interactive run, whatever the caller provides otherwise.
func WriteStatus ¶ added in v0.1.3
func WriteStatus(out io.Writer, debt StatusDebt) error
WriteStatus renders docs/status.json to out.
It contacts no network, resolves no credential and reads no file: every field but the ledger counts is compiled in, and those arrive as an argument. That posture is `kno doctor`'s, and it is what lets the generator run in a tree with HOME and every provider variable unset.
Types ¶
type StatusDebt ¶ added in v0.1.3
type StatusDebt struct {
// Total is how many ledger entries exist.
Total int
// Open is how many carry no disposition --- not repaid, not re-dated, not
// promoted to won't fix.
Open int
// Skipped is how many lines look like ledger rows and do not parse. The
// generator refuses to write a count over a nonzero Skipped, because a
// skipped row is an undercount presented as a fact.
Skipped int
}
StatusDebt is the Debt Ledger's size, as scripts/ledger-check.py reports it.
Passed in rather than read here, because docs/debt.md must have exactly one parser and it is that script. A Go reader of the same 84-row hand-written table would drift from the Python one the first time a row was formatted unusually, and it would drift silently: the two consumers ask different questions and would disagree without either failing.
Source Files
¶
- agentwiring.go
- baseline.go
- config.go
- consent.go
- demo.go
- doc.go
- doctor.go
- eval.go
- evalinspect.go
- evalinspect_json.go
- evalinspect_render.go
- evals.go
- export.go
- export_render.go
- init.go
- jsonreport.go
- mine.go
- poolwiring.go
- purge.go
- render.go
- report.go
- report_render.go
- root.go
- select.go
- select_render.go
- spend.go
- status.go
- tracing.go
- validate.go
- validate_render.go
- value.go
- value_render.go