/clibuilder:axifrom clibuilder
Designs or reviews CLI output for AI agent consumption using AXI conventions: token-efficient TOON output, minimal fields, truncation with counts, definitive empty states, coded errors/exit codes, next-step suggestions, and a live home view.
Ships in clibuilder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
AXI is a set of rules for a CLI whose main caller is an AI agent, so each command answers in one call. clibuilder 12 follows the ten upstream rules with three changes, and cli({ output: 'axi' }) is the default. For a CLI not built on clibuilder the rules still apply, and you implement each one by hand. General clibuilder usage is in the build-cli skill.
Helpers: import { fullOption, homeHeader, orEmpty, truncateList, truncateText, result, empty, ref, CliError, exitCodes } from 'clibuilder/axi'.
--format defaults to toon, with json and text also available. You: nothing.truncateText(), truncateList() and fullOption; core never truncates. You: call them, add options: { full: fullOption }, and hint --full when something was cut.truncateList() returns count as 30 of 847 total. You: put the count and any cheap derived status in the answer.empty(message) and orEmpty(items, message). You: say the zero with context, such as empty('0 open tasks found'), never a bare empty list.CliError with code, optional details and help. An exitCode above 2 is yours to define.run() runs when invoked bare. You: give the root a default command that returns live data.result(value, { help }) encodes help[N], and ref() builds a command line. Under cli(), a ref naming an unknown command or option throws when the answer is printed, so tests catch it. Refs do not take positional arguments yet: pass the target as an option. You: choose a few next steps.--help on every command (structured in toon and json), a fast bare --version, and homeHeader(). You: add examples to commands and homeHeader({ description }) to the home view.These differ from upstream AXI. Follow them, not upstream.
tasks[15]{number,title,state}:. Print single objects, errors and empty states as plain key: value lines, because TOON costs more on them. clibuilder does this in toon since 12.2.0; use result(value, { render: { toon } }) to override one answer.noun verb, two levels as the target and three as the ceiling, and prefer a flag to a level (pane list --dead). A bare group shows live data, then its own verbs only. A node's --help is that node's schema. There is no command that prints the whole tree. Give a group a run() returning result() or empty(), and core appends its valid sub-commands to help. A group without run() is a missing-command usage error.close. The tree check catches a wrong path or option, but only run() knows the object's state, so pick the refs from it.import { command, CliError, exitCodes } from 'clibuilder'
import { fullOption, empty, ref, result, truncateList } from 'clibuilder/axi'
export const list = command({
name: 'list',
description: 'List open tasks',
options: { full: fullOption },
examples: [{ command: 'my-cli task list', description: 'Show open tasks' }],
async run(args) {
const tasks = await loadTasks()
if (tasks.length === 0) return empty('0 open tasks found')
const { items, count, truncated } = truncateList(tasks, { limit: 30, full: args.full })
const help = [ref('task get', { id: items[0].id }, 'inspect one')]
if (truncated) help.push(ref('task list', { full: true }, 'see every task'))
return result({ count, tasks: items }, { help })
}
})
// in task get (declares an `id` option): fail with a code and a fix
throw new CliError(`no task ${id}`, { code: 'not-found', exitCode: exitCodes.error, details: { id }, help: ref('task list', {}, 'see valid ids') })
The list prints count, a tasks[N]{...} table and help[N]. The error prints error:, code:, the details and help[N] on stdout.
Report each rule or change the CLI breaks by its number, with the command, what it prints now, and the fix.
Before reporting done, check each of these against the result. Report any that fails.
--full through fullOption.empty() or orEmpty() with a message that names the zero.CliError with a code and a help line, and nothing prompts.ref() to an action valid for the object returned.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub clibuilder/clibuilder --plugin clibuilderOther plugins' skills for the same job