Documentation Index
Fetch the complete documentation index at: https://bastani.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
@bastani/atomic-sdk/workflows is a library, not just a CLI. Use it directly to build a TypeScript app that runs your team’s workflows.
Primitives, not a wrapper
The SDK ships pure functions you compose into whatever CLI shape you want — no opinionated wrapper to opt into.| Primitive | Purpose |
|---|---|
defineWorkflow | Author a workflow. Pass source: import.meta.path. |
createRegistry | Build an immutable registry. Each .register(wf) returns a new registry. |
listWorkflows(reg) | Snapshot every workflow. |
getWorkflow(reg, agent, name) | Resolve a workflow. |
getName / getAgent / getInputSchema / getDescription / getSource / getMinSDKVersion | Metadata accessors. |
validateInputs(wf, raw) | Run the same validation pipeline atomic uses. |
runWorkflow({ workflow, inputs, detach?, pathToAtomicExecutable? }) | Spawn the orchestrator session. |
listSessions / getSession / stopSession / attachSession / detachSession | Manage running sessions on the shared atomic socket. |
getSessionStatus / getSessionTranscript | Read on-disk run state. |
nextWindow / previousWindow / gotoOrchestrator | Pure tmux verbs for pane navigation. |
atomic binary, and bunx atomic all see the same runtime state — sessions live on the shared atomic tmux socket.
SDK-only prerequisites
You don’t need the globalatomic binary, but you still need the runtime prerequisites:
- Bun — the SDK does not run on Node.js.
- A terminal multiplexer (tmux on macOS/Linux, psmux on Windows).
- At least one authenticated coding agent CLI (
claude,opencode, orcopilot).
Registry rules
createRegistry()returns an immutable registry. Each.register(wf)call returns a new registry — the original is unchanged. Chain calls to accumulate workflows.- Each workflow is keyed by
${agent}/${name}— the(agent, name)pair must be unique. Registering a duplicate throws immediately. - Built-in workflows (
ralph,deep-research-codebase,open-claude-design) are managed byatomic’s internalcreateBuiltinRegistry(). They are reserved — user-registered workflows with the same name will not shadow built-ins when running theatomicCLI.
Single workflow
Most common shape. See runWorkflow.Multiple workflows — iterate a registry
examples/multi-workflow/ for a complete runnable version (two Claude workflows under one cli.ts).
Embedding under a parent CLI
Mount a workflow alongside plain Commander sibling commands. There’s no re-entry boilerplate — see runWorkflow → Embedding. The complete runnable example is atexamples/commander-embed/.
Building dispatchable workflows
If you want your workflow to be discoverable throughatomic workflow list, the picker, and atomic workflow -n <name> -a <agent>, end your entry file with await hostLocalWorkflows([wf]). The two paths don’t interfere — atomic’s dispatch subcommands are token-gated and process.exit before your own argv parser runs. See hostLocalWorkflows.
Building monitoring UIs on top of the SDK
Use the session primitives to build your own UI:examples/pane-navigation/cli.ts driver demonstrates the full set — start, list, status, next, prev, home, attach, stop — and catches SessionNotFoundError for friendly errors.
Migration from 0.x
Two breaking changes in 1.x:- Add
source: import.meta.pathto everydefineWorkflow({ ... })call. The SDK uses it to import the workflow module inside the orchestrator child process. - Replace
createWorkflowCli(workflow).run()with a small Commander (or citty / yargs) entrypoint that callsrunWorkflow({ workflow, inputs }). The SDK no longer ships a CLI wrapper. - Remove
handleOrchestratorReentry/runClicalls — the SDK ships its own orchestrator entry script and the dev’s CLI is never re-execed. - Update invocations: replace
atomic workflow -n foo -a claudewithbun run src/claude-worker.ts --<input>=<value>for your custom workflows. For the Atomic built-in set (ralph,deep-research-codebase,open-claude-design) keep usingatomic workflow -n <name> -a <agent>.