Documentation
¶
Overview ¶
Package cli is the thin composition root: the cobra command tree, flag wiring, the flat-output printers, and the JSON emitters. The engine lives in the sibling packages (parse, paths, index, query, retrieve, view, render, semantic, adapters, agentproto).
Index ¶
- func EmitJSON(w io.Writer, obj any) error
- func Execute(root *cobra.Command, args []string) error
- func ListProjects(w io.Writer)
- func NewRootCmd(build BuildInfo) *cobra.Command
- func PrintResults(w io.Writer, res []retrieve.Hit, nSessions int)
- type BuildInfo
- type ExitError
- type LiveSetupReceipt
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitJSON ¶
EmitJSON writes obj as indented JSON (machine output, --json): 2-space indent, with HTML escaping disabled so <, >, & are emitted literally rather than \u-escaped.
func Execute ¶
Execute runs the command tree under the self-bounding watchdog. It resolves the effective deadline from --timeout / RAWCLAW_TIMEOUT (a lenient pre-parse, so the watchdog is armed BEFORE cobra dispatches — covering even a slow PreRun), arms the watchdog, then runs root.Execute. The disarm is deferred, so the watchdog goroutine is always torn down — on success, on a returned error, or on a panic — which keeps the goroutine-leak detector green. main calls this instead of root.Execute() directly.
func ListProjects ¶
ListProjects prints the searchable-projects table (with session counts). It enumerates the same Claude scopes search does — live project dirs PLUS orphaned index dbs whose source dir was purged (D8) — so a retained-but-purged project still shows, flagged so it doesn't read as a live source.
func NewRootCmd ¶
NewRootCmd builds the rawclaw cobra command tree (root + the `read`, `outline`, `archive`, `live`, `delete`, `setup`, `upgrade`, and `version` subcommands). The root RunE dispatches the shape (browse/discovery/stats/resume/reindex-vectors) per the parsed flags. The build stamp feeds `--version` (cobra-native) and the `version` subcommand.
Types ¶
type BuildInfo ¶
BuildInfo carries the compile-time stamp (set in package main via ldflags) down into the command tree so `--version` and the `version` subcommand report the real release. The zero value is honest: an un-stamped build shows "dev".
type ExitError ¶
ExitError carries a non-zero process exit code (and an optional usage-style message) up to main, which surfaces it via os.Exit.
type LiveSetupReceipt ¶ added in v0.9.0
type LiveSetupReceipt struct {
Status string `json:"status"`
Machine string `json:"machine"`
Target string `json:"target"`
RemotePath string `json:"remote_path"`
RemoteArch string `json:"remote_arch"`
RemoteOS string `json:"remote_os"`
Upgraded bool `json:"upgraded"`
PathRepaired bool `json:"path_repaired"`
}
LiveSetupReceipt is the structured JSON receipt returned when setup live completes.
type Options ¶
type Options struct {
Limit int
Dir string
ThisProject bool
All bool
List bool
Role string
Source string
Sort string
IncludeTools bool
IncludeSubagents bool
Reindex bool
JSON bool
Resume string
Stats bool
Since string
Before string
NoVector bool
ReindexVectors bool
IncludePath string
ExcludePath string
MinMessages int
DebugSearch bool
Timeout time.Duration
DirSet bool // --dir explicitly passed (the arbitrary-folder opt-in)
Oneline bool
Format string
// CurrentSession is the caller's own live session ("" = fall back to the
// runtime's env, "off" = don't exclude anything). Resolved by currentSession.
CurrentSession string
}
Options holds every parsed flag for one rawclaw invocation, bound to the cobra root command.
Source Files
¶
- apply.go
- archive_guess.go
- autosync.go
- cli.go
- cmd_archive.go
- cmd_archive_autosync.go
- cmd_archive_timer.go
- cmd_completion.go
- cmd_consolidate.go
- cmd_lifecycle.go
- cmd_live.go
- cmd_setup.go
- cmd_setup_live.go
- cmd_tag.go
- cmd_topics.go
- cmd_upgrade.go
- cmd_vector_topup.go
- detach_unix.go
- setup.go
- tagexport.go
- tagrefresh.go
- timeout.go
- timer.go
- vectortopup.go