> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bastani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Programmatic use

> Choose between JSON event stream mode, RPC mode, the SDK, and the TUI component APIs, then follow one minimal integration.

# Programmatic use

Atomic exposes three integration modes plus a component API for interactive extension interfaces. Pick one mode, complete its minimal example, then continue to its reference.

## Choose a mode

| You want                                                                                  | Use                             | Start at             |
| ----------------------------------------------------------------------------------------- | ------------------------------- | -------------------- |
| A one-shot run whose output you parse as structured events                                | [JSON event stream mode](/json) | `atomic --mode json` |
| A long-lived process you drive with commands and read events from                         | [RPC mode](/rpc)                | `atomic --mode rpc`  |
| Atomic embedded inside a Node.js application, with its resources and lifecycle in-process | [SDK](/sdk)                     | `@bastani/atomic`    |

JSON mode is the smallest surface: one process, one prompt, a stream of newline-delimited events, then exit. RPC mode keeps the process alive so you can send more input, interrupt, switch models, and answer tool permission prompts. The SDK gives you the same engine as a library, with programmatic control over extensions, skills, tools, and session storage.

## Then continue to the contracts

* [RPC protocol](/rpc/protocol) — every command, event, and type.
* [RPC extension UI protocol](/rpc/extension-ui) — drive extension-rendered UI over RPC.
* [RPC client examples](/rpc/examples) — additional client implementations.
* [SDK API reference](/sdk/reference) — options, loaders, return values, run modes, and exports.

## Build interactive extension interfaces

[TUI components](/tui) covers writing a first component and the common interaction patterns; [TUI API reference](/tui/reference) holds the component, focusable, input, and rendering contracts.
