apex-code 0.4.0 → 0.5.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.
- package/CHANGELOG.md +280 -6
- package/README.md +624 -0
- package/dist/bun/cli.d.ts +3 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +3 -9
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/runtime-setup.d.ts +2 -0
- package/dist/bun/runtime-setup.d.ts.map +1 -0
- package/dist/bun/runtime-setup.js +9 -0
- package/dist/bun/runtime-setup.js.map +1 -0
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +16 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +2 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/session-picker.d.ts +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +13 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -8
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +85 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +685 -266
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +55 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bug-report.d.ts +176 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +291 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +12 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +103 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +356 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +5 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +163 -66
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context/pipeline.d.ts +8 -8
- package/dist/core/context/pipeline.d.ts.map +1 -1
- package/dist/core/context/pipeline.js +21 -12
- package/dist/core/context/pipeline.js.map +1 -1
- package/dist/core/crash-log.d.ts +27 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +139 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/export-html/template.js +6 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +4 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +4 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +40 -59
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +24 -8
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +195 -72
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +142 -55
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +41 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +1 -20
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +6 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +5 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +1 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +168 -20
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +44 -18
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +12 -6
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/permissions/store.d.ts.map +1 -1
- package/dist/core/permissions/store.js +11 -8
- package/dist/core/permissions/store.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +61 -35
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +4 -2
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +29 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +3 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +6 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +63 -42
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +6 -2
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js +14 -13
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts +66 -15
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +295 -115
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +27 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +56 -8
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +5 -4
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts +49 -6
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +140 -79
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +9 -15
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +20 -137
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +2 -2
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -12
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +6 -204
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +4 -55
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -60
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +4 -49
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +4 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +10 -122
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts +18 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +126 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +207 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +34 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +11 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +132 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +152 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +6 -147
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-totals.d.ts +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +5 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -3
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +20 -5
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +3 -2
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +21 -13
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts +16 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +167 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts +20 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +28 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +63 -27
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/autocomplete-source.d.ts +8 -0
- package/dist/modes/interactive/components/autocomplete-source.d.ts.map +1 -0
- package/dist/modes/interactive/components/autocomplete-source.js +23 -0
- package/dist/modes/interactive/components/autocomplete-source.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +6 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -5
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/composer-dock.d.ts +12 -0
- package/dist/modes/interactive/components/composer-dock.d.ts.map +1 -0
- package/dist/modes/interactive/components/composer-dock.js +24 -0
- package/dist/modes/interactive/components/composer-dock.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +11 -9
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +12 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +38 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/error-summary.d.ts +11 -0
- package/dist/modes/interactive/components/error-summary.d.ts.map +1 -0
- package/dist/modes/interactive/components/error-summary.js +31 -0
- package/dist/modes/interactive/components/error-summary.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +4 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +15 -10
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +2 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +15 -5
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +15 -10
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +6 -6
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +12 -4
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +21 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +34 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +27 -23
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +16 -20
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +7 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/permission-preview.d.ts.map +1 -1
- package/dist/modes/interactive/components/permission-preview.js +3 -3
- package/dist/modes/interactive/components/permission-preview.js.map +1 -1
- package/dist/modes/interactive/components/prompt-input.d.ts +12 -0
- package/dist/modes/interactive/components/prompt-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/prompt-input.js +18 -0
- package/dist/modes/interactive/components/prompt-input.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +17 -18
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +5 -5
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +100 -67
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +5 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +74 -16
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +8 -6
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +3 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +10 -3
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +14 -9
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +28 -16
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +73 -80
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-panel.js +7 -2
- package/dist/modes/interactive/components/tool-panel.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +18 -5
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +12 -12
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +2 -2
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +6 -3
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +50 -31
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +494 -229
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +2 -1
- package/dist/modes/interactive/theme/light.json +2 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +5 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +130 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +6 -2
- package/dist/modes/interactive/theme/theme.d.ts +14 -5
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +18 -119
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +21 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +66 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +49 -23
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/testing/replay/recorded-provider.d.ts +2 -2
- package/dist/testing/replay/recorded-provider.d.ts.map +1 -1
- package/dist/testing/replay/recorded-provider.js +2 -5
- package/dist/testing/replay/recorded-provider.js.map +1 -1
- package/dist/testing/replay/runner.d.ts.map +1 -1
- package/dist/testing/replay/runner.js +0 -1
- package/dist/testing/replay/runner.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +53 -81
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +111 -121
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +21 -21
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts +3 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js +4 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +11 -2
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/cli-integration.md +107 -0
- package/docs/cli.md +269 -0
- package/docs/compaction.md +73 -24
- package/docs/configuration.md +45 -0
- package/docs/containerization.md +22 -21
- package/docs/custom-provider.md +21 -12
- package/docs/development.md +19 -0
- package/docs/docs.json +139 -95
- package/docs/extensions.md +243 -371
- package/docs/how-pi-works.md +49 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +3 -3
- package/docs/json.md +43 -3
- package/docs/keybindings.md +57 -54
- package/docs/llama-cpp.md +2 -2
- package/docs/message-types.md +261 -0
- package/docs/models.md +103 -49
- package/docs/packages.md +49 -47
- package/docs/prompt-templates.md +29 -56
- package/docs/providers.md +91 -139
- package/docs/quickstart.md +42 -14
- package/docs/rpc-commands.md +854 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +121 -223
- package/docs/sdk.md +99 -124
- package/docs/security.md +7 -7
- package/docs/session-format.md +85 -82
- package/docs/sessions.md +41 -57
- package/docs/settings.md +95 -88
- package/docs/shell-aliases.md +68 -3
- package/docs/skills.md +62 -49
- package/docs/slash-commands.md +60 -0
- package/docs/terminal-setup.md +86 -55
- package/docs/termux.md +65 -75
- package/docs/themes.md +64 -86
- package/docs/tmux.md +29 -7
- package/docs/tui.md +67 -122
- package/docs/usage.md +31 -42
- package/docs/windows.md +41 -13
- package/examples/README.md +16 -2
- package/examples/extensions/README.md +0 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +2 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/prompt-customizer.ts +19 -67
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/plugins/pi-example-plugin/README.md +38 -0
- package/examples/plugins/pi-example-plugin/package.json +10 -0
- package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
- package/examples/plugins/pi-example-plugin/src/session.ts +24 -0
- package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +25 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +861 -513
- package/package.json +27 -18
- package/dist/bun/register-bedrock.d.ts +0 -2
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js +0 -4
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/cli/experimental/auth.d.ts +0 -16
- package/dist/cli/experimental/auth.d.ts.map +0 -1
- package/dist/cli/experimental/auth.js +0 -13
- package/dist/cli/experimental/auth.js.map +0 -1
- package/dist/cli/experimental/cli.d.ts +0 -6
- package/dist/cli/experimental/cli.d.ts.map +0 -1
- package/dist/cli/experimental/cli.js +0 -5
- package/dist/cli/experimental/cli.js.map +0 -1
- package/dist/cli/experimental/command-options.d.ts +0 -17
- package/dist/cli/experimental/command-options.d.ts.map +0 -1
- package/dist/cli/experimental/command-options.js +0 -35
- package/dist/cli/experimental/command-options.js.map +0 -1
- package/dist/cli/experimental/command.d.ts +0 -63
- package/dist/cli/experimental/command.d.ts.map +0 -1
- package/dist/cli/experimental/command.js +0 -130
- package/dist/cli/experimental/command.js.map +0 -1
- package/dist/cli/experimental/commands/client.d.ts +0 -13
- package/dist/cli/experimental/commands/client.d.ts.map +0 -1
- package/dist/cli/experimental/commands/client.js +0 -25
- package/dist/cli/experimental/commands/client.js.map +0 -1
- package/dist/cli/experimental/commands/pi.d.ts +0 -15
- package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
- package/dist/cli/experimental/commands/pi.js +0 -28
- package/dist/cli/experimental/commands/pi.js.map +0 -1
- package/dist/cli/experimental/commands/server.d.ts +0 -13
- package/dist/cli/experimental/commands/server.d.ts.map +0 -1
- package/dist/cli/experimental/commands/server.js +0 -25
- package/dist/cli/experimental/commands/server.js.map +0 -1
- package/dist/cli/experimental/transport-address.d.ts +0 -10
- package/dist/cli/experimental/transport-address.d.ts.map +0 -1
- package/dist/cli/experimental/transport-address.js +0 -38
- package/dist/cli/experimental/transport-address.js.map +0 -1
- package/dist/client/index.d.ts +0 -3
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -3
- package/dist/client/index.js.map +0 -1
- package/dist/client/remote-session.d.ts +0 -53
- package/dist/client/remote-session.d.ts.map +0 -1
- package/dist/client/remote-session.js +0 -340
- package/dist/client/remote-session.js.map +0 -1
- package/dist/client/transcript.d.ts +0 -12
- package/dist/client/transcript.d.ts.map +0 -1
- package/dist/client/transcript.js +0 -98
- package/dist/client/transcript.js.map +0 -1
- package/dist/modes/interactive/components/message-spine.d.ts +0 -14
- package/dist/modes/interactive/components/message-spine.d.ts.map +0 -1
- package/dist/modes/interactive/components/message-spine.js +0 -19
- package/dist/modes/interactive/components/message-spine.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js +0 -20
- package/dist/utils/clipboard-native.js.map +0 -1
package/README.md
CHANGED
|
@@ -76,6 +76,42 @@ Canonical runtime controls use the `APEX_CODE_*` prefix, including
|
|
|
76
76
|
remain for compatibility through the pre-1.0 line and will be removed no earlier than
|
|
77
77
|
Apex Code 1.0.0 and 2027-02-16. Canonical values win when both forms are set.
|
|
78
78
|
|
|
79
|
+
### Supported providers
|
|
80
|
+
|
|
81
|
+
**API keys:**
|
|
82
|
+
- Anthropic
|
|
83
|
+
- Ant Ling
|
|
84
|
+
- OpenAI
|
|
85
|
+
- Azure OpenAI
|
|
86
|
+
- DeepSeek
|
|
87
|
+
- NVIDIA NIM
|
|
88
|
+
- Google Gemini
|
|
89
|
+
- Google Vertex
|
|
90
|
+
- Amazon Bedrock
|
|
91
|
+
- Mistral
|
|
92
|
+
- Groq
|
|
93
|
+
- Cerebras
|
|
94
|
+
- Cloudflare AI Gateway
|
|
95
|
+
- Cloudflare Workers AI
|
|
96
|
+
- xAI
|
|
97
|
+
- OpenRouter
|
|
98
|
+
- Vercel AI Gateway
|
|
99
|
+
- ZAI Coding Plan (Global)
|
|
100
|
+
- ZAI Coding Plan (China)
|
|
101
|
+
- OpenCode Zen
|
|
102
|
+
- OpenCode Go
|
|
103
|
+
- Hugging Face
|
|
104
|
+
- Fireworks
|
|
105
|
+
- Together AI
|
|
106
|
+
- Baseten
|
|
107
|
+
- Kimi For Coding
|
|
108
|
+
- Meta
|
|
109
|
+
- MiniMax
|
|
110
|
+
- Xiaomi MiMo
|
|
111
|
+
- Xiaomi MiMo Token Plan (China)
|
|
112
|
+
- Xiaomi MiMo Token Plan (Amsterdam)
|
|
113
|
+
- Xiaomi MiMo Token Plan (Singapore)
|
|
114
|
+
|
|
79
115
|
Extension callback variable names, the package manifest `pi` key, and imports from
|
|
80
116
|
`@earendil-works/pi-ai` / `@earendil-works/pi-tui` are retained compatibility and
|
|
81
117
|
upstream vocabulary, not executable or product branding.
|
|
@@ -100,6 +136,594 @@ Apex Code forks `pi-coding-agent` and `pi-agent-core`, while consuming `pi-ai` a
|
|
|
100
136
|
`pi-tui` as upstream dependencies. Historical Pi links, API vocabulary, and
|
|
101
137
|
attribution remain where compatibility requires them.
|
|
102
138
|
|
|
139
|
+
The interface from top to bottom:
|
|
140
|
+
|
|
141
|
+
- **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
|
|
142
|
+
- **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
|
|
143
|
+
- **Editor** - Where you type; border color indicates thinking level and the border shows the streaming working indicator
|
|
144
|
+
- **Footer** - Working directory, session name, total token/cache usage (`↑` input, `↓` output, `R` cache read, `W` cache write, `CH` latest cache hit rate), cost, context usage, current model. Totals include assistant responses, usage reported by tools, and summary generation.
|
|
145
|
+
|
|
146
|
+
The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
|
|
147
|
+
|
|
148
|
+
### Editor
|
|
149
|
+
|
|
150
|
+
| Feature | How |
|
|
151
|
+
|---------|-----|
|
|
152
|
+
| File reference | Type `@` to fuzzy-search project files |
|
|
153
|
+
| Path completion | Tab to complete paths |
|
|
154
|
+
| Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
|
|
155
|
+
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
156
|
+
| Clipboard | Ctrl+V to paste an image or text (Alt+V on Windows), or drag images onto terminal |
|
|
157
|
+
| Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
|
|
158
|
+
|
|
159
|
+
Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
|
|
160
|
+
|
|
161
|
+
### Commands
|
|
162
|
+
|
|
163
|
+
Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
|
|
164
|
+
|
|
165
|
+
| Command | Description |
|
|
166
|
+
|---------|-------------|
|
|
167
|
+
| `/login`, `/logout` | Manage provider credentials |
|
|
168
|
+
| [`/llama`](docs/llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
169
|
+
| `/model` | Switch models; Ctrl+S in the picker saves the startup default |
|
|
170
|
+
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
171
|
+
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
172
|
+
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
173
|
+
| `/resume` | Pick from previous sessions |
|
|
174
|
+
| `/new` | Start a new session |
|
|
175
|
+
| `/name <name>` | Set session display name |
|
|
176
|
+
| `/session` | Show session info (file, ID, messages, tokens, cost) |
|
|
177
|
+
| `/tree` | Jump to any point in the session and continue from there |
|
|
178
|
+
| `/trust` | Save project trust decision for future sessions (restart required) |
|
|
179
|
+
| `/fork` | Create a new session from a previous user message |
|
|
180
|
+
| `/clone` | Duplicate the current active branch into a new session |
|
|
181
|
+
| `/compact [prompt]` | Manually compact context, optional custom instructions |
|
|
182
|
+
| `/copy` | Copy last assistant message to clipboard |
|
|
183
|
+
| `/export [file]` | Export session to HTML or JSONL file |
|
|
184
|
+
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
185
|
+
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
186
|
+
| `/bug [description]` | Report a bug to the Pi developers; see [Sessions](docs/sessions.md#reporting-bugs) |
|
|
187
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
188
|
+
| `/hotkeys` | Show all keyboard shortcuts |
|
|
189
|
+
| `/changelog` | Display version history |
|
|
190
|
+
| `/quit` | Quit pi |
|
|
191
|
+
|
|
192
|
+
### Keyboard Shortcuts
|
|
193
|
+
|
|
194
|
+
See `/hotkeys` for the full list. Customize via `~/.apex-code/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
|
|
195
|
+
|
|
196
|
+
**Commonly used:**
|
|
197
|
+
|
|
198
|
+
| Key | Action |
|
|
199
|
+
|-----|--------|
|
|
200
|
+
| Ctrl+C | Clear editor |
|
|
201
|
+
| Ctrl+C twice | Quit |
|
|
202
|
+
| Escape | Cancel/abort |
|
|
203
|
+
| Escape twice | Open `/tree` |
|
|
204
|
+
| Ctrl+L | Open model selector |
|
|
205
|
+
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
|
|
206
|
+
| Shift+Tab | Cycle thinking level |
|
|
207
|
+
| Ctrl+O | Collapse/expand tool output |
|
|
208
|
+
| Ctrl+T | Collapse/expand thinking blocks |
|
|
209
|
+
| Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
|
|
210
|
+
|
|
211
|
+
### Message Queue
|
|
212
|
+
|
|
213
|
+
Submit messages while the agent is working:
|
|
214
|
+
|
|
215
|
+
- **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
|
|
216
|
+
- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
|
|
217
|
+
- **Escape** aborts and restores queued messages to editor
|
|
218
|
+
- **Alt+Up** retrieves queued messages back to editor
|
|
219
|
+
|
|
220
|
+
On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so pi can receive the follow-up shortcut.
|
|
221
|
+
|
|
222
|
+
Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Sessions
|
|
227
|
+
|
|
228
|
+
Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session-format.md](docs/session-format.md) for file format.
|
|
229
|
+
|
|
230
|
+
### Management
|
|
231
|
+
|
|
232
|
+
Sessions auto-save to `~/.apex-code/agent/sessions/` organized by working directory.
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
apex-code -c # Continue most recent session
|
|
236
|
+
apex-code -r # Browse and select from past sessions
|
|
237
|
+
apex-code --no-session # Ephemeral mode (don't save)
|
|
238
|
+
apex-code --name "my task" # Set session display name at startup
|
|
239
|
+
apex-code --session <path|id> # Use specific session file or ID
|
|
240
|
+
apex-code --fork <path|id> # Fork specific session file or ID into a new session
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Use `/session` in interactive mode to see the current session ID before reusing it with `--session <id>` or `--fork <id>`.
|
|
244
|
+
|
|
245
|
+
### Branching
|
|
246
|
+
|
|
247
|
+
**`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file. Selecting a point while the model is responding cancels that response. Navigation cannot proceed while compaction or another tree navigation is still running; wait for it to finish and retry.
|
|
248
|
+
|
|
249
|
+
<p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
|
|
250
|
+
|
|
251
|
+
- Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
|
|
252
|
+
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
|
|
253
|
+
- Press Ctrl+X to copy the selected message
|
|
254
|
+
- Press Shift+L to label entries as bookmarks and Shift+T to toggle label timestamps
|
|
255
|
+
|
|
256
|
+
**`/fork`** - Create a new session file from a previous user message on the active branch. Opens a selector, copies the active path up to that point, and places the selected prompt in the editor for modification.
|
|
257
|
+
|
|
258
|
+
**`/clone`** - Duplicate the current active branch into a new session file at the current position. The new session keeps the full active-path history and opens with an empty editor.
|
|
259
|
+
|
|
260
|
+
**`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
|
|
261
|
+
|
|
262
|
+
### Compaction
|
|
263
|
+
|
|
264
|
+
Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
|
|
265
|
+
|
|
266
|
+
**Manual:** `/compact` or `/compact <custom instructions>`
|
|
267
|
+
|
|
268
|
+
**Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
|
|
269
|
+
|
|
270
|
+
Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
|
|
271
|
+
|
|
272
|
+
Session model context is projected from append-only history. Extensions can append a `context_edit` to omit or replace an earlier message only for future model requests; raw history and usage remain unchanged:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
const assistantId = sessionManager.appendMessage(partialAssistant);
|
|
276
|
+
sessionManager.appendContextEdit(assistantId, null); // Hidden from model context, retained in JSONL.
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
A retain-none compaction uses `appendCompaction(summary, null, tokensBefore)` to make the exact summary the new context root while preserving prior raw entries.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Settings
|
|
284
|
+
|
|
285
|
+
Use `/settings` to modify common options, or edit JSON files directly:
|
|
286
|
+
|
|
287
|
+
| Location | Scope |
|
|
288
|
+
|----------|-------|
|
|
289
|
+
| `~/.apex-code/agent/settings.json` | Global (all projects) |
|
|
290
|
+
| `.apex-code/settings.json` | Project (overrides global) |
|
|
291
|
+
|
|
292
|
+
See [docs/settings.md](docs/settings.md) for all options.
|
|
293
|
+
|
|
294
|
+
### Project Trust
|
|
295
|
+
|
|
296
|
+
On interactive startup, pi asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.apex-code/agent/trust.json`. Trusting a project allows pi to load `.apex-code/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
|
|
297
|
+
|
|
298
|
+
Before the trust decision, pi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
|
|
299
|
+
|
|
300
|
+
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
301
|
+
|
|
302
|
+
If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.apex-code/agent/settings.json`, or change it with `/settings`.
|
|
303
|
+
|
|
304
|
+
`apex-code config` and package commands use the same project trust flow, except `apex-code update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
|
|
305
|
+
|
|
306
|
+
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.apex-code/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
|
|
307
|
+
|
|
308
|
+
### Version checks and telemetry
|
|
309
|
+
|
|
310
|
+
Apex Code sends no install or update telemetry. At startup it may request the latest
|
|
311
|
+
`apex-code` version from the npm registry. Set `APEX_CODE_SKIP_VERSION_CHECK=1` to
|
|
312
|
+
disable that request, or use `--offline` / `APEX_CODE_OFFLINE=1` to disable startup
|
|
313
|
+
network operations.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Context Files
|
|
318
|
+
|
|
319
|
+
Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
|
|
320
|
+
- `~/.apex-code/agent/AGENTS.md` (global)
|
|
321
|
+
- Parent directories (walking up from cwd)
|
|
322
|
+
- Current directory
|
|
323
|
+
|
|
324
|
+
If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory. Context files from other directories are still concatenated.
|
|
325
|
+
|
|
326
|
+
Use for project instructions (`AGENTS.md`/`CLAUDE.md`), conventions, common commands. All matching files are concatenated.
|
|
327
|
+
|
|
328
|
+
Disable context file loading with `--no-context-files` (or `-nc`).
|
|
329
|
+
|
|
330
|
+
### System Prompt
|
|
331
|
+
|
|
332
|
+
Replace the default system prompt with `.apex-code/SYSTEM.md` (project) or `~/.apex-code/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Customization
|
|
337
|
+
|
|
338
|
+
### Prompt Templates
|
|
339
|
+
|
|
340
|
+
Reusable prompts as Markdown files. Type `/name` to expand.
|
|
341
|
+
|
|
342
|
+
```markdown
|
|
343
|
+
<!-- ~/.apex-code/agent/prompts/review.md -->
|
|
344
|
+
Review this code for bugs, security issues, and performance problems.
|
|
345
|
+
Focus on: {{focus}}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Place in `~/.apex-code/agent/prompts/`, `.apex-code/prompts/`, or a [pi package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
|
|
349
|
+
|
|
350
|
+
### Skills
|
|
351
|
+
|
|
352
|
+
On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
|
|
353
|
+
|
|
354
|
+
```markdown
|
|
355
|
+
<!-- ~/.apex-code/agent/skills/my-skill/SKILL.md -->
|
|
356
|
+
# My Skill
|
|
357
|
+
Use this skill when the user asks about X.
|
|
358
|
+
|
|
359
|
+
## Steps
|
|
360
|
+
1. Do this
|
|
361
|
+
2. Then that
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Place in `~/.apex-code/agent/skills/`, `~/.agents/skills/`, `.apex-code/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [pi package](#pi-packages) to share with others. See [docs/skills.md](docs/skills.md).
|
|
365
|
+
|
|
366
|
+
### Extensions
|
|
367
|
+
|
|
368
|
+
<p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
|
|
369
|
+
|
|
370
|
+
TypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
export default function (pi: ExtensionAPI) {
|
|
374
|
+
pi.registerTool({ name: "deploy", ... });
|
|
375
|
+
pi.registerCommand("stats", { ... });
|
|
376
|
+
pi.on("tool_call", async (event, ctx) => { ... });
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
`turn_end` and `agent_before_settle` are actionable persistence boundaries. Handlers can append structural entries and request one continuation. Later handlers see earlier proposals:
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
let replacedResponse = false;
|
|
384
|
+
pi.on("turn_end", (event) => {
|
|
385
|
+
if (replacedResponse || event.outcome !== "completed" || event.toolResults.length > 0) return;
|
|
386
|
+
replacedResponse = true;
|
|
387
|
+
return {
|
|
388
|
+
entries: [
|
|
389
|
+
...event.entries,
|
|
390
|
+
{ type: "context_edit", targetId: event.messageEntryId, replacement: null },
|
|
391
|
+
{
|
|
392
|
+
type: "custom_message",
|
|
393
|
+
customType: "replacement-instruction",
|
|
394
|
+
content: "Answer again using the persisted user request.",
|
|
395
|
+
display: false,
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
continue: true,
|
|
399
|
+
};
|
|
400
|
+
});
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Continuation is one-shot per boundary result, not per registered handler. It ensures one next provider request: tool-result, steering, or follow-up scheduling can satisfy that request without adding another one; otherwise Pi makes one context-only request. Guard handlers like the example above because an unconditional `continue: true` is evaluated again after the next response and can loop indefinitely. Error and aborted responses remain hard exits.
|
|
404
|
+
|
|
405
|
+
Use `agent_before_settle` for final actions after retries, compaction, and queued input are exhausted. See [docs/extensions.md](docs/extensions.md#agent_start--agent_end--agent_before_settle--agent_settled).
|
|
406
|
+
|
|
407
|
+
The default export can also be `async`. pi waits for async extension factories before startup continues, which is useful for one-time initialization such as fetching remote model lists before calling `pi.registerProvider()`.
|
|
408
|
+
|
|
409
|
+
**What's possible:**
|
|
410
|
+
- Custom tools (or replace built-in tools entirely)
|
|
411
|
+
- Sub-agents and plan mode
|
|
412
|
+
- Custom compaction and summarization
|
|
413
|
+
- Permission gates and path protection
|
|
414
|
+
- Custom editors and UI components
|
|
415
|
+
- Status lines, headers, footers
|
|
416
|
+
- Git checkpointing and auto-commit
|
|
417
|
+
- SSH and sandbox execution
|
|
418
|
+
- MCP server integration
|
|
419
|
+
- Make pi look like Claude Code
|
|
420
|
+
- Games while waiting (yes, Doom runs)
|
|
421
|
+
- ...anything you can dream up
|
|
422
|
+
|
|
423
|
+
Place in `~/.apex-code/agent/extensions/`, `.apex-code/extensions/`, or a [pi package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
|
|
424
|
+
|
|
425
|
+
### Themes
|
|
426
|
+
|
|
427
|
+
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.
|
|
428
|
+
|
|
429
|
+
Place in `~/.apex-code/agent/themes/`, `.apex-code/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
|
|
430
|
+
|
|
431
|
+
### Pi Packages
|
|
432
|
+
|
|
433
|
+
Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Api-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
|
|
434
|
+
|
|
435
|
+
> **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
apex-code install npm:@foo/pi-tools
|
|
439
|
+
apex-code install npm:@foo/pi-tools@1.2.3 # pinned version
|
|
440
|
+
apex-code install git:github.com/user/repo
|
|
441
|
+
apex-code install git:github.com/user/repo@v1 # tag or commit
|
|
442
|
+
apex-code install git:git@github.com:user/repo
|
|
443
|
+
apex-code install git:git@github.com:user/repo@v1 # tag or commit
|
|
444
|
+
apex-code install https://github.com/user/repo
|
|
445
|
+
apex-code install https://github.com/user/repo@v1 # tag or commit
|
|
446
|
+
apex-code install ssh://git@github.com/user/repo
|
|
447
|
+
apex-code install ssh://git@github.com/user/repo@v1 # tag or commit
|
|
448
|
+
apex-code remove npm:@foo/pi-tools
|
|
449
|
+
apex-code uninstall npm:@foo/pi-tools # alias for remove
|
|
450
|
+
apex-code list
|
|
451
|
+
apex-code update # update pi only
|
|
452
|
+
apex-code update --all # update pi and packages
|
|
453
|
+
apex-code update --extensions # update packages only
|
|
454
|
+
apex-code update --models # refresh model catalogs only
|
|
455
|
+
apex-code update --self # update pi only
|
|
456
|
+
apex-code update --self --force # reinstall pi even if current
|
|
457
|
+
apex-code update npm:@foo/pi-tools # update one package
|
|
458
|
+
apex-code config # enable/disable extensions, skills, prompts, themes
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Packages install to `~/.apex-code/agent/git/` (git) or `~/.apex-code/agent/npm/` (npm). Use `-l` for project-local installs (`.apex-code/git/`, `.apex-code/npm/`). Git `@ref` values are pinned tags or commits; pinned packages are skipped by `apex-code update --extensions` and `apex-code update --all`, so use `apex-code install git:host/user/repo@new-ref` to move an existing package to a new ref. Git packages install dependencies with `npm install --omit=dev` by default, so runtime deps must be listed under `dependencies`; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers. If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
|
|
462
|
+
|
|
463
|
+
Create a package by adding a `pi` key to `package.json`:
|
|
464
|
+
|
|
465
|
+
```json
|
|
466
|
+
{
|
|
467
|
+
"name": "my-pi-package",
|
|
468
|
+
"keywords": ["pi-package"],
|
|
469
|
+
"pi": {
|
|
470
|
+
"extensions": ["./extensions"],
|
|
471
|
+
"skills": ["./skills"],
|
|
472
|
+
"prompts": ["./prompts"],
|
|
473
|
+
"themes": ["./themes"]
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Without a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
|
|
479
|
+
|
|
480
|
+
See [docs/packages.md](docs/packages.md).
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## Programmatic Usage
|
|
485
|
+
|
|
486
|
+
### SDK
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import { createAgentSession, ModelRuntime, SessionManager } from "@earendil-works/pi-coding-agent";
|
|
490
|
+
|
|
491
|
+
const modelRuntime = await ModelRuntime.create();
|
|
492
|
+
const { session } = await createAgentSession({
|
|
493
|
+
sessionManager: SessionManager.inMemory(),
|
|
494
|
+
modelRuntime,
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
await session.prompt("What files are in the current directory?");
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
For advanced multi-session runtime replacement, use `createAgentSessionRuntime()` and `AgentSessionRuntime`.
|
|
501
|
+
|
|
502
|
+
See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
|
|
503
|
+
|
|
504
|
+
### RPC Mode
|
|
505
|
+
|
|
506
|
+
For non-Node.js integrations, use RPC mode over stdin/stdout:
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
apex-code --mode rpc
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
RPC mode uses strict LF-delimited JSONL framing. Clients must split records on `\n` only. Do not use generic line readers like Node `readline`, which also split on Unicode separators inside JSON payloads.
|
|
513
|
+
|
|
514
|
+
See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
## Philosophy
|
|
519
|
+
|
|
520
|
+
Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [pi packages](#pi-packages). This keeps the core minimal while letting you shape pi to fit how you work.
|
|
521
|
+
|
|
522
|
+
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
|
|
523
|
+
|
|
524
|
+
**No sub-agents.** There's many ways to do this. Spawn pi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
525
|
+
|
|
526
|
+
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
527
|
+
|
|
528
|
+
**No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
|
|
529
|
+
|
|
530
|
+
**No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
|
|
531
|
+
|
|
532
|
+
**No background bash.** Use tmux. Full observability, direct interaction.
|
|
533
|
+
|
|
534
|
+
Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## CLI Reference
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
apex-code [options] [--] [@files...] [messages...]
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Package Commands
|
|
545
|
+
|
|
546
|
+
```bash
|
|
547
|
+
apex-code install <source> [-l] # Install package, -l for project-local
|
|
548
|
+
apex-code remove <source> [-l] # Remove package
|
|
549
|
+
apex-code uninstall <source> [-l] # Alias for remove
|
|
550
|
+
apex-code update [source|self|pi] # Update pi only, or one package source
|
|
551
|
+
apex-code update --all # Update pi and packages
|
|
552
|
+
apex-code update --extensions # Update packages only
|
|
553
|
+
apex-code update --models # Refresh model catalogs only
|
|
554
|
+
apex-code update --self # Update pi only
|
|
555
|
+
apex-code update --self --force # Reinstall pi even if current
|
|
556
|
+
apex-code update --extension <src> # Update one package
|
|
557
|
+
apex-code list # List installed packages
|
|
558
|
+
apex-code config # Enable/disable package resources
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
`apex-code config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `apex-code update` never prompts for project trust.
|
|
562
|
+
|
|
563
|
+
### Modes
|
|
564
|
+
|
|
565
|
+
| Flag | Description |
|
|
566
|
+
|------|-------------|
|
|
567
|
+
| (default) | Interactive mode |
|
|
568
|
+
| `-p`, `--print` | Print response and exit |
|
|
569
|
+
| `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
|
|
570
|
+
| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
|
|
571
|
+
| `--export <in> [out]` | Export session to HTML |
|
|
572
|
+
|
|
573
|
+
In print mode, pi also reads piped stdin and merges it into the initial prompt:
|
|
574
|
+
|
|
575
|
+
```bash
|
|
576
|
+
cat README.md | apex-code -p "Summarize this text"
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
### Model Options
|
|
580
|
+
|
|
581
|
+
| Option | Description |
|
|
582
|
+
|--------|-------------|
|
|
583
|
+
| `--provider <name>` | Provider (anthropic, openai, google, etc.) |
|
|
584
|
+
| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
|
|
585
|
+
| `--api-key <key>` | API key (overrides env vars) |
|
|
586
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
587
|
+
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
588
|
+
| `--list-models [search]` | List available models |
|
|
589
|
+
|
|
590
|
+
### Session Options
|
|
591
|
+
|
|
592
|
+
| Option | Description |
|
|
593
|
+
|--------|-------------|
|
|
594
|
+
| `-c`, `--continue` | Continue most recent session |
|
|
595
|
+
| `-r`, `--resume` | Browse and select session |
|
|
596
|
+
| `--session <path\|id>` | Use specific session file or partial UUID |
|
|
597
|
+
| `--fork <path\|id>` | Fork specific session file or partial UUID into a new session |
|
|
598
|
+
| `--session-dir <dir>` | Custom session storage directory |
|
|
599
|
+
| `--no-session` | Ephemeral mode (don't save) |
|
|
600
|
+
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
601
|
+
|
|
602
|
+
### Tool Options
|
|
603
|
+
|
|
604
|
+
| Option | Description |
|
|
605
|
+
|--------|-------------|
|
|
606
|
+
| `--tools <list>`, `-t <list>` | Allowlist specific tool names across built-in, extension, and custom tools |
|
|
607
|
+
| `--exclude-tools <list>`, `-xt <list>` | Disable specific tool names across built-in, extension, and custom tools |
|
|
608
|
+
| `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
|
|
609
|
+
| `--no-tools`, `-nt` | Disable all tools by default |
|
|
610
|
+
|
|
611
|
+
Available built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`
|
|
612
|
+
|
|
613
|
+
### Resource Options
|
|
614
|
+
|
|
615
|
+
| Option | Description |
|
|
616
|
+
|--------|-------------|
|
|
617
|
+
| `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
|
|
618
|
+
| `--no-extensions` | Disable extension discovery |
|
|
619
|
+
| `--skill <path>` | Load skill (repeatable) |
|
|
620
|
+
| `--no-skills` | Disable skill discovery |
|
|
621
|
+
| `--prompt-template <path>` | Load prompt template (repeatable) |
|
|
622
|
+
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
623
|
+
| `--theme <path>` | Load theme (repeatable) |
|
|
624
|
+
| `--no-themes` | Disable theme discovery |
|
|
625
|
+
| `--no-context-files`, `-nc` | Disable AGENTS.md and CLAUDE.md context file discovery |
|
|
626
|
+
|
|
627
|
+
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
|
|
628
|
+
|
|
629
|
+
### Other Options
|
|
630
|
+
|
|
631
|
+
| Option | Description |
|
|
632
|
+
|--------|-------------|
|
|
633
|
+
| `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
|
|
634
|
+
| `--append-system-prompt <text>` | Append to system prompt |
|
|
635
|
+
| `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
|
|
636
|
+
| `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
|
|
637
|
+
| `--verbose` | Force verbose startup |
|
|
638
|
+
| `-a`, `--approve` | Trust project-local files for this run |
|
|
639
|
+
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
640
|
+
| `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
|
|
641
|
+
| `-h`, `--help` | Show help |
|
|
642
|
+
| `-v`, `--version` | Show version |
|
|
643
|
+
|
|
644
|
+
### File Arguments
|
|
645
|
+
|
|
646
|
+
Prefix files with `@` to include in the message:
|
|
647
|
+
|
|
648
|
+
```bash
|
|
649
|
+
apex-code @prompt.md "Answer this"
|
|
650
|
+
apex-code -p @screenshot.png "What's in this image?"
|
|
651
|
+
apex-code @code.ts @test.ts "Review these files"
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### Examples
|
|
655
|
+
|
|
656
|
+
```bash
|
|
657
|
+
# Interactive with initial prompt
|
|
658
|
+
apex-code "List all .ts files in src/"
|
|
659
|
+
|
|
660
|
+
# Non-interactive
|
|
661
|
+
apex-code -p "Summarize this codebase"
|
|
662
|
+
|
|
663
|
+
# Prompt beginning with a dash
|
|
664
|
+
apex-code -p -- "- Summarize these points"
|
|
665
|
+
|
|
666
|
+
# Non-interactive with piped stdin
|
|
667
|
+
cat README.md | apex-code -p "Summarize this text"
|
|
668
|
+
|
|
669
|
+
# Named one-shot session
|
|
670
|
+
apex-code --name "release audit" -p "Audit this repository"
|
|
671
|
+
|
|
672
|
+
# Different model
|
|
673
|
+
apex-code --provider openai --model gpt-4o "Help me refactor"
|
|
674
|
+
|
|
675
|
+
# Model with provider prefix (no --provider needed)
|
|
676
|
+
apex-code --model openai/gpt-4o "Help me refactor"
|
|
677
|
+
|
|
678
|
+
# Model with thinking level shorthand
|
|
679
|
+
apex-code --model sonnet:high "Solve this complex problem"
|
|
680
|
+
|
|
681
|
+
# Limit model cycling
|
|
682
|
+
apex-code --models "claude-*,gpt-4o"
|
|
683
|
+
|
|
684
|
+
# Read-only mode
|
|
685
|
+
apex-code --tools read,grep,find,ls -p "Review the code"
|
|
686
|
+
|
|
687
|
+
# Disable one extension or built-in tool while keeping the rest available
|
|
688
|
+
apex-code --exclude-tools ask_question
|
|
689
|
+
|
|
690
|
+
# High thinking level
|
|
691
|
+
apex-code --thinking high "Solve this complex problem"
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
### Environment Variables
|
|
695
|
+
|
|
696
|
+
| Variable | Description |
|
|
697
|
+
|----------|-------------|
|
|
698
|
+
| `AI_AGENT` | Set to `pi` by the CLI and RPC entry points so generic tooling can attribute child processes to Pi |
|
|
699
|
+
| `PI_CODING_AGENT` | Set to `true` by the CLI and RPC entry points so child processes can detect that they run inside Pi |
|
|
700
|
+
| `PI_CODING_AGENT_DIR` | Override config directory (default: `~/.apex-code/agent`) |
|
|
701
|
+
| `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
|
|
702
|
+
| `PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
|
|
703
|
+
| `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
|
|
704
|
+
| `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
|
|
705
|
+
| `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers. Use `1`/`true`/`yes` to enable or `0`/`false`/`no` to disable. This does not disable update checks |
|
|
706
|
+
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
|
|
707
|
+
| `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
|
|
708
|
+
|
|
709
|
+
Commands run by the LLM-callable `bash` and `powershell` tools also receive current session metadata:
|
|
710
|
+
|
|
711
|
+
| Variable | Description |
|
|
712
|
+
|----------|-------------|
|
|
713
|
+
| `PI_SESSION_ID` | Current session ID |
|
|
714
|
+
| `PI_SESSION_FILE` | Absolute session JSONL path; unset for ephemeral sessions |
|
|
715
|
+
| `PI_PROVIDER` | Currently selected model provider |
|
|
716
|
+
| `PI_MODEL` | Currently selected model ID |
|
|
717
|
+
| `PI_REASONING_LEVEL` | Current effective reasoning level |
|
|
718
|
+
|
|
719
|
+
These values are resolved when each command starts. See [Environment Variables](docs/environment-variables.md#shell-tool-session-environment) for semantics, examples, and custom-tool opt-out.
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
## Contributing & Development
|
|
724
|
+
|
|
725
|
+
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
|
|
726
|
+
|
|
103
727
|
## License
|
|
104
728
|
|
|
105
729
|
MIT. See the source repository's `LICENSE` and `NOTICE` files.
|
package/dist/bun/cli.d.ts
CHANGED
package/dist/bun/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":"","sourcesContent":["#!/usr/bin/env node\nimport
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,CAAC","sourcesContent":["#!/usr/bin/env node\nimport \"./sandbox-env-setup.ts\";\nimport \"./runtime-setup.ts\";\nimport \"../cli.ts\";\n"]}
|
package/dist/bun/cli.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
process.emitWarning = (() => { });
|
|
6
|
-
registerBunOAuthFlows();
|
|
7
|
-
import { restoreSandboxEnv } from "./restore-sandbox-env.js";
|
|
8
|
-
restoreSandboxEnv();
|
|
9
|
-
await import("./register-bedrock.js");
|
|
10
|
-
await import("../cli.js");
|
|
2
|
+
import "./sandbox-env-setup.js";
|
|
3
|
+
import "./runtime-setup.js";
|
|
4
|
+
import "../cli.js";
|
|
11
5
|
//# sourceMappingURL=cli.js.map
|
package/dist/bun/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bun/cli.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,WAAW,CAAC","sourcesContent":["#!/usr/bin/env node\nimport \"./sandbox-env-setup.ts\";\nimport \"./runtime-setup.ts\";\nimport \"../cli.ts\";\n"]}
|