@braidhq/cli
v0.4.2
Published
Command-line entry point for Braid.
Readme
@braidhq/cli
Braid keeps a product's intent and its code aligned in one knowledge graph. @braidhq/cli is the braid command, the terminal front door for scaffolding a workspace and running the stack locally.
Role
The entry point a user reaches for first. It scaffolds a workspace and boots the stack without any hand-wiring, then gets out of the way. It owns no logic of its own; each command is a thin shell over the server or the filesystem.
- Scaffold:
braid initlays down a workspace template on disk. - Run:
braid serveboots the server,braid devruns the server and Studio together for local development. - Inspect:
braid workspace listqueries a running server over HTTP.
Commands
braid init <dir>scaffolds a workspace template. Options:--ontology(defaultddd),--name(default the directory basename),--forceto overwrite an existingPRODUCT.md.braid serveruns the server.--portdefaults to4321.braid devruns the server and Studio together. In a monorepo checkout it spawns both dev processes so edits reload live; standalone it runs the server only.--portsets the server port, Studio stays on5173.braid workspace listlists the workspaces on a running server.--apidefaults tohttp://localhost:4321.
Structure
src/
├── main.ts cac command definitions, the braid binary
└── commands/
├── init.ts scaffold a workspace template on disk
├── serve.ts boot the server via the server package's startServer
├── dev.ts run server and Studio, monorepo or standalone
└── workspace.ts query a running server over HTTPBoundaries
- Orchestrates, does not implement.
servedelegates to@braidhq/server'sstartServer, so env loading, graceful shutdown, and background recovery match the server binary exactly.initonly writes files.workspacetalks to a server over HTTP. - Does not register a workspace.
initlays down the template on disk. Registration with a server is a Studio Wizard flow, not a CLI step. - Holds no state. Nothing here persists between invocations.
Dependencies
@braidhq/serverforstartServerand root env loading, soserveanddevshare the server's boot path.cacfor command parsing,picocolorsfor terminal colour.
