cmd

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Review   ReviewCmd  `cmd:"" default:"withargs" help:"Review a Markdown file in TUI (default command: commd file.md)"`
	PR       PRCmd      `cmd:"" help:"Review Markdown files in a GitHub PR"`
	Cclocate LocateCmd  `cmd:"cclocate" help:"Locate file path from Claude Code transcript"`
	Cchook   HookCmd    `cmd:"cchook" help:"Run as Claude Code hook (PreToolUse ExitPlanMode or PostToolUse Write|Edit)"`
	Version  VersionCmd `cmd:"" help:"Show version"`
}

CLI is the top-level command structure for commd.

type HookCmd

type HookCmd struct {
	Spawner string `enum:"wezterm,tmux,auto" default:"auto" help:"Force specific multiplexer (wezterm|tmux|auto)"`
	Theme   string `enum:"dark,light" default:"dark" help:"Color theme (dark|light)"`
}

HookCmd is the hook subcommand.

func (*HookCmd) Run

func (h *HookCmd) Run() error

Run executes the hook subcommand.

type LocateCmd

type LocateCmd struct {
	Transcript string `help:"Path to transcript JSONL file" type:"existingfile"`
	CWD        string `help:"Working directory for resolving relative plansDirectory" default:"." type:"existingdir"`
	Stdin      bool   `help:"Read hook JSON input from stdin"`
	All        bool   `help:"Output all plan files found in transcript"`
}

LocateCmd is the locate subcommand.

func (*LocateCmd) Run

func (l *LocateCmd) Run() error

Run executes the locate subcommand.

func (*LocateCmd) Validate added in v0.8.0

func (l *LocateCmd) Validate() error

Validate requires exactly one of --transcript or --stdin; with --stdin the transcript path comes from the hook input, so a --transcript given alongside it would be silently ignored. The path resolved from stdin is checked in Run, not here.

type PRCmd added in v0.7.0

type PRCmd struct {
	URL   string `arg:"" help:"GitHub PR URL (e.g. https://github.com/owner/repo/pull/123)"`
	File  string `help:"Review a specific file instead of showing file picker"`
	Theme string `enum:"dark,light" default:"dark" help:"Color theme (dark|light)"`
	// contains filtered or unexported fields
}

PRCmd is the pr subcommand for reviewing Markdown files in a GitHub PR.

func (*PRCmd) Run added in v0.7.0

func (p *PRCmd) Run(client *ghclient.Client) error

Run executes the pr subcommand. The GitHub client is provided by Kong via BindToProvider; tests may call Run with a stub client directly. URL is guaranteed parseable here because Validate runs first.

func (*PRCmd) Validate added in v0.8.0

func (p *PRCmd) Validate() error

Validate ensures the PR URL is well-formed before Run is invoked.

type ReviewCmd

type ReviewCmd struct {
	Files       []string `arg:"" optional:"" name:"file" help:"Path to the Markdown file (with --diff: zero or more changed files)"`
	Output      string   `enum:"clipboard,stdout,file" default:"clipboard" help:"Output method (clipboard|stdout|file)"`
	OutputPath  string   `help:"File path for file output" type:"path"`
	Theme       string   `enum:"dark,light" default:"dark" help:"Color theme (dark|light)"`
	TrackViewed bool     `help:"Persist viewed state to sidecar file for change detection across sessions"`
	Diff        bool     `help:"Review local git changes in diff view; with no file, pick from changed .md files"`
	Base        string   `help:"Git ref to diff against (default: HEAD; requires --diff)"`
	// contains filtered or unexported fields
}

ReviewCmd is the review subcommand.

func (*ReviewCmd) Run

func (r *ReviewCmd) Run() error

Run executes the review subcommand.

func (*ReviewCmd) Validate added in v0.8.0

func (r *ReviewCmd) Validate() error

Validate requires --output-path when --output=file, exactly one <file> unless --diff is set, and rejects --base and --track-viewed combinations that only make sense in one of the two modes.

type VersionCmd

type VersionCmd struct {
	Version string `hidden:"" env:"version"`
}

VersionCmd is the version subcommand.

func (*VersionCmd) Run

func (v *VersionCmd) Run(vars kong.Vars) error

Run executes the version subcommand.

Jump to

Keyboard shortcuts

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