Skip to content

The reference command

Every subcommand runs as npx -y cyber-agentkit reference <subcommand>, and from the reference skill’s bundled launcher. Each name below links to its CLI page, which lists every argument and option.

Subcommand Does Writes
load <name>... Prints each reference, composed from its contributions, then its project sections. --trace says how it was built; --metadata adds the composed frontmatter; --default <skill folder> adds a skill’s defaults No
list [pattern] Lists one row per name, with its description, and its status when not found. * in the pattern matches any run of characters. --trace adds a row per layer holding it No
search <query> Finds references matching a query by name, description, tags, heading, or body, best ten first; --full for every match No
where <name> Shows the files a customization can go in, who each reaches, what hides each, and the heading paths to match No
create <name> Starts a contribution from a template, or a stub from an interface with --implements Yes
customize <name> Picks what a name builds on with --extends, or writes a body generated from a request; runs no model Yes
delete <name> Deletes a contribution, and reports what answers the name afterwards Yes
migrate [name]... Prints the plan to rewrite version 1 files and rename files under a renamed name; --write applies it With --write
implementations <id> Lists the implementations of an interface a consumer can load, each with its pin, and inUse for a one interface No
check [name]... Checks references against their shape and interface, and reports every warning load raises No
excerpt <name> <party> Prints a contract’s version line, then one party’s section word for word, for a brief No
check-report <name> <file> Checks a report opens with a contract’s version line, Model:, and Status: No
uses <path>... Lists the references the given files or folders load, and whether a bundled default ships for each No
advise <path>... Points out what the given text hard-codes that could move into references, as leads with their lines No
audit <path>... Runs advise and uses together; deprecated No
defaults <folder> Writes a skill’s bundled default copies from its plugin’s files; --check only checks them Without --check
register <id> Adds an interface or a capability reference to the public registry by pull request or issue, after you confirm Opens a pull request or issue

The pages of this section explain them by task:

create, customize, and delete act on the repo tier by default: .agents/references/ at the root.

  • --scope user acts on the user tier, ~/.agents/references/.
  • --in <folder> acts on that folder’s project section. The folder must be below the root, exist, and not be ignored by git.
  • create and delete also take --plugin <plugin folder> or --default <skill folder>, for a plugin’s or a skill’s source folder in the repository.

Pass at most one of these options. None of them writes to a managed folder or to an installed copy of a plugin or skill. --dry-run prints what a write would do. A write that a contribution above would hide still happens, with a reference-hidden warning. A write never takes a qualified name.

--root sets the repository root on every subcommand except advise, defaults, and register. By default it is the nearest folder that holds .git, starting at the working folder and moving up. A root that does not exist fails with root-missing.

Output is agent-first: a command prints only the fields that answer it. The global --format is toon (the default), json, or text. load, create, customize, and delete print text unless --format says otherwise.

  • load prints one found name’s document alone. Several names print as <reference name="..."> blocks in the order asked. A name not found prints <reference name="..." status="..." code="...">message</reference> in its place.
  • load --format json gives each found name’s content as a string. A name not found, one with warnings, or one with project sections is a record. --metadata makes every entry a record with its status and metadata.
  • --trace adds the trace. In text it prints on stderr. Customizing a reference shows how to read it.

Every warning is {code, message}: the code is stable, and the wording is not. In text, a warning prints on stderr as warning: <code>: <message>.

Errors follow the axi contract. A command that cannot complete prints one error value on stdout and writes nothing to stderr. The value holds error, a stable code, any detail fields, and help.

Exit Means
0 The command answered. This includes load for a name not found (its status and code are in the answer), a check with failures, and an empty list, search, or implementations
1 The command could not complete, such as a refused write (file-exists, name-outside-interface) or a missing root
2 A usage error, such as a missing name or two scope flags at once

A warning never changes the exit code.

The package exports the same operations:

import { loadReference } from 'cyber-agentkit'
const resolved = await loadReference('release-checklist', {
root: process.cwd(),
plugin: { name: 'my-plugin', root: pluginRoot },
defaultSkill: skillFolder,
})
if (resolved.status === 'found') console.log(resolved.content)

A function that cannot complete throws ReferenceError with the same code; the table of codes is exported as referenceCodes. The library API lists every function.