@lifeascode/cli
v2.0.3
Published
Life-as-Code v2 CLI — create, advance, build, fill, lint, migrate
Readme
@lifeascode/cli
CLI and programmatic API for Life-as-Code v2.
Install
npm install -g @lifeascode/cliCommands
lac init [dir] Create lac.config.json in a project
lac create <type> <title> Scaffold a new node.json
--domain <domain> Required
--parent <id> Link to parent node
--owner <name>
lac advance <id> <status> Transition status with validation
--reason <reason> Required for frozen→active, any→deprecated
--dry-run Preview without writing
lac fill [id] Show missing fields
--all Scan all nodes below threshold
--threshold <n> Completeness % ceiling (default: 80)
--target-status <status> Show what is required for a specific transition
--prompt Output a Claude fill prompt
lac build [dir] Build .lac/graph.json, index.json, DOMAINS.md
--strict Exit 1 if any node fails validation
lac lint [dir] Validate all nodes
--strict Exit 1 on any error
lac search <query> Full-text search
--status / --type / --domain Filters
lac status [dir] Project health summary
--domain / --type Filters
lac export <dest> Copy .lac/ artifacts to a target directoryProgrammatic API
import {
// File system
findLacConfig, // walk up to find lac.config.json
scanNodes, // recursively find all node.json files
readAndValidateNode, // read + Zod-validate a single node
// Config
loadConfig, // load + resolve lac.config.json with @lifeascode/core merge
// Lifecycle
advanceNode, // validate + apply a status transition
getMissingForTransition, // fields required for a given transition
computeCompleteness, // 0-100 score for a node
// Fill
identifyGaps, // all empty fields, split blocking/recommended
buildFillPrompt, // Claude fill prompt for a node
applyFieldUpdates, // write dot-path updates, respecting locks
// Graph
buildGraph, // full graph.json from scanned nodes
buildIndex, // lean index.json
buildDomainsMd, // DOMAINS.md content
// Write
writeNode, // write node.json to disk
createNode, // scaffold new node in correct location
generateId, // generate next id for project+type
// Utilities
getNestedValue, // read dot-path from object
isEmpty, // check if a value is empty
} from '@lifeascode/cli'Node types (from @lifeascode/core)
feature bug decision epic research runbook faq release
Custom types can be added in lac.config.json.
