Documentation
¶
Overview ¶
Package cli wires axx's command-line interface.
Index ¶
- Constants
- func Main(args []string) int
- func Run(ctx context.Context, app *App, args []string) int
- type App
- type CheckReport
- type DocsServeResult
- type DoctorCheck
- type DoctorReport
- type Envelope
- type EnvelopeError
- type ExplainedArg
- type ExplainedCode
- type ExplainedMatch
- type Explanation
- type FmtReport
- type GenerateReport
- type HookProblem
- type InitAgents
- type InitFile
- type InstallResult
- type PackDetail
- type PackInfo
- type PackSketch
- type PackSource
- type PackSuggestion
- type ParamInfo
- type Problem
- type Setting
- type StepInfo
- type UpgradeChange
- type UpgradeCheck
- type UpgradeResult
- type ValidationReport
Constants ¶
const ( // CodePackHook: a hook a pack runs before or after a command failed, // with an error of its own rather than one of axx's. CodePackHook = "AXX-E0022" // CodeHookFailed: a hook of axx.yaml (hooks.commands) failed. CodeHookFailed = "AXX-E0023" // CodeHookCommand: a hook of axx.yaml names no command axx runs hooks // with, or runs nothing. CodeHookCommand = "AXX-E0106" )
const CodeFmtWrite = "AXX-E0209"
CodeFmtWrite is a feature file `axx fmt` laid out but cannot write.
const CodePackArg = "AXX-E0011"
CodePackArg: an axx pack argument is invalid.
const CodePackCommand = "AXX-E0016"
CodePackCommand: a command a pack adds failed, with an error of its own rather than one of axx's.
const CodeRelaunch = "AXX-E0024"
CodeRelaunch: a pack could not run a command again in another process.
const EnvelopeSchemaVersion = 1
EnvelopeSchemaVersion is the version of the --json output envelope.
const Identity = `` /* 237-byte string literal not displayed */
Identity is the canonical one-liner used everywhere axx describes itself.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Stdout io.Writer
Stderr io.Writer
Env func(string) string
JSON bool
Compact bool
Config string
Verbose int
NoColor bool
// contains filtered or unexported fields
}
App carries process-wide state shared by all commands.
type CheckReport ¶
type CheckReport struct {
BaseDir string `json:"baseDir"`
Checks int `json:"checks"`
Failures []fixtures.Failure `json:"failures"`
// Unmaterialized are ignored outputs this checkout does not have yet,
// which `axx fixtures generate` writes.
Unmaterialized []string `json:"unmaterialized,omitempty"`
}
CheckReport is the JSON result of `axx fixtures check`.
type DocsServeResult ¶ added in v0.6.7
type DocsServeResult struct {
URL string `json:"url"`
Version string `json:"version,omitempty"`
Dir string `json:"dir"`
}
DocsServeResult is the JSON result of `axx docs serve`, written as it starts serving.
type DoctorCheck ¶
type DoctorCheck struct {
Name string `json:"name"`
Status string `json:"status"` // ok | warn | fail
Detail string `json:"detail,omitempty"`
Hint string `json:"hint,omitempty"`
}
DoctorCheck is one environment check.
type DoctorReport ¶
type DoctorReport struct {
Version version.Info `json:"version"`
Config string `json:"config,omitempty"`
Packs []PackSource `json:"packs,omitempty"`
Checks []DoctorCheck `json:"checks"`
}
DoctorReport is the JSON result of `axx doctor`.
type Envelope ¶
type Envelope struct {
SchemaVersion int `json:"schemaVersion"`
Command string `json:"command"`
OK bool `json:"ok"`
Data any `json:"data,omitempty"`
Errors []EnvelopeError `json:"errors,omitempty"`
}
Envelope wraps every --json response so agents can parse any command uniformly (see docs/adr/0003-cli-contract.md).
type EnvelopeError ¶
type EnvelopeError struct {
Code string `json:"code,omitempty"`
Message string `json:"message"`
Location *axxerr.Location `json:"location,omitempty"`
Hint string `json:"hint,omitempty"`
Docs string `json:"docs,omitempty"`
}
EnvelopeError is the JSON form of an error.
type ExplainedArg ¶
type ExplainedArg struct {
Param string `json:"param"`
Present bool `json:"present"`
Raw string `json:"raw,omitempty"`
}
ExplainedArg is one captured argument.
type ExplainedCode ¶
ExplainedCode is the JSON result of `axx explain AXX-Exxxx`.
type ExplainedMatch ¶
type ExplainedMatch struct {
ID string `json:"id"`
Pack string `json:"pack"`
Expr string `json:"expr"`
Args []ExplainedArg `json:"args"`
Arg string `json:"argument"`
}
ExplainedMatch describes one matching definition.
type Explanation ¶
type Explanation struct {
Line string `json:"line"`
Text string `json:"text"`
Status string `json:"status"` // matched | undefined | ambiguous
Match *ExplainedMatch `json:"match,omitempty"`
Candidates []ExplainedMatch `json:"candidates,omitempty"`
Suggestions []match.Suggestion `json:"suggestions,omitempty"`
}
Explanation is the JSON result of `axx explain`.
type FmtReport ¶ added in v0.6.5
type FmtReport struct {
// Files is how many feature files it read.
Files int `json:"files"`
// Changed are the files it laid out, or, with --check, those it would.
Changed []string `json:"changed"`
Check bool `json:"check,omitempty"`
}
FmtReport is the JSON result of `axx fmt`.
type GenerateReport ¶
type GenerateReport struct {
BaseDir string `json:"baseDir"`
DryRun bool `json:"dryRun,omitempty"`
Written []string `json:"written"`
Unchanged []string `json:"unchanged"`
}
GenerateReport is the JSON result of `axx fixtures generate`.
type HookProblem ¶ added in v0.6.1
type HookProblem struct {
Pack string `json:"pack"`
Command string `json:"command"`
Phase string `json:"phase"`
Problem string `json:"problem"`
}
HookProblem is a pack's command hook that never runs, and why: `axx doctor` reports it.
type InitAgents ¶ added in v0.1.1
type InitAgents struct {
// Detected are the agents the repository shows signs of using.
Detected []string `json:"detected"`
// Skills are where the skills were installed: .agents/skills, and
// .claude/skills for Claude Code.
Skills []InitFile `json:"skills"`
// MCP are the agents' MCP configurations: written, already there, or
// (Codex, whose servers live in the home directory) the command that adds axx.
MCP []agents.Change `json:"mcp"`
}
InitAgents is what `axx init` set up for coding agents.
type InitFile ¶
type InitFile struct {
Path string `json:"path"`
Action string `json:"action"` // create | update | skip
Reason string `json:"reason,omitempty"`
}
InitFile is one file `axx init` writes (or would write).
type InstallResult ¶ added in v0.5.0
InstallResult is what `axx install` did.
type PackDetail ¶ added in v0.3.0
type PackDetail struct {
Pack string `json:"pack"`
Summary string `json:"summary"`
Used bool `json:"used"`
Requires []string `json:"requires,omitempty"`
Doc string `json:"doc,omitempty"`
Settings []Setting `json:"settings,omitempty"`
Steps []StepInfo `json:"steps"`
// StepCount is the pack's number of steps (Steps may leave them out).
StepCount int `json:"stepCount"`
Related []PackSketch `json:"related,omitempty"`
}
PackDetail is `axx pack show`: a pack, what it reaches, its settings and its steps, as `axx steps` lists them (foldedSteps).
type PackInfo ¶
type PackInfo struct {
Pack string `json:"pack"`
Kind string `json:"kind"`
Steps int `json:"steps"`
Used bool `json:"used"`
// Summary says what the pack reaches.
Summary string `json:"summary,omitempty"`
}
PackInfo is one row of `axx pack list`.
type PackSketch ¶ added in v0.3.0
PackSketch is a pack in one line.
type PackSource ¶ added in v0.1.1
type PackSource struct {
Name string `json:"name"`
Module string `json:"module"`
Version string `json:"version,omitempty"`
Dir string `json:"dir,omitempty"`
}
PackSource is where a pack of this axx comes from: a module at a version, or a local directory.
func (PackSource) String ¶ added in v0.1.1
func (p PackSource) String() string
type PackSuggestion ¶ added in v0.3.0
PackSuggestion is a pack of axx's that `axx init` suggests for a repository, and what in the repository suggests it.
type Problem ¶
type Problem struct {
Kind string `json:"kind"` // undefined | ambiguous | argument | value
Location string `json:"location"`
Text string `json:"text"`
Message string `json:"message,omitempty"`
Suggestions []match.Suggestion `json:"suggestions,omitempty"`
Candidates []string `json:"candidates,omitempty"`
}
Problem is one validation finding.
type StepInfo ¶
type StepInfo struct {
ID string `json:"id"`
Pack string `json:"pack"`
Expr string `json:"expr"`
Variants []string `json:"variants"`
Keyword string `json:"keyword,omitempty"`
Arg string `json:"arg"`
// Columns name the columns of the step's data table, when it has one;
// Rows are the rows it knows (a service's properties), and TableNote
// says what its rows hold.
Columns []string `json:"columns,omitempty"`
Rows []core.TableRow `json:"rows,omitempty"`
TableNote string `json:"tableNote,omitempty"`
Doc string `json:"doc,omitempty"`
Examples []string `json:"examples,omitempty"`
Params []ParamInfo `json:"params,omitempty"`
Since string `json:"since,omitempty"`
Deprecated string `json:"deprecated,omitempty"`
// Twin is the id of the step's form for a named service (`… on
// {service}`), where a list folds that form into its step.
Twin string `json:"twin,omitempty"`
}
StepInfo is the JSON description of a step definition.
type UpgradeChange ¶ added in v0.5.0
type UpgradeChange struct {
Version string `json:"version"`
Date string `json:"date,omitempty"`
Sections []selfupdate.Section `json:"sections,omitempty"`
}
UpgradeChange is what one release changed.
type UpgradeCheck ¶ added in v0.5.0
type UpgradeCheck struct {
Command string `json:"command"`
OK bool `json:"ok"`
Output string `json:"output,omitempty"`
}
UpgradeCheck is one check of a project on the version it moved to.
type UpgradeResult ¶ added in v0.5.0
type UpgradeResult struct {
From string `json:"from"`
To string `json:"to"`
Path string `json:"path"`
Method string `json:"method"`
UpToDate bool `json:"upToDate,omitempty"`
// Available: --check, which changes nothing, found a newer release.
Available bool `json:"available,omitempty"`
Upgraded bool `json:"upgraded,omitempty"`
Changes []UpgradeChange `json:"changes,omitempty"`
// Skills are the skills it updated, by scope; SkillsProblem says why it could not.
Skills []string `json:"skills,omitempty"`
SkillsProblem string `json:"skillsProblem,omitempty"`
// Project: From and To are the versions this project's axx.yaml names, and Path
// is that file.
Project bool `json:"project,omitempty"`
// Checks are `axx validate` and `axx lint` on the version the project moved to.
Checks []UpgradeCheck `json:"checks,omitempty"`
// Installed is what became of the installed axx, which a project's move takes
// along when it is older; InstalledProblem says why it could not.
Installed *UpgradeResult `json:"installed,omitempty"`
InstalledProblem string `json:"installedProblem,omitempty"`
}
UpgradeResult is what `axx upgrade` did.
type ValidationReport ¶
type ValidationReport struct {
Files int `json:"files"`
Scenarios int `json:"scenarios"`
Steps int `json:"steps"`
Problems []Problem `json:"problems"`
// Warnings come from the builtin feature checks of `axx lint`; they do
// not change the exit code.
Warnings []Problem `json:"warnings,omitempty"`
// Hints name scenarios whose checks prove little, as `axx lint` does;
// they are for the author to judge and do not change the exit code.
Hints []string `json:"hints,omitempty"`
}
ValidationReport is the JSON result of `axx validate`.
Source Files
¶
- app.go
- commandhooks.go
- common.go
- coverage.go
- coverage_up.go
- debugsteps.go
- detach_unix.go
- docs.go
- docsserve.go
- doctor.go
- env.go
- explain.go
- fixtures.go
- fmt.go
- host.go
- hostfollow.go
- ide.go
- initcmd.go
- initpacks.go
- lint.go
- lsp.go
- mcp.go
- pack.go
- packcommands.go
- packref.go
- packs.go
- pin.go
- relaunch.go
- reminder.go
- root.go
- run.go
- schema.go
- schemaoutline.go
- skills.go
- steps.go
- up.go
- upgrade.go
- validate.go
- version.go