Documentation
¶
Overview ¶
Package cli provides the Traceary command-line interface.
Index ¶
- func Localize(english string, japanese string) string
- func Localizef(english string, japanese string, args ...any) string
- func ResolveDefaultDBPath() (string, error)
- type MCPServerRunner
- type RootCLI
- type RootCLIOption
- func WithCodexIntegration(codexIntegration usecase.CodexIntegrationUsecase) RootCLIOption
- func WithContext(contextUsecase usecase.ContextUsecase) RootCLIOption
- func WithDatabasePathSetter(setter func(string)) RootCLIOption
- func WithDefaultReadColor(value string) RootCLIOption
- func WithDefaultReadFields(columns []string) RootCLIOption
- func WithEvent(event usecase.EventUsecase) RootCLIOption
- func WithExtraRedactPatterns(patterns []string) RootCLIOption
- func WithHooksInspector(inspector application.HooksInspector) RootCLIOption
- func WithHooksOrchestrator(orchestrator application.HooksOrchestrator) RootCLIOption
- func WithMCPServerRunner(runner MCPServerRunner) RootCLIOption
- func WithMemory(memory usecase.MemoryUsecase) RootCLIOption
- func WithMemoryBridgeImport(importUsecase usecase.MemoryBridgeImportUsecase) RootCLIOption
- func WithMemoryExport(memoryExport usecase.MemoryExportUsecase) RootCLIOption
- func WithMemoryExtraction(memoryExtraction usecase.MemoryExtractionUsecase) RootCLIOption
- func WithMemoryHygiene(hygiene usecase.MemoryHygieneUsecase) RootCLIOption
- func WithMemoryImport(memoryImport usecase.MemoryImportUsecase) RootCLIOption
- func WithReadPresets(presets map[string]presentation.ReadPreset) RootCLIOption
- func WithSession(session usecase.SessionUsecase) RootCLIOption
- func WithStoreManagement(storeManagement usecase.StoreManagementUsecase) RootCLIOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveDefaultDBPath ¶ added in v0.3.0
ResolveDefaultDBPath resolves the default database path from environment or conventions.
Types ¶
type MCPServerRunner ¶
type MCPServerRunner interface {
// Run starts an MCP server. The shared sqlite.Database has been
// resolved to the user-specified path by the RunE caller before Run
// is invoked, so no dbPath argument is needed here.
Run(ctx context.Context) error
}
MCPServerRunner provides MCP server startup.
type RootCLI ¶
type RootCLI struct {
// contains filtered or unexported fields
}
RootCLI provides the Traceary root command.
func NewRootCLI ¶
func NewRootCLI(opts ...RootCLIOption) *RootCLI
NewRootCLI creates a new RootCLI with the given options applied.
type RootCLIOption ¶ added in v0.4.0
type RootCLIOption func(*RootCLI)
RootCLIOption configures a RootCLI during construction. Options are applied in order, so later options override earlier ones.
func WithCodexIntegration ¶ added in v0.6.0
func WithCodexIntegration(codexIntegration usecase.CodexIntegrationUsecase) RootCLIOption
WithCodexIntegration injects the CodexIntegrationUsecase used by the integration codex install/uninstall commands.
func WithContext ¶ added in v0.5.0
func WithContext(contextUsecase usecase.ContextUsecase) RootCLIOption
WithContext injects the ContextUsecase used by structured handoff commands.
func WithDatabasePathSetter ¶ added in v0.4.0
func WithDatabasePathSetter(setter func(string)) RootCLIOption
WithDatabasePathSetter injects a callback invoked by every subcommand after it resolves the --db-path flag / TRACEARY_DB_PATH environment variable. The callback is typically a closure around the shared sqlite.Database's SetPath method, so datasources built from it open the user-specified path on the next operation.
func WithDefaultReadColor ¶ added in v0.7.0
func WithDefaultReadColor(value string) RootCLIOption
WithDefaultReadColor injects the default --color mode (auto / always / never) applied to read commands when the operator does not pass --color. Callers source this from read.color in the user config; empty string falls back to the built-in auto behavior.
func WithDefaultReadFields ¶ added in v0.7.0
func WithDefaultReadFields(columns []string) RootCLIOption
WithDefaultReadFields injects the default column order used by tail / list / search text output when the user does not pass --fields. Callers typically source this from the read.fields entry in the user config. Nil or empty lists fall back to the built-in default column order.
func WithEvent ¶ added in v0.4.0
func WithEvent(event usecase.EventUsecase) RootCLIOption
WithEvent injects the EventUsecase used by event-producing commands.
func WithExtraRedactPatterns ¶ added in v0.4.0
func WithExtraRedactPatterns(patterns []string) RootCLIOption
WithExtraRedactPatterns injects additional redaction regex patterns used by the audit command.
func WithHooksInspector ¶ added in v0.4.0
func WithHooksInspector(inspector application.HooksInspector) RootCLIOption
WithHooksInspector injects the HooksInspector used by the doctor command to inspect client hook configurations.
func WithHooksOrchestrator ¶ added in v0.4.0
func WithHooksOrchestrator(orchestrator application.HooksOrchestrator) RootCLIOption
WithHooksOrchestrator injects the HooksOrchestrator used by hooks and doctor commands. The orchestrator is required before the corresponding commands can run.
func WithMCPServerRunner ¶ added in v0.4.0
func WithMCPServerRunner(runner MCPServerRunner) RootCLIOption
WithMCPServerRunner injects the MCPServerRunner used by the mcp-server command.
func WithMemory ¶ added in v0.5.0
func WithMemory(memory usecase.MemoryUsecase) RootCLIOption
WithMemory injects the MemoryUsecase used by durable-memory commands.
func WithMemoryBridgeImport ¶ added in v0.7.0
func WithMemoryBridgeImport(importUsecase usecase.MemoryBridgeImportUsecase) RootCLIOption
WithMemoryBridgeImport injects the MemoryBridgeImportUsecase used by `memory import instructions`, which parses host instruction files into durable-memory candidates.
func WithMemoryExport ¶ added in v0.7.0
func WithMemoryExport(memoryExport usecase.MemoryExportUsecase) RootCLIOption
WithMemoryExport injects the MemoryExportUsecase used by `memory export`, which serializes accepted memories into a host-specific instruction file.
func WithMemoryExtraction ¶ added in v0.5.0
func WithMemoryExtraction(memoryExtraction usecase.MemoryExtractionUsecase) RootCLIOption
WithMemoryExtraction injects the MemoryExtractionUsecase used by candidate extraction commands.
func WithMemoryHygiene ¶ added in v0.7.0
func WithMemoryHygiene(hygiene usecase.MemoryHygieneUsecase) RootCLIOption
WithMemoryHygiene injects the MemoryHygieneUsecase used by `memory hygiene scan` to surface redaction / expiry / duplicate suggestions over the durable-memory store.
func WithMemoryImport ¶ added in v0.7.0
func WithMemoryImport(memoryImport usecase.MemoryImportUsecase) RootCLIOption
WithMemoryImport injects the MemoryImportUsecase used by `memory import` subcommands (for example Codex MEMORY.md import).
func WithReadPresets ¶ added in v0.7.0
func WithReadPresets(presets map[string]presentation.ReadPreset) RootCLIOption
WithReadPresets injects the user-defined read presets loaded from ~/.config/traceary/config.json. The builtin preset catalog is always available; these entries merge on top and override built-in names on collision (with a stderr warning from the resolver).
func WithSession ¶ added in v0.4.0
func WithSession(session usecase.SessionUsecase) RootCLIOption
WithSession injects the SessionUsecase used by session-related commands.
func WithStoreManagement ¶ added in v0.4.0
func WithStoreManagement(storeManagement usecase.StoreManagementUsecase) RootCLIOption
WithStoreManagement injects the StoreManagementUsecase used by init, backup, gc, and doctor commands.
Source Files
¶
- args.go
- audit.go
- backup.go
- cobra_required_flag.go
- compact_summary.go
- completion.go
- context.go
- context_command.go
- date_parse.go
- doctor.go
- doctor_version.go
- event_json.go
- event_output.go
- event_text_formatter.go
- gc.go
- handoff.go
- hook_runtime.go
- hooks.go
- hooks_guide.go
- hooks_helper.go
- i18n.go
- init.go
- input.go
- integration.go
- list.go
- log.go
- mcp_server.go
- memory.go
- memory_bridge.go
- memory_extract.go
- memory_hygiene.go
- memory_import.go
- memory_inbox.go
- memory_output.go
- output.go
- package.go
- read_color.go
- read_fields.go
- read_presets.go
- root.go
- search.go
- session.go
- session_gc.go
- session_label.go
- session_list.go
- session_resolution.go
- session_tree.go
- show.go
- tail.go
- timeline.go