@bastani/atomic 0.10.14-alpha.1 → 0.10.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +9 -0
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -1,37 +1,44 @@
1
1
  ---
2
- title: "Extensions overview"
3
- sidebarTitle: "Extensions overview"
4
- description: "Build TypeScript extensions that add tools, slash commands, lifecycle hooks, and custom terminal UI to Atomic."
2
+ title: "Build extensions"
3
+ sidebarTitle: "Overview"
4
+ description: "Build TypeScript extensions that add custom tools, slash commands, lifecycle hooks, and terminal UI to Atomic."
5
5
  ---
6
6
 
7
- Extensions are TypeScript or JavaScript modules that customize how Atomic behaves. You can use them to add custom tools, intercept lifecycle events, register slash commands, store session state, or render custom terminal UI.
8
-
9
- Key capabilities:
10
-
11
- - **Custom tools.** Register tools the model can call with `atomic.registerTool()`.
12
- - **Event hooks.** Block or modify tool calls, adjust context before requests, observe or replace compaction, and customize branch summaries.
13
- - **User interaction.** Show interactive prompts and notifications via `ctx.ui` (`select`, `confirm`, `input`, `editor`, `notify`).
14
- - **Custom UI components.** Render interactive terminal components and overlays with `ctx.ui.custom()`.
15
- - **Custom commands.** Register slash commands such as `/mycommand` with `atomic.registerCommand()`.
16
- - **Session persistence.** Store durable data across restarts with `atomic.appendEntry()`.
17
- - **Reload-surviving state.** Keep in-memory objects alive across `/reload` with `sessionScopedExtensionState()`.
18
- - **Custom rendering.** Control how tool calls, tool results, and custom messages appear in the terminal.
19
-
20
- Common use cases include permission gates, git checkpointing, path protection, compaction policies, conversation summaries, interactive wizards, webhooks or file watchers, and waiting-time games. See [Extension examples](/extensions/examples) for runnable code.
21
-
22
- ## Where to go next
23
-
24
- Read this overview for a working first extension, discovery locations, imports, and runtime behavior, then continue:
25
-
26
- - [Write an extension](/extensions/authoring). Structure an extension, manage state, register custom tools, and customize rendering.
27
- - [Extension events](/extensions/events). Look up every lifecycle event, its payload, and its return contract.
28
- - [Extension UI](/extensions/ui). Build dialogs, widgets, host-native pickers and forms, custom components, and message renderers.
29
- - [Extension API reference](/extensions/api-reference). Reference `ExtensionContext`, `ExtensionToolContext`, `ExtensionCommandContext`, `ExtensionAPI` methods, and error handling.
30
- - [Extension examples](/extensions/examples). Browse runnable extensions shipped with Atomic.
31
- - [SDK extensions](/sdk/reference#extensions) and [Structured decisions](/sdk/structured-decisions). Load extensions programmatically with `DefaultResourceLoader`, pass standalone `customTools`, or run schema-validated decisions.
32
- - [Security](/security). Review the project-trust boundary that controls whether a project's extensions load.
33
-
34
- If an extension is heavier than you need, compare lighter options on [Build with Atomic](/build).
7
+ Extensions are TypeScript or JavaScript modules that customize how Atomic works. Use them to add custom tools, intercept lifecycle events, register slash commands, persist session state, or render custom terminal UI.
8
+
9
+ <Columns cols={2}>
10
+ <Card title="Write an extension" href="/extensions/authoring">
11
+ Structure an extension, manage state across reloads, register custom tools, and customize terminal rendering.
12
+ </Card>
13
+ <Card title="Extension events" href="/extensions/events">
14
+ Look up every lifecycle event, payload shape, handler chaining rule, and return contract.
15
+ </Card>
16
+ <Card title="Build custom UI" href="/extensions/ui">
17
+ Build dialogs, widgets, host-native pickers and forms, custom components, overlays, and message renderers.
18
+ </Card>
19
+ <Card title="Extension API reference" href="/extensions/api-reference">
20
+ Reference `ExtensionContext`, `ExtensionToolContext`, `ExtensionCommandContext`, `ExtensionAPI` methods, and typed errors.
21
+ </Card>
22
+ <Card title="Extension examples" href="/extensions/examples">
23
+ Browse runnable extensions shipped with Atomic for tools, gates, UI, sandboxes, and providers.
24
+ </Card>
25
+ <Card title="SDK extensions" href="/sdk/reference#extensions">
26
+ Load extensions programmatically with `DefaultResourceLoader`, pass inline factories, or register standalone `customTools`.
27
+ </Card>
28
+ </Columns>
29
+
30
+ If an extension is heavier than you need, compare skills, prompt templates, and themes on [Build with Atomic](/build). Before enabling project-local extensions in an unfamiliar repo, review Atomic's project-trust boundary in [Security](/security).
31
+
32
+ ## What extensions can do
33
+
34
+ | Goal | Primary API |
35
+ | --- | --- |
36
+ | Add or override model-callable tools | `atomic.registerTool()` |
37
+ | Gate tool calls, edit context, or customize compaction | `atomic.on("tool_call" \| "context" \| "session_before_compact", ...)` |
38
+ | Prompt the user or show status and widgets | `ctx.ui.select()`, `confirm()`, `input()`, `custom()`, `setStatus()`, `setWidget()` |
39
+ | Add interactive slash commands and keyboard shortcuts | `atomic.registerCommand()`, `atomic.registerShortcut()` |
40
+ | Persist durable data or keep objects alive across `/reload` | `atomic.appendEntry()`, `sessionScopedExtensionState()` |
41
+ | Register custom model providers or runtime MCP servers | `atomic.registerProvider()`, `atomic.registerMcpServer()` |
35
42
 
36
43
  ## Quick start
37
44
 
@@ -42,7 +49,7 @@ import type { ExtensionAPI } from "@bastani/atomic";
42
49
  import { Type } from "typebox";
43
50
 
44
51
  export default function (atomic: ExtensionAPI) {
45
- // React to events
52
+ // React to lifecycle events
46
53
  atomic.on("session_start", async (_event, ctx) => {
47
54
  ctx.ui.notify("Extension loaded!", "info");
48
55
  });
@@ -70,7 +77,7 @@ export default function (atomic: ExtensionAPI) {
70
77
  },
71
78
  });
