cli

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package cli implements the non-hook subcommands. One concern per file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Card

func Card(args []string) error

Card inspects the card store: list, show <id>, rm <id>.

func Doctor added in v0.3.0

func Doctor(args []string) error

Doctor reports locally verifiable harness wiring. Codex does not expose its hook trust decisions through config, so doctor states that limitation rather than presenting "configured" as "trusted".

func Down

func Down(args []string) error

Down records an explicit downvote — the strongest negative utility signal. The multiplier is clamped, so even a hammered card stays retrievable; `culi card rm` is the way to actually remove one.

func Export

func Export(args []string) error

Export regenerates ~/.claude/agents and ~/.claude/skills from canonical cards. --check reports drift (hand edits, pending updates) without writing.

func Gen

func Gen(args []string) error

Gen runs learning pipeline C: git facts → CLAUDE.md marker spans + repo-scoped cards. Explicit user command, so unlike the background worker it errors loudly when no backend is available.

func Import

func Import(args []string) error

Import dispatches the drift-reconcile pipeline: scan → merge → apply.

func Index

func Index(args []string) error

Index syncs knowledge/ into the SQLite index, then embeds cards missing a fresh vector. A dead Ollama downgrades the second step to a notice — BM25 keeps working regardless.

func Init

func Init(args []string) error

Init sets up ~/.culi and registers the selected coding harnesses.

func Learn

func Learn(args []string) error

Learn drains the learning inbox once. --auto is the detached mode the session-end hook spawns: all output goes to logs/learn.log, exit is always clean (a background learner must never surface errors into a terminal that isn't there).

func MCP

func MCP(args []string) error

MCP serves the stdio MCP server — spawned by Claude Code, runs until the client disconnects.

func Query

func Query(args []string) error

Query runs the retrieval funnel from the terminal — the debug window into what a hook would inject for a given prompt.

func Review

func Review(args []string) error

Review is the optional HITL gate over mined candidate cards: approve (confirm — starts injecting), reject (retire), or leave for later. Mining never blocks on review; confirmation also happens organically at two observations.

func Serve

func Serve(args []string) error

Serve runs the local review console (plan §5): a web UI over the knowledge store for candidate triage, KB browsing, and token-savings/job-health dashboards. It is off every hot path — a convenience surface, not part of hook or MCP serving — so it opens the store read-mostly and reuses the same mine/index/knowledge functions `culi review` does for its few writes.

The StatsFn closure hands the console the `culi stats` report without serve importing this package (which would cycle): serve re-marshals it to JSON.

func Stats

func Stats(args []string) error

Stats prints the token-accounting and learning report (plan §10). All numbers are best-effort views over disposable state: the injection log is retention-bounded (~7 days), skip counts come from the hook log, spend from the learn ledger. --json emits the same report machine-readably for external monitoring (field names are snake_case; treat the schema as evolving, not a contract).

func Statusline

func Statusline(args []string) error

Statusline renders culi's segment for Claude Code's statusLine protocol: session JSON on stdin, one line on stdout. Same discipline as hooks (C1): any failure prints nothing and exits 0 — a broken statusline must never distract from a working session.

func Version

func Version(_ []string) error

Version prints the build's version, git commit, commit time, and Go version so you can confirm which build is running after an update.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL