Documentation
¶
Overview ¶
Package cli implements the ki commands. cmd/ki only wires it to the process: standard streams, environment, signal context and exit code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// Stdin is read by the hidden `ki skill guard` and `ki session guard`; nil means os.Stdin.
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Getenv func(string) string
Version string
// GOOS selects the platform-specific service integration; empty uses runtime.GOOS.
GOOS string
// Exec replaces the process with the agent; tests substitute a recorder.
Exec func(bin string, argv, env []string) error
// Environ is the environment the agent inherits.
Environ func() []string
// Data replaces the agent instructions and skills embedded in the binary
// (agent/, skills/); nil means the embedded copy.
Data fs.FS
// Dir is where ki looks for the current repo; empty means the process's directory.
Dir string
// Executable is this ki binary, handed to agents so they can start
// `ki vault mcp`; nil means os.Executable.
Executable func() (string, error)
// Tmux runs tmux for `ki mecca`; nil means the tmux on PATH.
Tmux Tmux
// GitHubToken returns an account's token; nil means gh's stored one.
GitHubToken func(ctx context.Context, user string) string
// GitHubAPI is the REST and GraphQL base URL; empty means api.github.com.
GitHubAPI string
// GitHubHTTP optionally replaces the bounded HTTP client for GitHub requests.
GitHubHTTP *http.Client
// StallAfter is how long a streaming delegate worker may be silent before ki
// warns; zero means five minutes.
StallAfter time.Duration
// ResultGrace is how long a streaming worker may run on after its final
// result before ki ends it; zero means a minute.
ResultGrace time.Duration
// EventClock is the clock the stall and linger checks of a streaming worker
// read; nil means time.Now.
EventClock func() time.Time
// Notify shows a desktop notification when a job stalls and the machine asks
// for one; nil means osascript on macOS and nothing elsewhere.
Notify func(title, body string)
// ClaudeMCPList returns `claude mcp list`'s output for `ki mcp ls`; nil means the claude on PATH.
ClaudeMCPList func(ctx context.Context) (string, error)
// GH runs gh for `ki approve` as one account (its token in GH_TOKEN); nil means the gh on PATH.
GH ghRun
// Now is the clock provider picks and the queue read; nil means time.Now.
Now func() time.Time
// StartQueued hands a queued job to a ki process; nil means a detached `ki queue start <job>`.
StartQueued func(ctx context.Context, e ki.QueueEntry) error
// contains filtered or unexported fields
}
App holds everything a command touches outside its arguments, so tests can run commands against temporary directories and fake environments.
type UserError ¶
type UserError struct{ Msg string }
UserError is a problem the user has to fix; printed without noise.
type VaultListInput ¶
type VaultListInput struct {
Folder string `json:"folder,omitempty" jsonschema:"vault-relative folder, e.g. projects/acme; empty for the root"`
}
VaultListInput is the vault_list tool input.
type VaultReadInput ¶
type VaultReadInput struct {
Title string `json:"title" jsonschema:"note name without .md"`
}
VaultReadInput is the vault_read tool input.
type VaultSearchInput ¶
type VaultSearchInput struct {
Query string `json:"query"`
Limit int `json:"limit,omitempty" jsonschema:"max notes, default 20"`
}
VaultSearchInput is the vault_search tool input.
type VaultWriteInput ¶
type VaultWriteInput struct {
Area string `json:"area" jsonschema:"projects, engineering, reference, writing or ideas"`
Project string `json:"project,omitempty" jsonschema:"folder under projects/, e.g. acme; required with area projects"`
Kind string `` /* 138-byte string literal not displayed */
Title string `json:"title" jsonschema:"note name in Title Case, without a date prefix or .md"`
Body string `json:"body" jsonschema:"markdown body without frontmatter or an H1; wikilinks [[Note Name]] are fine"`
Overwrite bool `json:"overwrite,omitempty" jsonschema:"replace an existing note of this name at the same place"`
}
VaultWriteInput is the vault_write tool input.
Source Files
¶
- approve.go
- approve_gh.go
- approve_review.go
- ask.go
- cli.go
- commands.go
- config.go
- delegate.go
- delegate_health.go
- delegate_list.go
- delegate_log.go
- delegate_publish.go
- delegate_queue.go
- delegate_resume.go
- delegate_run.go
- delegate_stream.go
- delegate_watch.go
- delegate_worker.go
- diagram.go
- doctor.go
- doctor_behind.go
- folder.go
- instructions.go
- issue.go
- kb.go
- leading.go
- machine.go
- mcp.go
- mecca.go
- planner.go
- recap.go
- run.go
- service.go
- session.go
- setup.go
- setup_skills.go
- skill.go
- skill_checkout.go
- status.go
- update.go
- vault.go
- vaultmcp.go
- worktree_lock.go