09: CLI and CI¶
9.1 Command reference (packages/cli, new layer namespace)¶
The commands ship today as ifc-lite layer <publish|create|status|diff|merge|push|log|bake|revert|rebase>
and ifc-lite ref <list|create|move|protect>; ifc below is the spec's shorthand. layer checks
is not a separate command — check evidence is attached with layer publish --check. See
the CLI guide for the shipped flags and examples.
The block below is the spec. Not implemented: publish --sign, a selector on
merge --resolve (the shipped flag takes only ours or theirs), and
log --graph / log --author. Shipped but not in the block: publish --principal,
--kind and --strict-scope; merge --waive <spec> --reason "<text>",
--approved-by and --principal; revert --in <ref> and --resolve.
layer publish as shipped requires <delta.ifcx> as its first argument. Use
ifc-lite layer publish <delta.ifcx> --base <ref|-> --intent "..." when there is
no saved draft. With a saved draft, --base and --intent default to its values.
layer status prints the draft's base, intent, scope, creation date and
whether the base ref has moved (no op count or scope usage).
(packages/cli/src/commands/layer-publish.ts, layer-merge.ts)
ifc layer create --base <ref|stack|file.ifcx> --intent "..." [--scope "<capability>"]
ifc layer status current draft: op count, scope usage
ifc layer publish [--check <spec.ids>=<report.json>]... [--sign <key>]
freeze + hash; stamps verified check
evidence (pass/fail derived from the
`ifc ids --json` report, spec + report
content-addressed); prints layer id
ifc layer diff <L> [--against <ref|L2>] [--components] [--json]
ifc layer merge <L> --into <ref> [--preview] [--resolve ours|theirs:<selector>] [--allow-unrelated]
ifc layer push <ref|L> --registry <url> [--token <bearer>] [--set-ref]
upload a stack (or one layer) plus its
check-evidence bytes to a registry
ifc layer log <ref> [--graph] [--author kind=agent]
ifc layer revert <L> emits inverse-op layer
ifc layer rebase <L> --onto <ref>
ifc layer bake <ref> -o composed.ifcx tombstone-free export for foreign tools
ifc ref list|create|move|protect ref + policy management (10 §10.4)
All commands emit --json for scripting; the diff/MergePlan JSON is byte-identical to what the MCP tools and the review UI consume.
9.2 GitHub Action (free funnel)¶
Not implemented: there is no layer GitHub Action in this repo yet.
ltplus-ag/ifc-layer-action: on push of .ifc/.ifcx to a repo, parse, publish as layer, diff against the ref, run IDS checks, comment the PR with the structured diff + check table, upload the composed preview to the embed viewer (@ifc-lite/embed-sdk). "Models get PRs like code" with zero registry dependency: this is the headless-CI concept absorbed as a byproduct, and the lowest-friction adoption wedge for developer-adjacent AEC teams.
9.3 Exit codes and budgets¶
Stable exit codes (0 clean, 2 conflicts, 3 required-check failure, 4 scope violation, 5 unrelated base — the candidate declares a base that matches nothing on the target ref; override with --allow-unrelated) so CI gates compose. CLI cold-start budget < 300ms (a design target; nothing measures it yet).