cli

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package cli provides the Traceary command-line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Localize

func Localize(english string, japanese string) string

Localize returns the English or Japanese string for the active CLI locale.

func Localizef

func Localizef(english string, japanese string, args ...any) string

Localizef formats the English or Japanese string for the active CLI locale.

func ResolveDefaultDBPath added in v0.3.0

func ResolveDefaultDBPath() (string, error)

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.

func (*RootCLI) Command

func (c *RootCLI) Command() *cobra.Command

Command returns the Traceary root command.

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.

Jump to

Keyboard shortcuts

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