cli

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeSuccess        = 0
	ExitCodeError          = 1
	ExitCodeSchemaMismatch = 2 // Schema version mismatch, migration needed
)

Exit code constants for CLI commands.

Variables

View Source
var ValidSeverities = []string{"low", "medium", "high", "critical"}

ValidSeverities is the canonical set of valid issue severity values.

View Source
var ValidStatuses = []string{"draft", "review", "approved", "deprecated", "archived"}

ValidStatuses is the canonical set of valid node status values.

Functions

func ComputeContentHash

func ComputeContentHash(n domain.Node) string

ComputeContentHash computes a SHA-256 hash of the content fields. Returns 16 hex characters (first 64 bits of the hash). Used by all mutation commands to record content state in history.

Included in hash: Kind, Title, Summary, Tags, Refs, Issues, Content, Glossary, Contracts, LLMContext, Constraints, Custom.

Excluded from hash: ID, Version, Status, Reviewers (workflow metadata).

func ComputeContentHashWithDir

func ComputeContentHashWithDir(n domain.Node, projectRoot string) string

ComputeContentHashWithDir computes a content hash that includes referenced doc files. When projectRoot is non-empty, the contents of referenced .md files are included in the hash so that changes to doc files trigger version bumps during sync.

func GetCurrentUser

func GetCurrentUser() string

GetCurrentUser returns the current system username, or "unknown" if unavailable.

func NewDiffCommand

func NewDiffCommand() *cobra.Command

NewDiffCommand creates the diff subcommand

func NewExportCommand

func NewExportCommand() *cobra.Command

NewExportCommand creates the export subcommand

func NewGraphCommand

func NewGraphCommand() *cobra.Command

NewGraphCommand creates the graph subcommand

func NewHistoryCommand

func NewHistoryCommand() *cobra.Command

NewHistoryCommand creates the history subcommand

func NewInitCommand

func NewInitCommand() *cobra.Command

NewInitCommand creates the init subcommand

func NewIssuesCommand

func NewIssuesCommand() *cobra.Command

NewIssuesCommand creates the issues subcommand

func NewLLMHelpCommand

func NewLLMHelpCommand() *cobra.Command

NewLLMHelpCommand creates the llm-help subcommand

func NewListCommand

func NewListCommand() *cobra.Command

NewListCommand creates the list subcommand

func NewMigrateCommand

func NewMigrateCommand() *cobra.Command

NewMigrateCommand creates the migrate subcommand.

func NewNewCommand

func NewNewCommand() *cobra.Command

NewNewCommand creates the new subcommand

func NewQueryCommand

func NewQueryCommand() *cobra.Command

NewQueryCommand creates the query subcommand

func NewReviewCommand

func NewReviewCommand() *cobra.Command

NewReviewCommand creates the review command with subcommands

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand creates and returns the root cobra command

func NewShowCommand

func NewShowCommand() *cobra.Command

NewShowCommand creates the show subcommand

func NewStatsCommand

func NewStatsCommand() *cobra.Command

NewStatsCommand creates the stats subcommand

func NewSyncCommand

func NewSyncCommand() *cobra.Command

NewSyncCommand creates the sync subcommand

func NewValidateCommand

func NewValidateCommand() *cobra.Command

NewValidateCommand creates the validate subcommand

func RenderBlockMarkdown

func RenderBlockMarkdown(block domain.Block) string

RenderBlockMarkdown renders a single content block as markdown. Used by both show --full (terminal) and export (markdown) commands.

Types

type Config

type Config struct {
	ConfigPath string
	Verbose    bool
	Quiet      bool
	Color      string
}

Config holds global CLI configuration

func GetConfig

func GetConfig() *Config

GetConfig returns the global configuration

type ExitError

type ExitError struct {
	Code    int
	Message string
}

ExitError represents an error with a specific exit code.

func NewExitError

func NewExitError(code int, message string) *ExitError

NewExitError creates an ExitError with the specified code and message.

func NewExitErrorf

func NewExitErrorf(code int, format string, args ...interface{}) *ExitError

NewExitErrorf creates an ExitError with a formatted message.

func (*ExitError) Error

func (e *ExitError) Error() string

type IssueResult

type IssueResult struct {
	NodeID   string
	NodeKind string
	Issue    domain.Issue
}

IssueResult holds an issue with its parent node context

type IssuesJSONOutput

type IssuesJSONOutput struct {
	Total  int                    `json:"total"`
	Open   int                    `json:"open"`
	Counts map[string]int         `json:"counts"`
	Issues []IssueResult          `json:"issues,omitempty"`
	ByNode map[string]NodeSummary `json:"by_node,omitempty"`
}

IssuesJSONOutput is the structure for JSON output

type NodeSummary

type NodeSummary struct {
	Kind   string         `json:"kind"`
	Counts map[string]int `json:"counts"`
}

NodeSummary is a per-node issue summary

Directories

Path Synopsis
Package style provides consistent terminal styling for deco CLI output.
Package style provides consistent terminal styling for deco CLI output.

Jump to

Keyboard shortcuts

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