72
79
 
73
- // Register a command
80
+ // Register a slash command
74
81
  atomic.registerCommand("hello", {
75
82
  description: "Say hello",
76
83
  handler: async (args, ctx) => {
@@ -80,7 +87,7 @@ export default function (atomic: ExtensionAPI) {
80
87
  }
81
88
  ```
82
89
 
83
- Test it for one run with `-e` (or `--extension`):
90
+ Test an extension for one session without installing it globally using `-e` (or `--extension`):
84
91
 
85
92
  ```bash
86
93
  atomic -e ./my-extension.ts
@@ -120,11 +127,13 @@ const { session } = await createAgentSession({
120
127
  });
121
128
  ```
122
129
 
123
- See [SDK extensions](/sdk/reference#extensions) and [SDK custom tools](/sdk/reference#custom-tools).
130
+ See [SDK extensions](/sdk/reference#extensions), [SDK custom tools](/sdk/reference#custom-tools), and [Structured decisions](/sdk/structured-decisions).
124
131
 
125
132
  ## Extension locations
126
133
 
127
- > **Security:** Extensions run with your full system permissions and can execute arbitrary code. Install only from sources you trust.
134
+ <Warning>
135
+ Extensions run with your full system permissions and can execute arbitrary code. Install and trust extensions only from sources you control or verify.
136
+ </Warning>
128
137
 
129
138
  Atomic auto-discovers extensions from these locations:
130
139
 
@@ -135,13 +144,13 @@ Atomic auto-discovers extensions from these locations:
135
144
  | `~/.atomic/agent/extensions/*/package.json` | Global subdirectories declaring `atomic.extensions` (or legacy `pi.extensions`) |
136
145
  | `.atomic/extensions/*.{ts,js}` | Project single-file extensions (trusted projects only) |
137
146
  | `.atomic/extensions/*/index.{ts,js}` | Project subdirectory extensions (trusted projects only) |
138
- | `.atomic/extensions/*/package.json` | Project subdirectories declaring `atomic.extensions` (trusted projects only) |
147
+ | `.atomic/extensions/*/package.json` | Project subdirectories declaring `atomic.extensions` (or legacy `pi.extensions`; trusted projects only) |
139
148
 
140
149
  Discovery rules:
141
150
 
142
151
  - Scanning respects `.gitignore`, `.ignore`, and `.fdignore` inside extension directories, and skips dotfiles, dot-directories, and `node_modules`.
143
- - Disable extension discovery with `--no-extensions` (short flag `-ne`). Explicit `-e` paths and the mandatory bundled Intercom extension still load.
144
- - Atomic also discovers extensions and packages inherited from legacy `~/.pi/agent` and `.pi` directories. If an inherited legacy extension registers the exact same tool, command, prompt, flag, or shortcut name as a bundled Atomic extension, Atomic keeps the bundled registration and skips only that conflicting registration (summarized in yellow on interactive startup). Extensions configured through `.atomic` or passed with `-e` follow normal override rules.
152
+ - Disable auto-discovery with `--no-extensions` (`-ne`). Explicit `-e` paths and the mandatory bundled Intercom extension still load.
153
+ - Atomic also discovers extensions and packages inherited from legacy `~/.pi/agent` and `.pi` directories. If an inherited legacy extension registers the same tool, command, prompt, flag, or shortcut name as a bundled Atomic extension, Atomic keeps the bundled registration and skips only the conflicting registration (summarized in yellow on interactive startup). Extensions configured under `.atomic` or passed with `-e` follow normal override rules.
145
154
 
146
155
  Configure extra paths or packages in `settings.json`:
147
156
 
@@ -158,7 +167,7 @@ Configure extra paths or packages in `settings.json`:
158
167
  }
159
168
  ```
160
169
 
161
- To distribute extensions over npm or git, see [Install and manage packages](/packages).
170
+ To share extensions over npm or git, see [Install and manage packages](/packages).
162
171
 
163
172
  ### Built-in extension resources
164
173
 
@@ -168,7 +177,7 @@ Atomic exposes `builtin:llama.cpp` ([llama.cpp](/llama-cpp)), `builtin:codemode`
168
177
  { "extensions": ["-builtin:codemode"] }
169
178
  ```
170
179
 
171
- A trusted project `"+builtin:codemode"` entry overrides a global exclusion. You can also load one explicitly alongside `--no-extensions` (`-ne`):
180
+ In global `settings.json`, `extensions` entries follow operator precedence (`!` < `+` < `-`); in a trusted project's `settings.json`, override entries are evaluated in array order (last match wins), so `"+builtin:codemode"` re-enables a globally excluded built-in. You can also load a built-in explicitly alongside `--no-extensions` (`-ne`):
172
181
 
173
182
  ```bash
174
183
  atomic --no-extensions -e builtin:codemode --tools read,codemode
@@ -178,7 +187,7 @@ Passing an unrecognized `builtin:<name>` with `-e` stops with `Unknown built-in
178
187
 
179
188
  Loading a built-in resource registers its tool. `codemode` is enabled in the default tool list (so a custom `--tools` list must name it), while `tool_search` is opt-in. Both `codemode` and `tool-search` are replaceable: a custom extension that registers the same tool, command, or flag takes over, and Atomic reports the replacement. Disable that extension in `atomic config` to restore the built-in version.
180
189
 
181
- These built-in names do not replace Atomic's bundled MCP, subagent, web-access, or Intercom packages. There are no `builtin:mcp` or `builtin:subagents` aliases; configure those through package settings and MCP configuration.
190
+ These built-in names do not replace Atomic's bundled MCP, subagent, web-access, or Intercom packages. There are no `builtin:mcp` or `builtin:subagents` aliases; configure those through package settings and [MCP servers](/mcp-servers).
182
191
 
183
192
  ## Available imports
184
193
 
@@ -186,12 +195,12 @@ Extensions can import Atomic's bundled packages without installing them in `node
186
195
 
187
196
  | Package | Purpose |
188
197
  | --- | --- |
189
- | [`@bastani/atomic`](/sdk) | Extension types (`ExtensionAPI`, `ExtensionContext`, events), helpers (`StringEnum`, `defineTool`), and built-in tool factories |
198
+ | [`@bastani/atomic`](/sdk) | Extension types (`ExtensionAPI`, `ExtensionContext`, events), helpers (`StringEnum`, `defineTool`, `boundOversizedText`, `installReactiveWidget`), and built-in tool factories |
190
199
  | [`@bastani/atomic/storage`](/sdk/storage) | Storage adapter interfaces, `createSqliteDatabase()`, and storage errors |
191
200
  | `@bastani/atomic/typebox` | Atomic's copy of TypeBox plus subpaths (`/compile`, `/error`, `/format`, `/guard`, `/schema`, `/system`, `/type`, `/value`) |
192
201
  | `typebox` and `@sinclair/typebox` | Direct schema imports (including `typebox/*`, `@sinclair/typebox/compile`, and `@sinclair/typebox/value`) resolve to Atomic's copy so formats registered with `Format.Set()` apply to tool validation |
193
- | [`@bastani/atomic-ai`](/libraries/ai) | AI utilities, provider APIs, image generation, and subpaths (`/oauth`, `/models`, `/providers/all`) |
194
- | [`@bastani/atomic-tui`](/libraries/tui) | Terminal UI components for custom rendering |
202
+ | [`@bastani/atomic-ai`](/libraries/ai) | AI utilities, provider APIs, image generation, and subpaths (`/compat`, `/oauth`, `/models`, `/providers/all`) |
203
+ | [`@bastani/atomic-tui`](/libraries/tui) | Terminal UI components and layout helpers for custom rendering |
195
204
  | [`@bastani/atomic-agent-core`](/libraries/agent-core) | Agent loop types and helpers |
196
205
  | [`@bastani/atomic-codemode`](/libraries/codemode) | Codemode sandbox and declaration helpers (`@bastani/atomic-codemode/*`) |
197
206
  | [`@bastani/atomic-schema`](/libraries/schema) | JSON Schema builders, validation, and `/formats` |
@@ -201,15 +210,11 @@ Atomic maintains these packages directly; [Libraries](/libraries) documents each
201
210
 
202
211
  Node.js built-ins (`node:fs`, `node:path`, and the rest of `node:*`) are always available.
203
212
 
204
- **Sharing TypeBox from dependencies and SDK apps.** Direct `typebox` imports inside an extension file map to Atomic's copy automatically. If a separate dependency or SDK app registers custom TypeBox formats, settings, or locales that must reach Atomic's tool validation, import from `@bastani/atomic/typebox` and its subpaths rather than from a separate `typebox` dependency. See [Sharing Atomic's TypeBox registry](/sdk#sharing-atomics-typebox-registry).
213
+ <Tip>
214
+ **Sharing TypeBox from separate dependencies or SDK apps:** Direct `typebox` imports inside an extension file map to Atomic's copy automatically. If a separate dependency or SDK app registers custom TypeBox formats, settings, or locales that must reach Atomic's tool validation, import from `@bastani/atomic/typebox` rather than from an independent `typebox` dependency. See [Sharing Atomic's TypeBox registry](/sdk#sharing-atomics-typebox-registry).
215
+ </Tip>
205
216
 
206
- **Third-party npm dependencies.** Add a `package.json` next to your extension (or in a parent directory) and install dependencies with npm, pnpm, or Bun:
207
-
208
- ```bash
209
- npm install
210
- ```
211
-
212
- Imports from `node_modules/` resolve automatically. For distributed packages installed with `atomic install` (npm or git), declare runtime dependencies in `dependencies`; `devDependencies` are omitted by default. When `npmCommand` is configured in `settings.json`, git package installs still detect `npm`, `pnpm`, or `bun` inside wrapper commands (such as `["mise", "exec", "node@20", "--", "npm"]`) and pass manager-specific flags to skip dev and peer dependencies. Plain `install` runs only for unrecognized package manager commands.
217
+ **Third-party npm dependencies:** Add a `package.json` next to your extension (or in a parent directory) and install dependencies with `npm install` (or your package manager). Imports from `node_modules/` resolve automatically. For distributed packages installed with `atomic install`, declare runtime dependencies in `dependencies` (`devDependencies` are omitted by default; see [Install and manage packages](/packages) for `npmCommand` details).
213
218
 
214
219
  ### Tool parameter schemas
215
220
 
@@ -220,14 +225,17 @@ A tool's `parameters` can be a TypeBox schema or any plain JSON Schema object. A
220
225
 
221
226
  ## Mode behavior
222
227
 
223
- | Mode | UI methods | Notes |
224
- | --- | --- | --- |
225
- | Interactive | Full TUI | Extensions run in a background worker so slow callbacks do not freeze the terminal |
226
- | RPC (`--mode rpc`) | JSON protocol | Host handles UI; see [RPC mode](/rpc) |
227
- | JSON (`--mode json`) | No-op | Event stream to stdout; see [JSON mode](/json) |
228
- | Print (`-p`) | No-op | Extensions run without interactive prompts |
228
+ Extensions run in every Atomic mode, but UI availability differs:
229
229
 
230
- Check `ctx.hasUI` (or `ctx.mode === "tui"`) before using UI methods in extensions that may run outside interactive mode.
230
+ | Mode | Display UI (`notify`, `setStatus`, `setWidget`, `setTitle`) | Prompts (`select`, `confirm`, `input`, `editor`) and `custom()` | Notes |
231
+ | --- | --- | --- | --- |
232
+ | Interactive CLI (default) | Supported (worker-isolated) | Supported (worker-isolated) | Extensions run in a background worker; some synchronous TUI APIs are unavailable. See [UI API compatibility matrix](/extensions/ui#ui-api-compatibility-matrix). |
233
+ | Embedded in-process TUI (SDK) | Full TUI | Full TUI | Extensions share the terminal UI process, enabling every `ctx.ui` API. |
234
+ | RPC (`--mode rpc`) | JSON protocol requests | Dialogs via JSON protocol; `custom()` resolves `undefined` | Host handles UI; component-factory `setWidget()` throws. See [RPC mode](/rpc). |
235
+ | JSON (`--mode json`) | No-op | Rejects with `HumanInputUnavailable` (unless a `humanInput` adapter is attached) | Event stream to stdout; `setTheme()` returns `{ success: false, error: "UI not available" }`. See [JSON mode](/json). |
236
+ | Print (`-p`) | No-op | Rejects with `HumanInputUnavailable` (unless a `humanInput` adapter is attached) | Single-run non-interactive execution; `setTheme()` returns `{ success: false, error: "UI not available" }`. |
237
+
238
+ Check `ctx.hasUI` (or `ctx.mode === "tui"`) before showing terminal UI, and check `ctx.hasHumanInput` before calling dialog methods in extensions that may run in print or JSON modes.
231
239
 
232
240
  ## Reloading and startup behavior
233
241
 
@@ -235,27 +243,18 @@ Auto-discovered extensions hot-reload when you run `/reload`. Atomic transpiles
235
243
 
236
244
  - **Module format.** ESM files keep `import.meta.url`, strict mode, top-level `await`, and package or Node built-in imports. CommonJS files keep `require`, `module.exports`, `__filename`, and `__dirname`.
237
245
  - **Caching on `/reload`.** Named npm packages, files under `node_modules` outside the extension's own package, and modules loaded via `createRequire()` are loaded once per process. Restart Atomic after editing those files.
238
- - **Bun and `globalThis`.** Under Bun, extensions load through Atomic's loader on initial startup as well as `/reload`, keeping `typebox` and `@bastani/atomic-*` imports pinned to Atomic's own copies. Modules that declare a top-level variable named `globalThis` cannot be loaded under either Node or Bun.
239
246
  - **Load failures.** If an optional extension fails to import or initialize during interactive startup or `/reload`, Atomic skips it, lists its path and error under `[Extension issues]`, and keeps the session open. Fix the issue and run `/reload`. In print (`-p`) and standalone RPC (`--mode rpc`) modes, any extension load failure prints the error and exits with code 1. Required built-in failures and cleanup failures stop startup in every mode.
240
- - **Reload cleanup failures.** If `/reload` reports `Reload retiring cleanup failed`, the error names the failing cleanup callback while keeping the replacement extensions, updated settings, and Intercom groups active. Fix the cleanup bug before reloading again.
241
- - **Built-in Herdr status reporter.** Inside a Herdr pane, Atomic automatically reports parent session status and resume commands with its built-in [Herdr integration](/herdr) and skips Herdr's legacy `herdr-agent-state.ts` or `.js` file (outside a Herdr pane, that legacy file loads normally). If you installed a separate `herdr-atomic-reporter` extension, disable either that extension or `herdr.enabled` in `settings.json` to prevent flickering status updates. See [Herdr setup](/herdr#setup).
242
-
243
- ## Startup and lazy discovery
244
-
245
- Built-in [MCP](/mcp-servers), [subagent](/subagents), [web-access](/web-access), and [Intercom](/intercom) commands are available immediately at startup. Their first call may wait for background discovery or connection to finish:
246
-
247
- - Enabled MCP servers connect in the background at startup. Your first prompt waits up to 10 seconds for servers that expose direct tools.
248
- - Codemode waits for the MCP namespaces a script names; `searchTools()` and `ALL_TOOLS` wait for all enabled servers. Tool search and resource tools wait for discovery too.
249
- - `/mcp` manages servers, and `/mcp login`, `/mcp logout`, and `/mcp reconnect` accept an optional server name. If lazy discovery fails, autocomplete falls back to currently known commands.
250
- - Dropped MCP connections reconnect on the next call, and failed connections can be retried with `/mcp reconnect`. Web-access batches report a tool error when every item fails and keep completed items on partial success.
247
+ - **Cleanup failures on `/reload`.** If a retiring extension's `session_shutdown` handler fails during `/reload`, Atomic reports the failing handler while keeping the replacement extensions and updated settings active. Fix the cleanup error before reloading again.
251
248
 
252
- MCP `timeout` is an inactivity limit in seconds (default 60 seconds) that resets on progress rather than a fixed total deadline. See [MCP servers](/mcp-servers) for details.
249
+ <Note>
250
+ Inside a [Herdr](/herdr) pane, Atomic reports parent session status automatically with its built-in integration. See [Herdr setup](/herdr#setup) if you previously installed a separate Herdr status extension.
251
+ </Note>
253
252
 
254
253
  <div id="interactive-callback-isolation" />
255
254
 
256
255
  ## Responsive UI and crash recovery
257
256
 
258
- In default interactive mode, Atomic runs extensions in a separate background worker process so slow or stuck extension code does not freeze keyboard input or terminal spinners.
257
+ In default interactive CLI mode, Atomic runs extensions in a separate background worker process so slow or stuck extension code does not freeze keyboard input or terminal spinners.
259
258
 
260
259
  ### Cancellation and Ctrl+C safety
261
260
 
@@ -285,40 +284,12 @@ If the extension worker crashes unexpectedly, Atomic closes open custom UI and a
285
284
 
286
285
  ### UI APIs in default interactive mode
287
286
 
288
- Dialogs, `ctx.ui.custom()` components, and widget factories run inside the extension worker and forward rendered output to the terminal. Values returned from `ctx.ui.custom()` must be JSON-serializable.
289
-
290
- APIs that require synchronous access inside the terminal UI process (`ctx.ui.onTerminalInput`, synchronous `ctx.ui.getEditorText`, `ctx.ui.setEditorComponent`, `ctx.ui.addAutocompleteProvider`, `ctx.ui.setHeader`, and `ctx.ui.setFooter`) do not run in default interactive mode and emit a warning instead. For interactive pickers and structured forms that work natively in default interactive mode, use `ctx.ui.hostSessionPicker()` and `ctx.ui.hostInputForm()`. See [Host-native pickers and forms](/extensions/ui#host-native-pickers-and-forms).
291
-
292
- ## Moved sections
293
-
294
- <div id="session-scoped-in-memory-state" />
295
-
296
- <div id="custom-rendering" />
297
-
298
- - Extension structure, state management, custom tools, overrides, remote execution, truncation, and custom rendering moved to [Write an extension](/extensions/authoring).
299
-
300
- <div id="before_agent_start" />
301
-
302
- <div id="message_start--message_update--message_end" />
303
-
304
- <div id="before_provider_request" />
305
-
306
- <div id="thinking_level_select" />
307
-
308
- <div id="tool-call-events" />
309
-
310
- <div id="user_bash" />
311
-
312
- - Lifecycle diagrams, event payloads, and return contracts moved to [Extension events](/extensions/events).
313
-
314
- <div id="widgets-status-and-footer" />
315
-
316
- <div id="autocomplete-providers" />
317
-
318
- - Dialogs, widgets, autocomplete providers, custom components, overlays, custom editors, and theme helpers moved to [Extension UI](/extensions/ui).
287
+ Dialogs, `ctx.ui.custom()` components, widget factories, status text, notifications, `setTitle()`, `setEditorText()`, and host-native pickers and forms (`hostSessionPicker()`, `hostInputForm()`) all work in default interactive CLI mode. Values returned from `ctx.ui.custom()` must be JSON-serializable because they cross the worker boundary.
319
288
 
320
- <div id="ctxsignal" />
289
+ Because extensions run outside the terminal UI process in default interactive mode, several `ctx.ui` APIs are unavailable or behave differently:
321
290
 
322
- <div id="pigetcommands" />
291
+ - **Warn and skip:** `onTerminalInput()`, `getEditorText()`, `setEditorComponent()`, `addAutocompleteProvider()`, `setHeader()`, and `setFooter()`.
292
+ - **Silent no-ops or stubs:** `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, `getAllThemes()`, `getTheme()`, `setTheme()` (returns `{ success: false, error: "Theme switching not supported in RPC mode" }`), and `atomic.registerMarkdownTransformer()`.
293
+ - **Degraded behavior:** `pasteToEditor()` falls back to `setEditorText()` (replacing text without paste collapse), `getToolsExpanded()`/`setToolsExpanded()` track only a worker-local boolean, `editor()` omits `timeout` countdowns, and `getChatRenderSettings()` returns static defaults for some display fields.
323
294
 
324
- - `ExtensionContext`, `ExtensionCommandContext`, `ExtensionAPI` methods, and error handling moved to [Extension API reference](/extensions/api-reference).
295
+ See the complete [UI API compatibility matrix](/extensions/ui#ui-api-compatibility-matrix) before designing interactive UI, and prefer [Host-native pickers and forms](/extensions/ui#host-native-pickers-and-forms) for fast lists and structured input.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: "Authenticate a provider"
3
- sidebarTitle: "Authentication"
3
+ sidebarTitle: "Authenticate a provider"
4
4
  description: "Connect Atomic to a model provider using a subscription login, the CLI auth command, or an API key."
5
5
  ---
6
6
 
@@ -10,61 +10,92 @@ description: "Connect Atomic to a model provider using a subscription login, the
10
10
 
11
11
  ## Choose an authentication method
12
12
 
13
- Connect with a subscription login (`/login`), the shell login command (`atomic auth login`), or an API key (via an environment variable or `~/.atomic/agent/auth.json`).
13
+ | What you want | Use this |
14
+ | --- | --- |
15
+ | Sign in with a subscription or account inside Atomic | Run `/login` in interactive mode |
16
+ | Sign in from a terminal, SSH session, or setup script | Run `atomic auth login <provider>` |
17
+ | Use an API key for the current shell only | Export the provider's environment variable (such as `ANTHROPIC_API_KEY`) |
18
+ | Save an API key for all future sessions | Run `/login` → **Use an API key** (or `atomic auth login <provider> --api-key`) |
19
+ | Connect Bedrock, Vertex AI, Azure, or local `llama.cpp` | See [Model providers](/providers) or [Local models with llama.cpp](/llama-cpp) |
14
20
 
15
- ### Sign in with a subscription
21
+ <Tabs>
22
+ <Tab title="Interactive /login">
23
+ Start Atomic and run `/login`:
16
24
 
17
- Start Atomic and run `/login`:
25
+ ```bash
26
+ atomic
27
+ ```
18
28
 
19
- ```bash
20
- atomic
21
- ```
29
+ ```text
30
+ /login
31
+ ```
22
32
 
23
- ```text
24
- /login
25
- ```
33
+ Choose **Use a subscription** (for subscriptions and OAuth accounts) or **Use an API key**, then select your provider. Supported subscription and account logins include OpenRouter, OpenAI (Sign in with ChatGPT), ChatGPT Plus/Pro (Codex), Claude Pro/Max, GitHub Copilot, Kimi Code, Meta (Muse), and xAI.
26
34
 
27
- Choose **Use a subscription**, then select your provider (such as Claude Pro/Max, ChatGPT Plus/Pro (Codex), GitHub Copilot, OpenRouter, Kimi Code, or xAI). You can also pass a provider name directly, such as `/login anthropic` or `/login openai`.
35
+ You can also jump directly to a provider:
28
36
 
29
- On remote or SSH sessions where the browser cannot reach Atomic's local callback port, paste the final redirect URL or authorization code into the prompt instead. Choosing Amazon Bedrock inside `/login` opens a guided Bedrock setup dialog rather than a plain API-key prompt.
37
+ - `/login anthropic` — Sign in with Claude Pro/Max or store an Anthropic API key.
38
+ - `/login openai` — Sign in with ChatGPT or store an API key for OpenAI's Responses API.
39
+ - `/login openai-codex` — Sign in to the ChatGPT Plus/Pro Codex backend.
40
+ - `/login openrouter` — Sign in with your OpenRouter account or store an OpenRouter API key.
30
41
 
31
- ### Sign in from the shell
42
+ <Tip>
43
+ **Remote or SSH sessions:** If your browser cannot reach Atomic's local callback port, copy the final redirect URL (or authorization code) from your browser and paste it into the login prompt. Choosing Amazon Bedrock inside `/login` opens a guided Bedrock setup dialog rather than a plain API-key prompt.
44
+ </Tip>
45
+ </Tab>
32
46
 
33
- Authenticate from your terminal without starting an interactive session:
47
+ <Tab title="Shell (atomic auth login)">
48
+ Sign in without starting an interactive session:
34
49
 
35
- ```bash
36
- atomic auth login anthropic
37
- ```
50
+ ```bash
51
+ atomic auth login anthropic
52
+ ```
38
53
 
39
- Pass `--no-browser` on SSH or headless machines to use a non-browser flow such as a device code, or pass `--api-key` to store an API key without echoing it. See [Credential commands](/reference/cli#credential-commands).
54
+ - Pass `--no-browser` on SSH or headless machines to use a non-browser flow such as a device code.
55
+ - Pass `--api-key` to enter and store an API key without echoing it to the terminal.
40
56
 
41
- ### Use an API key
57
+ See [Credential commands](/reference/cli#credential-commands) for `atomic auth check`, `atomic auth logout`, and scripting options.
58
+ </Tab>
42
59
 
43
- Export an API key before launching Atomic:
60
+ <Tab title="API key">
61
+ Export a provider environment variable before launching Atomic:
44
62
 
45
- ```bash
46
- export ANTHROPIC_API_KEY=sk-ant-...
47
- atomic
48
- ```
63
+ ```bash
64
+ export ANTHROPIC_API_KEY=sk-ant-...
65
+ atomic
66
+ ```
49
67
 
50
- Or save a key in `~/.atomic/agent/auth.json` (written with owner-only `0600` permissions) by running `/login`, choosing **Use an API key**, and selecting a provider.
68
+ To persist an API key across shells instead, run `/login`, choose **Use an API key**, and select a provider. Atomic saves stored keys and OAuth tokens in `~/.atomic/agent/auth.json` with owner-only `0600` permissions.
51
69
 
52
- See [Providers](/providers) for all supported providers, environment variables, and cloud setup for Amazon Bedrock, Google Vertex AI, and Azure.
70
+ See [Model providers](/providers) for every provider's environment variable name and cloud setup (Amazon Bedrock, Google Vertex AI, Azure, and NVIDIA NIM).
71
+ </Tab>
72
+ </Tabs>
53
73
 
54
74
  ## Verify authentication
55
75
 
56
- 1. Start Atomic and run `/model`. Confirm models appear for your provider with an active selection marked. If the list is empty, rerun `/login` or check that your API key is exported in the same shell.
57
- 2. Select a model and send a test prompt such as `Reply with hello.` A listed model or stored credential does not prove connectivity or quota; a live response confirms access.
76
+ <Steps>
77
+ <Step title="Check available models">
78
+ Start Atomic and run `/model`. Confirm your provider's models appear with an active selection marked. If the list is empty, rerun `/login` or confirm your API key is exported in the same shell.
58
79
 
59
- ### How `/login` and `/logout` work
80
+ You can also verify credentials from your shell without starting a session:
60
81
 
61
- - `/login` opens **Select authentication method:** with **Use a subscription** and **Use an API key**.
62
- - `/login <provider>` jumps straight to sign-in when the provider offers one method, opens the method selector when both subscription and API key exist, or prefills the search filter otherwise.
63
- - Provider status shows whether credentials exist (stored in `auth.json`, set in an environment variable, passed via `--api-key`, or configured in `models.json`); it does not test live connectivity.
64
- - OAuth sign-ins not backed by a subscription are labeled **account**.
65
- - Cancelling a sign-in returns to the previous menu.
66
- - `/logout [provider]` removes only credentials stored in `~/.atomic/agent/auth.json`. It does not clear environment variables or `models.json` entries.
82
+ ```bash
83
+ atomic auth check --provider anthropic
84
+ ```
85
+ </Step>
86
+ <Step title="Send a live test prompt">
87
+ Select a model and send a short prompt such as `Reply with hello.` A listed model or stored credential does not verify live connectivity or account quota—a completed reply confirms end-to-end access.
88
+ </Step>
89
+ </Steps>
90
+
91
+ ## How `/login` and `/logout` work
92
+
93
+ - Running bare `/login` opens **Select authentication method:** with **Use a subscription** and **Use an API key**.
94
+ - Running `/login <provider>` jumps straight to sign-in when the provider supports only one method, opens the method chooser when both OAuth and API key exist, or pre-fills the provider search filter otherwise. For OAuth providers not backed by a subscription (such as OpenRouter), the method chooser labels the OAuth choice **Use an account** instead of **Use a subscription**, and provider lists label it **account**.
95
+ - Provider status indicates whether credentials exist (`auth.json`, an environment variable, `--api-key`, or `models.json`); it does not test live connectivity.
96
+ - Pressing `Esc` or `Ctrl+C` cancels a sign-in and returns to the previous menu without altering previously saved credentials.
97
+ - `/logout [provider]` removes only credentials stored in `~/.atomic/agent/auth.json` (and legacy `~/.pi/agent/auth.json`). It does not clear environment variables, CLI flags, or `models.json` entries.
67
98
 
68
99
  ## Next step
69
100
 
70
- Continue to [Run your first session](/getting-started/first-session).
101
+ Continue to [Run your first session](/getting-started/first-session), or see [Choose a model](/models/choose-a-model) to compare providers and set up model cycling.
@@ -1,64 +1,78 @@
1
1
  ---
2
2
  title: "Run your first session"
3
- sidebarTitle: "First session"
4
- description: "Start Atomic in a repository, run your first task, inspect background work, and verify saved sessions."
3
+ sidebarTitle: "Run your first session"
4
+ description: "Complete first-time setup, run your first task in a repository, inspect background work, and verify saved sessions."
5
5
  ---
6
6
 
7
- **Outcome:** You complete one interactive task and verify its saved session.
7
+ **Outcome:** You complete first-time setup, finish one interactive task in a repository, and verify that the session was saved.
8
8
 
9
9
  **Prerequisites:** [Authenticate a provider](/getting-started/authentication) is complete.
10
10
 
11
- ## Start Atomic
11
+ ## Start Atomic and finish first-time setup
12
12
 
13
- Start Atomic in a repository directory:
13
+ Start Atomic inside a repository directory:
14
14
 
15
15
  ```bash
16
16
  cd /path/to/project
17
17
  atomic
18
18
  ```
19
19
 
20
- The first time you open an empty interactive session with no initial prompt on the command line, Atomic displays a one-time overview above the input box (after any What's New notes). Returning users skip it automatically; stored credentials alone do not skip it.
20
+ ### First-Time Setup wizard
21
21
 
22
- The prompt is ready immediately. Type a request, run `/login` to connect a provider, or run `/agents` to browse available subagents.
22
+ On a fresh install (when using the default `~/.atomic/agent/` directory before `settings.json` exists), interactive mode opens a two-step **First-Time Setup** screen before the prompt:
23
23
 
24
- ## Verify the session
24
+ 1. **Pick a theme:** Choose **Dark**, **Light**, or **System** (matching your terminal colors). Atomic pre-selects the option matching your detected terminal appearance and updates the theme live as you move through the list.
25
+ 2. **Anonymous usage analytics:** Choose **Share anonymous usage data** or **Don't share**. Your choice and a local random tracking ID are written to `~/.atomic/agent/settings.json`. Atomic does not transmit analytics data in this release, and you can change this setting anytime in `/settings`.
25
26
 
26
- Run a bounded task in a repository you know:
27
+ Use `↑`/`↓` or `j`/`k` to move between choices, `Enter` to continue or finish, and `Esc` or `Ctrl+C` to skip setup without writing `settings.json`.
27
28
 
28
- ```text
29
- List the top-level directories in this repository and say what each one holds.
30
- ```
29
+ ### Your first prompt
31
30
 
32
- Expected result: Atomic streams a response and calls `read`, `find`, or `bash` at least once, showing each tool call inline as it runs. It finishes with a summary naming directories that exist in your checkout. If it names nothing from your repository, quit, `cd` into the repository, and start Atomic again.
31
+ After setup finishes—on your first empty interactive session launched with no CLI prompt—Atomic displays a brief one-time welcome overview above the input box. Returning users skip both setup and the welcome overview automatically.
33
32
 
34
- Exit Atomic (`/exit`) and verify the session was saved:
33
+ Type any request to start working, run `/login` to connect a provider, or run `/agents` to browse available subagents.
35
34
 
36
- ```bash
37
- atomic -r
38
- ```
35
+ ## Verify the session
36
+
37
+ <Steps>
38
+ <Step title="Run a bounded repository task">
39
+ Ask Atomic to inspect a repository you know:
40
+
41
+ ```text
42
+ List the top-level directories in this repository and say what each one holds.
43
+ ```
39
44
 
40
- Expected result: the session picker lists the run you just finished. Run `atomic -c` to resume it.
45
+ Atomic streams its response and calls tools such as `read`, `find`, or `bash` inline as it works, then summarizes the directories in your checkout. If it mentions nothing from your repository, exit, `cd` into the repository, and launch `atomic` again.
46
+ </Step>
47
+ <Step title="Confirm the session saved">
48
+ Exit Atomic with `/exit`, then open the session picker:
49
+
50
+ ```bash
51
+ atomic -r
52
+ ```
53
+
54
+ Your completed session appears at the top of the list. Select it with `Enter`, or run `atomic -c` next time to continue the most recent session immediately.
55
+ </Step>
56
+ </Steps>
41
57
 
42
58
  ## Explore built-in capabilities
43
59
 
44
- Once your first session works, reach for these capabilities as needed.
60
+ Once your first session works, reach for these capabilities as your tasks grow.
45
61
 
46
62
  ### Delegate a larger task
47
63
 
48
- Ask Atomic to split independent work across [subagents](/subagents):
64
+ Ask Atomic to split independent work across background [subagents](/subagents):
49
65
 
50
66
  ```text
51
67
  Ask one subagent to trace the retry logic and another to find its tests. Compare their findings and show me any gaps.
52
68
  ```
53
69
 
54
- - Run `/tasks` to inspect background subagents and read their output.
55
- - Run `/resume` to return to a saved session.
56
-
57
- Converting an older Atomic workflow file? Give Atomic its path in a trusted project and ask it to convert the file into a skill. See [Migrating workflows](/orchestration/migrating-workflows).
70
+ - Run `/tasks` to inspect background subagents and shells, peek at their output, or send them follow-up instructions.
71
+ - Run `/resume` to return to any saved session.
58
72
 
59
73
  ### Top skills to invoke directly
60
74
 
61
- Skills are reusable instructions invoked with `/skill:<name>`:
75
+ Skills are reusable procedures invoked with `/skill:<name>`:
62
76
 
63
77
  | Skill | When to use | Example |
64
78
  | --- | --- | --- |
@@ -71,34 +85,30 @@ Skills are reusable instructions invoked with `/skill:<name>`:
71
85
  | `agent-desktop` | Drive a native desktop app through its accessibility tree: snapshot, act on a ref, wait for postcondition. | `/skill:agent-desktop` |
72
86
  | `qlty` | Lint, auto-format, and measure complexity, duplication, and code smells across languages. | `/skill:qlty check this branch before I hand it off` |
73
87
  | `liteparse` | Extract text, tables, or values from PDF, DOCX, PPTX, XLSX, and images locally. | `/skill:liteparse` |
74
- | `show-me` | Explain topics visually with diagrams, code sketches, or focused HTML views (HumanLayer, MIT). | `/skill:show-me` |
75
-
76
- Atomic bundles these skills with every release, and you can also add your own project or user skills. Note that `agent-browser`, `agent-desktop`, `qlty`, and `liteparse` require their external CLI binaries to be installed on your machine. See [Skills](/skills) for skill discovery, requirements, and authoring details.
88
+ | `show-me` | Explain topics visually with diagrams, code sketches, or focused HTML views. | `/skill:show-me` |
77
89
 
78
- ### Default tools and prompts
90
+ Atomic bundles these skills with every release, and you can add your own user or project skills. `agent-browser`, `agent-desktop`, `qlty`, and `liteparse` require their corresponding external CLI tools to be installed on your machine. See [Skills](/skills) for discovery and authoring details.
79
91
 
80
- Type any plain request and press Enter:
81
-
82
- ```text
83
- Summarize this repository and tell me how to run its checks.
84
- ```
92
+ ### Built-in tools
85
93
 
86
- By default, Atomic gives the model these built-in coding tools:
94
+ By default, Atomic gives the model these core coding tools (see [Built-in tools](/tools) for full inputs and options):
87
95
 
88
- - **`read`:** Read files, directories, images, archives, URLs, and SQLite selectors.
96
+ - **`read`:** Read files, directories, images, archives, URLs, and SQLite databases (using table/row selectors).
89
97
  - **`bash`:** Run shell commands.
90
- - **`kill`:** Cancel background shell tasks by task ID.
98
+ - **`kill`:** Stop background shell tasks by task ID.
91
99
  - **`edit`:** Patch files with exact text replacement.
92
100
  - **`write`:** Create or overwrite files.
93
- - **`find`:** Discover files by glob pattern.
101
+ - **`find`:** Find files by glob pattern.
94
102
  - **`search`:** Search file contents with regular expressions.
95
- - **`ask_user_question`:** Ask structured questions in the terminal UI.
96
- - **`todo`:** Manage file-based todos.
97
- - **`codemode`:** Compose permitted tool calls in a sandboxed script.
103
+ - **`ask_user_question`:** Prompt you with structured choices or text questions in the terminal UI.
104
+ - **`todo`:** Track file-based todos for multi-step work.
105
+ - **`codemode`:** Compose permitted tool calls inside a sandboxed JavaScript runtime (see [Codemode](/codemode)).
98
106
 
99
- On native Windows, `powershell` is also enabled when a PowerShell executable is available. Bundled integration tools such as `subagent`, `intercom`, `web_search`, and `fetch_content` are enabled alongside the coding tools by default; run `/tools` to inspect every active tool.
107
+ On native Windows, `powershell` is also enabled when a PowerShell executable is available. Bundled integration tools—including `subagent`, `intercom`, `web_search`, and `fetch_content`—are enabled alongside the coding tools by default. Run `/tools` anytime to see every active tool.
100
108
 
101
- Atomic runs in your current working directory and can modify files there, so use Git or another checkpointing workflow for easy rollback.
109
+ <Note>
110
+ Atomic runs in your current working directory and can edit files or run shell commands with your OS permissions. Work inside a Git repository (or rely on [Worktree snapshots](/worktree-snapshots)) for easy rollback, and see [Security](/security) for trust boundaries.
111
+ </Note>
102
112
 
103
113
  ## Next step
104
114