Documentation
¶
Index ¶
- Variables
- func Brand()
- func BrandWith(verb string, subject string)
- func ClosestCommand(input string) (string, bool)
- func Error(msg string)
- func FormatNumber(n int) string
- func Hint(msg string)
- func HuhTheme() *huh.Theme
- func RunCheck(ctx context.Context, args []string) error
- func RunGenerate(ctx context.Context, args []string) error
- func RunHelp()
- func RunIndex(ctx context.Context, args []string, mode string) error
- func RunInit(ctx context.Context, args []string) error
- func RunLauncher(ctx context.Context) error
- func RunRules(ctx context.Context, args []string) error
- func RunStatus(ctx context.Context, args []string) error
- func RunVersion()
- func Section(name string)
- func Stage(name string, value string, detail string, dur time.Duration, last bool)
- func Success(msg string)
- func TreeLine()
- type IndexedRepo
Constants ¶
This section is empty.
Variables ¶
var ( StyleBrandMark = lipgloss.NewStyle(). Foreground(colorAmber). Bold(true) StyleDim = lipgloss.NewStyle(). Foreground(colorDim) StyleValue = lipgloss.NewStyle(). Foreground(colorWhite). Bold(true) StyleTree = lipgloss.NewStyle(). Foreground(colorAmber) StyleStage = lipgloss.NewStyle(). Foreground(colorWhite). Bold(true) StyleSuccess = lipgloss.NewStyle(). Foreground(colorAmber) StyleError = lipgloss.NewStyle(). Foreground(colorTerracotta) StyleSection = lipgloss.NewStyle(). Foreground(colorAmber) StyleHint = lipgloss.NewStyle(). Foreground(colorDim) StyleDesc = lipgloss.NewStyle(). Foreground(colorDimLight) )
var Version = ""
Version is the release a binary reports when set at link time, as a release build does with -ldflags "-X github.com/CtrlAltDelete-Ops/opentuple/internal/cli.Version=v0.2.0". It is a variable only because the linker can set nothing else; nothing assigns it at run time.
Functions ¶
func ClosestCommand ¶
func FormatNumber ¶
func RunCheck ¶
RunCheck is `opentuple check <file>...`: parse each file, compare its functions against the mined conventions of their subsystem, and print every violation to stderr as a plain-text block an agent can act on. Clean code prints nothing. Exit status: 0 clean, 1 violations, 2 error.
--hook reads a Claude Code PostToolUse event from stdin and checks the edited file instead, exiting 2 on violations — the status that shows stderr to the agent after an edit — and 1 on error, which Claude Code treats as non-blocking. --staged checks the source files staged in git, for the pre-commit hook.
func RunGenerate ¶
RunGenerate emits curated conventions from an existing index as agent context files (per-directory CLAUDE.md shards and/or a flat AGENTS.md).
func RunInit ¶
RunInit sets a repository up in one step: index it if needed, write the convention files, and install the Claude Code hook that checks every edited file. Running it again is safe: files it owns are rewritten in place, everything else is left alone.
func RunLauncher ¶
RunLauncher is the interactive experience behind bare `opentuple` on a TTY.
Types ¶
type IndexedRepo ¶
type IndexedRepo struct {
Name string // dir basename minus the -hash suffix
Dir string // full path under ~/.opentuple/repos
IndexedAt time.Time // mtime of index.db
}
IndexedRepo describes one repository index under ~/.opentuple/repos.
func ListIndexedRepos ¶
func ListIndexedRepos() ([]IndexedRepo, error)
ListIndexedRepos scans ~/.opentuple/repos for directories containing an index.db, newest first. It never opens the databases, so it stays instant regardless of how many repos are indexed.