cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package cli implements the jaira command surface.

The CLI is the only write path into the store. Everything — the TUI, an agent working the board, a shell script — goes through the same core calls, so no caller can invent its own idea of what a valid ticket is. It is also designed to be driven by an agent over bash rather than by a human alone: read commands speak JSON on request, errors are machine-readable, and exit codes are a documented contract rather than an accident.

Index

Constants

View Source
const (
	ExitOK         = 0
	ExitError      = 1 // unexpected failure
	ExitUsage      = 2 // bad flags or arguments (cobra's own convention)
	ExitValidation = 3 // a gate refused the operation
	ExitBlocked    = 4 // unresolved dependencies
	ExitNotFound   = 5 // no such ticket, or an ambiguous prefix
)

Exit codes are part of the contract with any agent driving this tool. Changing one is a breaking change.

View Source
const ClaimTTL = 30 * time.Minute

ClaimTTL is how long a claim is honoured without being renewed.

Claims expire rather than being held until released, because there is no server to notice that a session died. A lease that outlives its holder would wedge the board and require manual unlocking — which, with no coordinator, means editing a file by hand. Expiry makes abandonment self-healing.

Variables

This section is empty.

Functions

func ClaimActive

func ClaimActive(t *ticket.Ticket, sessionID string) (holder string, active bool)

ClaimActive reports whether a ticket is claimed by someone other than sessionID.

func Execute

func Execute(version string) int

Execute runs the CLI and returns the process exit code.

Types

type Task

type Task struct {
	ID          string         `json:"id"`
	Subject     string         `json:"subject"`
	Description string         `json:"description"`
	Status      string         `json:"status"`
	Owner       string         `json:"owner"`
	BlockedBy   []string       `json:"blockedBy"`
	Metadata    map[string]any `json:"metadata"`
}

Task mirrors the shape of Claude Code's structured task tools (TaskCreate/TaskUpdate/TaskGet/TaskList). Only the fields jaira uses are modelled, and unknown fields are ignored, because this is an external API that has already changed once — it replaced the older flat TodoWrite list — and will change again. Keeping the adapter this thin is what makes the next change a small patch rather than a redesign.

Jump to

Keyboard shortcuts

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