@fctry/cli
v0.1.0
Published
fctry: repo-native principles and decisions for people and agents.
Readme
@fctry/cli
The fctry CLI reads and checks repo-native principles and decisions. It requires Node 24 or later.
Artifacts are Markdown files with YAML frontmatter under visible fctry folders.
fctry artifact list
fctry artifact show choice.dcn
fctry artifact resolve choice.dcn
fctry artifact schema dcn
fctry artifact check --root . --base main --challenges block
fctry hook install
fctry explorer serve [--root <dir>] [--port <n>]list, show and resolve accept --json. The check command prints text by default and can
emit SARIF with --format sarif and --output <file>. Errors fail; challenges are reported by
default. With --challenges block --base <ref>, only introduced challenges block. Explicitly
accept a challenge with --accept <rule>:<path>[:<line>] --reason <text> [--by <actor>].
Acceptances are recorded in artifact-bypasses.log as a stopgap until they are modelled properly.
The hook checks staged content against HEAD and refuses to replace an existing hook.
Authoring accepts a JSON array of {metadata, body} through --input or stdin. Each metadata
object includes type (dcn or prn) and a snake_case slug. Status defaults to draft;
staged requests full validation. Use decision write, principle write, or artifact write
for a related batch. The commands create files under fctry/decisions and fctry/principles
and refuse existing or duplicate destinations.
All findings appear together as text or SARIF with --json. Errors and unanswered challenges
block the entire batch. Accept a specific challenge with --accept <rule>:<path> --reason <text>;
repeat --accept for multiple challenges. The log binds each acceptance to the exact artifact
text. These commands do not create active artifacts or ratification entries.
The package exports pure identifier, frontmatter, citation, discovery and checking APIs. See checking results and artifact types for contracts. Licensed under Apache-2.0.
fctry explorer serve prints a loopback URL for a read-only view of indexed principles and decisions. It takes a snapshot at startup and reports when that view becomes stale; rebuild the index and restart it to refresh. The default port is assigned by the operating system.
Citation context in Claude Code
After building the local index with fctry index rebuild, configure a project or user
Claude Code settings file with the following hook. It reads the complete file after a
successful Read, Edit, or Write and supplies resolved citation context. The existing
fctry hook install command installs a Git pre-commit hook and is separate from this.
{
"hooks": {
"PostToolUse": [
{
"matcher": "Read|Edit|Write",
"hooks": [{ "type": "command", "command": "fctry hook claude-code" }]
}
]
}
}The output is bounded; truncation is indicated. A file with no citations produces no output. Hook errors are reported on standard error and do not block the session.
