cli

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 55 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 = ticket.ClaimTTL

ClaimTTL is how long a claim is honoured without being renewed; see ticket.ClaimTTL, which the board reads too.

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.

func StaleClaim added in v0.1.1

func StaleClaim(t *ticket.Ticket, sessionID string) (holder string, since time.Duration, stale bool)

StaleClaim reports a claim that has expired and is therefore about to be stepped over: who held it, and how long ago it was last renewed.

Expiry is deliberate — there is no server to notice a session died, so a lease that outlived its holder would wedge the board — but until now it happened in silence. Two sessions could work the same ticket with nothing anywhere saying the second one walked over the first.

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