@pentoshi/clai 4.12.0 → 4.13.0
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/CODE_OF_CONDUCT.md +132 -0
- package/CONTRIBUTING.md +101 -0
- package/PROVIDERS.md +149 -0
- package/README.md +217 -426
- package/SECURITY.md +33 -0
- package/dist/agent/compaction/summary-execution.js +19 -4
- package/dist/agent/compaction/summary-execution.js.map +1 -1
- package/dist/agent/compaction-summary.d.ts +5 -2
- package/dist/agent/compaction-summary.js +10 -4
- package/dist/agent/compaction-summary.js.map +1 -1
- package/dist/agent/confirm-port.d.ts +3 -5
- package/dist/agent/confirm-port.js +12 -6
- package/dist/agent/confirm-port.js.map +1 -1
- package/dist/agent/context/compact-with-summary.d.ts +1 -0
- package/dist/agent/context/compact-with-summary.js +36 -7
- package/dist/agent/context/compact-with-summary.js.map +1 -1
- package/dist/agent/context/compaction-recent-history.d.ts +12 -0
- package/dist/agent/context/compaction-recent-history.js +114 -0
- package/dist/agent/context/compaction-recent-history.js.map +1 -0
- package/dist/agent/context/latest-user-message.d.ts +2 -0
- package/dist/agent/context/latest-user-message.js +10 -0
- package/dist/agent/context/latest-user-message.js.map +1 -0
- package/dist/agent/context/user-credentials.d.ts +1 -0
- package/dist/agent/context/user-credentials.js +3 -0
- package/dist/agent/context/user-credentials.js.map +1 -1
- package/dist/agent/context-manager.js +6 -2
- package/dist/agent/context-manager.js.map +1 -1
- package/dist/agent/evidence/task-classification.js +2 -5
- package/dist/agent/evidence/task-classification.js.map +1 -1
- package/dist/agent/evidence/tool-budgets.js +4 -14
- package/dist/agent/evidence/tool-budgets.js.map +1 -1
- package/dist/agent/loop-guard.js +1 -5
- package/dist/agent/loop-guard.js.map +1 -1
- package/dist/agent/outcomes.js +9 -1
- package/dist/agent/outcomes.js.map +1 -1
- package/dist/agent/parser/arg-formatting.js +3 -16
- package/dist/agent/parser/arg-formatting.js.map +1 -1
- package/dist/agent/parser/bare-recognition.js +12 -6
- package/dist/agent/parser/bare-recognition.js.map +1 -1
- package/dist/agent/parser/xml-protocol.js +0 -2
- package/dist/agent/parser/xml-protocol.js.map +1 -1
- package/dist/agent/plan-implement-compact.js +2 -1
- package/dist/agent/plan-implement-compact.js.map +1 -1
- package/dist/agent/request-budget.d.ts +1 -0
- package/dist/agent/request-budget.js +6 -1
- package/dist/agent/request-budget.js.map +1 -1
- package/dist/agent/runner.js +2 -2
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/session-policy.d.ts +1 -0
- package/dist/agent/session-policy.js +1 -4
- package/dist/agent/session-policy.js.map +1 -1
- package/dist/agent/subagents/manager.d.ts +5 -1
- package/dist/agent/subagents/manager.js +96 -15
- package/dist/agent/subagents/manager.js.map +1 -1
- package/dist/agent/subagents/read-only-tools.js +44 -20
- package/dist/agent/subagents/read-only-tools.js.map +1 -1
- package/dist/agent/subagents/tools.d.ts +8 -1
- package/dist/agent/subagents/tools.js +21 -13
- package/dist/agent/subagents/tools.js.map +1 -1
- package/dist/agent/subagents/types.d.ts +8 -0
- package/dist/agent/subagents/worker.js +48 -7
- package/dist/agent/subagents/worker.js.map +1 -1
- package/dist/agent/task-evidence.js +2 -11
- package/dist/agent/task-evidence.js.map +1 -1
- package/dist/agent/tool-output-formatting.js +8 -2
- package/dist/agent/tool-output-formatting.js.map +1 -1
- package/dist/agent/turn/automatic-compaction-execution.js +1 -0
- package/dist/agent/turn/automatic-compaction-execution.js.map +1 -1
- package/dist/agent/turn/compaction-coordinator.js +4 -4
- package/dist/agent/turn/compaction-coordinator.js.map +1 -1
- package/dist/agent/turn/compaction-replay-selection.js +1 -0
- package/dist/agent/turn/compaction-replay-selection.js.map +1 -1
- package/dist/agent/turn/loop/run-rounds.js +11 -3
- package/dist/agent/turn/loop/run-rounds.js.map +1 -1
- package/dist/agent/turn/prompt-sections.js +4 -9
- package/dist/agent/turn/prompt-sections.js.map +1 -1
- package/dist/agent/turn/setup/turn-messages.js +2 -1
- package/dist/agent/turn/setup/turn-messages.js.map +1 -1
- package/dist/agent/turn/subagent-inbox.d.ts +5 -5
- package/dist/agent/turn/subagent-inbox.js +90 -11
- package/dist/agent/turn/subagent-inbox.js.map +1 -1
- package/dist/agent/turn/system-sections.d.ts +1 -0
- package/dist/agent/turn/system-sections.js +1 -1
- package/dist/agent/turn/system-sections.js.map +1 -1
- package/dist/agent/turn/task-autostart.js +2 -0
- package/dist/agent/turn/task-autostart.js.map +1 -1
- package/dist/agent/turn/tool-execution/authorization.js +3 -39
- package/dist/agent/turn/tool-execution/authorization.js.map +1 -1
- package/dist/agent/turn/tool-execution/single-tool.js +2 -4
- package/dist/agent/turn/tool-execution/single-tool.js.map +1 -1
- package/dist/agent/turn/tool-result-recorder.js +5 -0
- package/dist/agent/turn/tool-result-recorder.js.map +1 -1
- package/dist/agent/turn/tool-routing.d.ts +1 -1
- package/dist/agent/turn/tool-routing.js +11 -11
- package/dist/agent/turn/tool-routing.js.map +1 -1
- package/dist/agent/workspace-orient.js +2 -2
- package/dist/agent/workspace-orient.js.map +1 -1
- package/dist/app/adapters/agent-event-adapter.js +5 -0
- package/dist/app/adapters/agent-event-adapter.js.map +1 -1
- package/dist/app/adapters/current-store-adapter.js +2 -2
- package/dist/app/adapters/current-store-adapter.js.map +1 -1
- package/dist/app/commands/catalog.js +9 -4
- package/dist/app/commands/catalog.js.map +1 -1
- package/dist/app/commands/registry.js +1 -1
- package/dist/app/commands/registry.js.map +1 -1
- package/dist/app/controllers/session-compact-helper.js +2 -1
- package/dist/app/controllers/session-compact-helper.js.map +1 -1
- package/dist/app/controllers/session-controller.d.ts +8 -0
- package/dist/app/controllers/session-controller.js +66 -12
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-naming.d.ts +4 -5
- package/dist/app/controllers/session-naming.js +38 -80
- package/dist/app/controllers/session-naming.js.map +1 -1
- package/dist/app/controllers/session-prompt-history.d.ts +4 -0
- package/dist/app/controllers/session-prompt-history.js +33 -0
- package/dist/app/controllers/session-prompt-history.js.map +1 -0
- package/dist/app/controllers/session-prompt-queue.d.ts +1 -0
- package/dist/app/controllers/session-prompt-queue.js +1 -1
- package/dist/app/controllers/session-prompt-queue.js.map +1 -1
- package/dist/app/events/artifact-output.d.ts +1 -0
- package/dist/app/events/artifact-output.js +32 -0
- package/dist/app/events/artifact-output.js.map +1 -0
- package/dist/app/events/event-buffer.d.ts +13 -1
- package/dist/app/events/event-buffer.js +92 -4
- package/dist/app/events/event-buffer.js.map +1 -1
- package/dist/app/operation-review.d.ts +7 -0
- package/dist/app/operation-review.js +61 -0
- package/dist/app/operation-review.js.map +1 -0
- package/dist/app/ports/confirm-port.d.ts +1 -1
- package/dist/app/ports/persistence-port.d.ts +2 -1
- package/dist/app/ports/secret-port.d.ts +2 -0
- package/dist/classic/app/ClassicApp.js +34 -3
- package/dist/classic/app/ClassicApp.js.map +1 -1
- package/dist/classic/app/action-handlers.js +0 -2
- package/dist/classic/app/action-handlers.js.map +1 -1
- package/dist/classic/app/app-wiring.d.ts +1 -2
- package/dist/classic/app/app-wiring.js +1 -8
- package/dist/classic/app/app-wiring.js.map +1 -1
- package/dist/classic/app/use-feed.js +2 -1
- package/dist/classic/app/use-feed.js.map +1 -1
- package/dist/classic/app/wiring-interactions.d.ts +0 -2
- package/dist/classic/app/wiring-interactions.js +5 -13
- package/dist/classic/app/wiring-interactions.js.map +1 -1
- package/dist/classic/app/wiring-types.d.ts +2 -2
- package/dist/classic/blocks/batch-lines.js +10 -8
- package/dist/classic/blocks/batch-lines.js.map +1 -1
- package/dist/classic/blocks/block-context.d.ts +1 -0
- package/dist/classic/blocks/block-context.js.map +1 -1
- package/dist/classic/blocks/tool-lines.js +20 -39
- package/dist/classic/blocks/tool-lines.js.map +1 -1
- package/dist/classic/bootstrap/renderer-handle.d.ts +5 -1
- package/dist/classic/bootstrap/renderer-handle.js.map +1 -1
- package/dist/classic/bootstrap/start-classic.js +12 -12
- package/dist/classic/bootstrap/start-classic.js.map +1 -1
- package/dist/classic/chrome/context-limit-editor.d.ts +7 -0
- package/dist/classic/chrome/context-limit-editor.js +5 -0
- package/dist/classic/chrome/context-limit-editor.js.map +1 -1
- package/dist/classic/chrome/status-rows.d.ts +4 -0
- package/dist/classic/chrome/status-rows.js +11 -0
- package/dist/classic/chrome/status-rows.js.map +1 -1
- package/dist/classic/feed/feed-blocks.d.ts +1 -1
- package/dist/classic/feed/feed-blocks.js +13 -6
- package/dist/classic/feed/feed-blocks.js.map +1 -1
- package/dist/classic/panels/confirm-panel.js +9 -3
- package/dist/classic/panels/confirm-panel.js.map +1 -1
- package/dist/classic/panels/keys-panel.js +12 -3
- package/dist/classic/panels/keys-panel.js.map +1 -1
- package/dist/classic/panels/pager-panel.js +0 -6
- package/dist/classic/panels/pager-panel.js.map +1 -1
- package/dist/classic/panels/pager-source-controller.d.ts +34 -0
- package/dist/classic/panels/pager-source-controller.js +209 -0
- package/dist/classic/panels/pager-source-controller.js.map +1 -0
- package/dist/classic/panels/panel-controller.d.ts +1 -5
- package/dist/classic/panels/panel-controller.js +44 -92
- package/dist/classic/panels/panel-controller.js.map +1 -1
- package/dist/classic/panels/panel-effect.d.ts +2 -4
- package/dist/classic/panels/panel-effect.js.map +1 -1
- package/dist/classic/panels/panel-effects.js +3 -6
- package/dist/classic/panels/panel-effects.js.map +1 -1
- package/dist/classic/panels/panel-types.d.ts +0 -2
- package/dist/classic/panels/picker-panel.js +1 -1
- package/dist/classic/panels/picker-panel.js.map +1 -1
- package/dist/classic/panels/secret-panel.d.ts +1 -0
- package/dist/classic/panels/secret-panel.js +8 -1
- package/dist/classic/panels/secret-panel.js.map +1 -1
- package/dist/commands/providers.d.ts +1 -0
- package/dist/commands/providers.js +1 -0
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/qoder.d.ts +8 -0
- package/dist/commands/qoder.js +85 -0
- package/dist/commands/qoder.js.map +1 -0
- package/dist/commands/update/installers.js +1 -0
- package/dist/commands/update/installers.js.map +1 -1
- package/dist/index.js +31 -15
- package/dist/index.js.map +1 -1
- package/dist/llm/capability/state.d.ts +1 -1
- package/dist/llm/capability/tool-dialect.js +1 -0
- package/dist/llm/capability/tool-dialect.js.map +1 -1
- package/dist/llm/capability/vision-patterns.js +1 -0
- package/dist/llm/capability/vision-patterns.js.map +1 -1
- package/dist/llm/catalog-facts.js +15 -8
- package/dist/llm/catalog-facts.js.map +1 -1
- package/dist/llm/codex-auth.d.ts +2 -0
- package/dist/llm/codex-auth.js +30 -0
- package/dist/llm/codex-auth.js.map +1 -1
- package/dist/llm/codex-config.js +18 -14
- package/dist/llm/codex-config.js.map +1 -1
- package/dist/llm/codex-models.d.ts +0 -1
- package/dist/llm/codex-models.js +0 -1
- package/dist/llm/codex-models.js.map +1 -1
- package/dist/llm/context-windows.js +2 -3
- package/dist/llm/context-windows.js.map +1 -1
- package/dist/llm/freebuff-run.d.ts +3 -0
- package/dist/llm/freebuff-run.js +9 -1
- package/dist/llm/freebuff-run.js.map +1 -1
- package/dist/llm/freebuff-session-api.d.ts +3 -1
- package/dist/llm/freebuff-session-api.js +14 -1
- package/dist/llm/freebuff-session-api.js.map +1 -1
- package/dist/llm/freebuff-session.d.ts +2 -0
- package/dist/llm/freebuff-session.js +61 -28
- package/dist/llm/freebuff-session.js.map +1 -1
- package/dist/llm/freebuff-wire.d.ts +3 -0
- package/dist/llm/freebuff-wire.js +82 -0
- package/dist/llm/freebuff-wire.js.map +1 -0
- package/dist/llm/freebuff.js +61 -117
- package/dist/llm/freebuff.js.map +1 -1
- package/dist/llm/provider-identity.js +5 -0
- package/dist/llm/provider-identity.js.map +1 -1
- package/dist/llm/provider-info-text.js +25 -0
- package/dist/llm/provider-info-text.js.map +1 -1
- package/dist/llm/provider-profile-layers.js +1 -1
- package/dist/llm/provider-profile-layers.js.map +1 -1
- package/dist/llm/qoder/qoder-accounts.d.ts +9 -0
- package/dist/llm/qoder/qoder-accounts.js +53 -0
- package/dist/llm/qoder/qoder-accounts.js.map +1 -0
- package/dist/llm/qoder/qoder-auth.d.ts +59 -0
- package/dist/llm/qoder/qoder-auth.js +203 -0
- package/dist/llm/qoder/qoder-auth.js.map +1 -0
- package/dist/llm/qoder/qoder-credential.d.ts +31 -0
- package/dist/llm/qoder/qoder-credential.js +82 -0
- package/dist/llm/qoder/qoder-credential.js.map +1 -0
- package/dist/llm/qoder/qoder-login.d.ts +28 -0
- package/dist/llm/qoder/qoder-login.js +153 -0
- package/dist/llm/qoder/qoder-login.js.map +1 -0
- package/dist/llm/qoder/qoder-refresh.d.ts +4 -0
- package/dist/llm/qoder/qoder-refresh.js +165 -0
- package/dist/llm/qoder/qoder-refresh.js.map +1 -0
- package/dist/llm/qoder/qoder-signer.d.ts +66 -0
- package/dist/llm/qoder/qoder-signer.js +119 -0
- package/dist/llm/qoder/qoder-signer.js.map +1 -0
- package/dist/llm/qoder/qoder.d.ts +20 -0
- package/dist/llm/qoder/qoder.js +441 -0
- package/dist/llm/qoder/qoder.js.map +1 -0
- package/dist/llm/qoder/signer-glue.generated.d.ts +1 -0
- package/dist/llm/qoder/signer-glue.generated.js +4 -0
- package/dist/llm/qoder/signer-glue.generated.js.map +1 -0
- package/dist/llm/qoder/signer-wasm.generated.d.ts +3 -0
- package/dist/llm/qoder/signer-wasm.generated.js +6 -0
- package/dist/llm/qoder/signer-wasm.generated.js.map +1 -0
- package/dist/llm/reasoning-capability.js +1 -0
- package/dist/llm/reasoning-capability.js.map +1 -1
- package/dist/llm/reasoning-controls.js +1 -3
- package/dist/llm/reasoning-controls.js.map +1 -1
- package/dist/llm/reasoning-errors.js +3 -1
- package/dist/llm/reasoning-errors.js.map +1 -1
- package/dist/llm/request-plan.js +18 -12
- package/dist/llm/request-plan.js.map +1 -1
- package/dist/llm/routing/attempt-complete.js +11 -4
- package/dist/llm/routing/attempt-complete.js.map +1 -1
- package/dist/llm/routing/attempt-request.d.ts +2 -1
- package/dist/llm/routing/attempt-request.js +37 -0
- package/dist/llm/routing/attempt-request.js.map +1 -1
- package/dist/llm/routing/attempt-stream.js +12 -4
- package/dist/llm/routing/attempt-stream.js.map +1 -1
- package/dist/llm/routing/provider-selection.js +3 -0
- package/dist/llm/routing/provider-selection.js.map +1 -1
- package/dist/llm/tool-protocol.js +6 -0
- package/dist/llm/tool-protocol.js.map +1 -1
- package/dist/llm/wire/chat-body.js +17 -0
- package/dist/llm/wire/chat-body.js.map +1 -1
- package/dist/llm/wire/reasoning-payload.d.ts +1 -1
- package/dist/llm/wire/reasoning-payload.js +6 -0
- package/dist/llm/wire/reasoning-payload.js.map +1 -1
- package/dist/modes/ask.js +26 -10
- package/dist/modes/ask.js.map +1 -1
- package/dist/noninteractive/readline-prompts.d.ts +2 -1
- package/dist/noninteractive/readline-prompts.js +34 -1
- package/dist/noninteractive/readline-prompts.js.map +1 -1
- package/dist/noninteractive/stdio-confirm-port.js +18 -6
- package/dist/noninteractive/stdio-confirm-port.js.map +1 -1
- package/dist/noninteractive/stream-blocks.d.ts +2 -4
- package/dist/noninteractive/stream-blocks.js +5 -5
- package/dist/noninteractive/stream-blocks.js.map +1 -1
- package/dist/noninteractive/stream-renderer.js +1 -1
- package/dist/noninteractive/stream-renderer.js.map +1 -1
- package/dist/prompts/embedded.js +2 -2
- package/dist/prompts/embedded.js.map +1 -1
- package/dist/prompts/index.d.ts +3 -1
- package/dist/prompts/index.js +27 -10
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/system.agent.md +16 -16
- package/dist/prompts/system.ask.md +5 -3
- package/dist/safety/filesystem-permissions.d.ts +4 -0
- package/dist/safety/filesystem-permissions.js +113 -0
- package/dist/safety/filesystem-permissions.js.map +1 -0
- package/dist/safety/permission-mode.d.ts +5 -0
- package/dist/safety/permission-mode.js +22 -0
- package/dist/safety/permission-mode.js.map +1 -0
- package/dist/safety/shell-command-words.d.ts +11 -0
- package/dist/safety/shell-command-words.js +193 -0
- package/dist/safety/shell-command-words.js.map +1 -0
- package/dist/safety/shell-filesystem-effects.d.ts +14 -0
- package/dist/safety/shell-filesystem-effects.js +178 -0
- package/dist/safety/shell-filesystem-effects.js.map +1 -0
- package/dist/safety/shell-permission-words.d.ts +16 -0
- package/dist/safety/shell-permission-words.js +102 -0
- package/dist/safety/shell-permission-words.js.map +1 -0
- package/dist/safety/tool-classification.js +1 -15
- package/dist/safety/tool-classification.js.map +1 -1
- package/dist/session-runtime/binding.js +4 -1
- package/dist/session-runtime/binding.js.map +1 -1
- package/dist/session-runtime/client.js +111 -7
- package/dist/session-runtime/client.js.map +1 -1
- package/dist/session-runtime/discovery.d.ts +1 -1
- package/dist/session-runtime/discovery.js +2 -2
- package/dist/session-runtime/discovery.js.map +1 -1
- package/dist/session-runtime/host.d.ts +10 -2
- package/dist/session-runtime/host.js +206 -83
- package/dist/session-runtime/host.js.map +1 -1
- package/dist/session-runtime/input-commands.d.ts +2 -0
- package/dist/session-runtime/input-commands.js +11 -0
- package/dist/session-runtime/input-commands.js.map +1 -0
- package/dist/session-runtime/input-stream.d.ts +15 -0
- package/dist/session-runtime/input-stream.js +128 -0
- package/dist/session-runtime/input-stream.js.map +1 -0
- package/dist/session-runtime/types.d.ts +9 -0
- package/dist/store/config/endpoints.d.ts +2 -1
- package/dist/store/config/endpoints.js +4 -1
- package/dist/store/config/endpoints.js.map +1 -1
- package/dist/store/config.js +1 -0
- package/dist/store/config.js.map +1 -1
- package/dist/store/history/freshness.d.ts +9 -0
- package/dist/store/history/freshness.js +29 -0
- package/dist/store/history/freshness.js.map +1 -0
- package/dist/store/history/jsonl-backend.js +2 -16
- package/dist/store/history/jsonl-backend.js.map +1 -1
- package/dist/store/history/lifecycle.js +6 -2
- package/dist/store/history/lifecycle.js.map +1 -1
- package/dist/store/history/recovery.d.ts +1 -3
- package/dist/store/history/recovery.js +72 -111
- package/dist/store/history/recovery.js.map +1 -1
- package/dist/store/history/session-queries.js +5 -5
- package/dist/store/history/session-queries.js.map +1 -1
- package/dist/store/history-index.d.ts +5 -0
- package/dist/store/history-index.js +41 -9
- package/dist/store/history-index.js.map +1 -1
- package/dist/store/history.d.ts +7 -2
- package/dist/store/history.js +13 -7
- package/dist/store/history.js.map +1 -1
- package/dist/store/rtk-usage.d.ts +2 -0
- package/dist/store/rtk-usage.js +44 -0
- package/dist/store/rtk-usage.js.map +1 -0
- package/dist/store/session-model.js +0 -1
- package/dist/store/session-model.js.map +1 -1
- package/dist/store/session-prompts-format.d.ts +2 -0
- package/dist/store/session-prompts-format.js +29 -0
- package/dist/store/session-prompts-format.js.map +1 -0
- package/dist/store/session-prompts.d.ts +40 -0
- package/dist/store/session-prompts.js +213 -0
- package/dist/store/session-prompts.js.map +1 -0
- package/dist/store/subagents.d.ts +5 -1
- package/dist/store/subagents.js +67 -6
- package/dist/store/subagents.js.map +1 -1
- package/dist/tools/call-normalization.js +0 -3
- package/dist/tools/call-normalization.js.map +1 -1
- package/dist/tools/command-intent.d.ts +0 -1
- package/dist/tools/command-intent.js +3 -10
- package/dist/tools/command-intent.js.map +1 -1
- package/dist/tools/definitions/aggregate.js +0 -4
- package/dist/tools/definitions/aggregate.js.map +1 -1
- package/dist/tools/definitions/define.js +0 -3
- package/dist/tools/definitions/define.js.map +1 -1
- package/dist/tools/definitions/files.js +3 -111
- package/dist/tools/definitions/files.js.map +1 -1
- package/dist/tools/definitions/fs-read.d.ts +3 -0
- package/dist/tools/definitions/fs-read.js +43 -0
- package/dist/tools/definitions/fs-read.js.map +1 -0
- package/dist/tools/definitions/selection.js +0 -45
- package/dist/tools/definitions/selection.js.map +1 -1
- package/dist/tools/definitions/shell.js +6 -3
- package/dist/tools/definitions/shell.js.map +1 -1
- package/dist/tools/elevated-shell.d.ts +1 -0
- package/dist/tools/elevated-shell.js +2 -0
- package/dist/tools/elevated-shell.js.map +1 -1
- package/dist/tools/fs/read-budget.d.ts +8 -0
- package/dist/tools/fs/read-budget.js +30 -0
- package/dist/tools/fs/read-budget.js.map +1 -0
- package/dist/tools/fs/read-input.d.ts +16 -0
- package/dist/tools/fs/read-input.js +73 -0
- package/dist/tools/fs/read-input.js.map +1 -0
- package/dist/tools/fs/read-many.d.ts +6 -0
- package/dist/tools/fs/read-many.js +50 -0
- package/dist/tools/fs/read-many.js.map +1 -0
- package/dist/tools/fs/read-sections.d.ts +11 -0
- package/dist/tools/fs/read-sections.js +71 -0
- package/dist/tools/fs/read-sections.js.map +1 -0
- package/dist/tools/fs/read-window.d.ts +1 -1
- package/dist/tools/fs/read-window.js +57 -25
- package/dist/tools/fs/read-window.js.map +1 -1
- package/dist/tools/fs/read.d.ts +0 -4
- package/dist/tools/fs/read.js +34 -17
- package/dist/tools/fs/read.js.map +1 -1
- package/dist/tools/fs.d.ts +3 -2
- package/dist/tools/fs.js +23 -5
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/handlers/files-1.js +11 -35
- package/dist/tools/handlers/files-1.js.map +1 -1
- package/dist/tools/handlers/files-2.js.map +1 -1
- package/dist/tools/handlers/shell-1.js +26 -35
- package/dist/tools/handlers/shell-1.js.map +1 -1
- package/dist/tools/interactive-session-tools.js +1 -0
- package/dist/tools/interactive-session-tools.js.map +1 -1
- package/dist/tools/jobs/types.d.ts +4 -1
- package/dist/tools/jobs.js +9 -1
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/read-only-shell.d.ts +2 -0
- package/dist/tools/read-only-shell.js +65 -0
- package/dist/tools/read-only-shell.js.map +1 -0
- package/dist/tools/registry.js +0 -9
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/retired-tools.js +1 -1
- package/dist/tools/retired-tools.js.map +1 -1
- package/dist/tools/rtk/rewrite.d.ts +3 -2
- package/dist/tools/rtk/rewrite.js +4 -5
- package/dist/tools/rtk/rewrite.js.map +1 -1
- package/dist/tools/shell/exec-attempt.js +1 -0
- package/dist/tools/shell/exec-attempt.js.map +1 -1
- package/dist/tools/shell/internals.d.ts +1 -1
- package/dist/tools/shell/internals.js +2 -1
- package/dist/tools/shell/internals.js.map +1 -1
- package/dist/tools/shell/spawn-argv.js +1 -1
- package/dist/tools/shell/spawn-argv.js.map +1 -1
- package/dist/tools/shell/timeout.d.ts +1 -0
- package/dist/tools/shell/timeout.js +2 -0
- package/dist/tools/shell/timeout.js.map +1 -0
- package/dist/tools/shell.d.ts +1 -0
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/sudo-session.d.ts +4 -5
- package/dist/tools/sudo-session.js +1 -0
- package/dist/tools/sudo-session.js.map +1 -1
- package/dist/tools/tool-types.d.ts +2 -4
- package/dist/tui-v2/app/App.js +5 -1
- package/dist/tui-v2/app/App.js.map +1 -1
- package/dist/tui-v2/bootstrap/start-tui-v2.js +0 -2
- package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
- package/dist/tui-v2/components/jobs/subagents-panel.js +14 -2
- package/dist/tui-v2/components/jobs/subagents-panel.js.map +1 -1
- package/dist/tui-v2/components/modal/confirm-modal.js +6 -2
- package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/keys-modal.js +42 -6
- package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/secret-modal.d.ts +8 -0
- package/dist/tui-v2/components/modal/secret-modal.js +27 -18
- package/dist/tui-v2/components/modal/secret-modal.js.map +1 -1
- package/dist/tui-v2/components/overlay/overlay-host.js +14 -3
- package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -1
- package/dist/tui-v2/components/pager/pager.js +43 -61
- package/dist/tui-v2/components/pager/pager.js.map +1 -1
- package/dist/tui-v2/components/picker/picker.js +17 -3
- package/dist/tui-v2/components/picker/picker.js.map +1 -1
- package/dist/tui-v2/components/transcript/intro-card.js +2 -1
- package/dist/tui-v2/components/transcript/intro-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/tool-card.js +21 -19
- package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-view.js +24 -21
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +1 -0
- package/dist/tui-v2/components/transcript/use-transcript-selection.js +12 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.js +1 -1
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/types.d.ts +17 -2
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/mentions/expand.js +1 -1
- package/dist/ui-core/actions/action-id.d.ts +1 -1
- package/dist/ui-core/actions/action-id.js +0 -2
- package/dist/ui-core/actions/action-id.js.map +1 -1
- package/dist/ui-core/actions/format-shortcuts.js +0 -2
- package/dist/ui-core/actions/format-shortcuts.js.map +1 -1
- package/dist/ui-core/actions/keymap.js +0 -6
- package/dist/ui-core/actions/keymap.js.map +1 -1
- package/dist/ui-core/bootstrap/composition-root.d.ts +0 -3
- package/dist/ui-core/bootstrap/composition-root.js +0 -8
- package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
- package/dist/ui-core/bootstrap/overlay-ports.js +14 -5
- package/dist/ui-core/bootstrap/overlay-ports.js.map +1 -1
- package/dist/ui-core/bootstrap/session-resume.d.ts +5 -0
- package/dist/ui-core/bootstrap/session-resume.js +13 -35
- package/dist/ui-core/bootstrap/session-resume.js.map +1 -1
- package/dist/ui-core/commands/command-handlers.js +5 -2
- package/dist/ui-core/commands/command-handlers.js.map +1 -1
- package/dist/ui-core/commands/config-commands.js +5 -1
- package/dist/ui-core/commands/config-commands.js.map +1 -1
- package/dist/ui-core/commands/key-commands.js +50 -30
- package/dist/ui-core/commands/key-commands.js.map +1 -1
- package/dist/ui-core/commands/keys/auth-picker.d.ts +3 -0
- package/dist/ui-core/commands/keys/auth-picker.js +29 -0
- package/dist/ui-core/commands/keys/auth-picker.js.map +1 -0
- package/dist/ui-core/commands/keys/qoder.d.ts +4 -0
- package/dist/ui-core/commands/keys/qoder.js +194 -0
- package/dist/ui-core/commands/keys/qoder.js.map +1 -0
- package/dist/ui-core/commands/picker-commands.js +19 -1
- package/dist/ui-core/commands/picker-commands.js.map +1 -1
- package/dist/ui-core/commands/pickers/output-pager.js +19 -8
- package/dist/ui-core/commands/pickers/output-pager.js.map +1 -1
- package/dist/ui-core/commands/pickers/search-reasoning.js +3 -4
- package/dist/ui-core/commands/pickers/search-reasoning.js.map +1 -1
- package/dist/ui-core/commands/prompt-commands.d.ts +2 -0
- package/dist/ui-core/commands/prompt-commands.js +10 -0
- package/dist/ui-core/commands/prompt-commands.js.map +1 -0
- package/dist/ui-core/commands/rtk-commands.js +35 -16
- package/dist/ui-core/commands/rtk-commands.js.map +1 -1
- package/dist/ui-core/commands/session-commands.js +22 -7
- package/dist/ui-core/commands/session-commands.js.map +1 -1
- package/dist/ui-core/commands/subagent-commands.js +5 -4
- package/dist/ui-core/commands/subagent-commands.js.map +1 -1
- package/dist/ui-core/composer/composer-meta.js +2 -5
- package/dist/ui-core/composer/composer-meta.js.map +1 -1
- package/dist/ui-core/controllers/overlay-controller.d.ts +13 -0
- package/dist/ui-core/controllers/overlay-controller.js +33 -6
- package/dist/ui-core/controllers/overlay-controller.js.map +1 -1
- package/dist/ui-core/rendering/batch-sections.d.ts +1 -1
- package/dist/ui-core/rendering/batch-sections.js +18 -4
- package/dist/ui-core/rendering/batch-sections.js.map +1 -1
- package/dist/ui-core/rendering/duration.d.ts +2 -0
- package/dist/ui-core/rendering/duration.js +9 -1
- package/dist/ui-core/rendering/duration.js.map +1 -1
- package/dist/ui-core/rendering/intro-header.js +5 -6
- package/dist/ui-core/rendering/intro-header.js.map +1 -1
- package/dist/ui-core/rendering/open-tool-output.js +4 -1
- package/dist/ui-core/rendering/open-tool-output.js.map +1 -1
- package/dist/ui-core/rendering/pager-source.js +3 -0
- package/dist/ui-core/rendering/pager-source.js.map +1 -1
- package/dist/ui-core/rendering/pager-text.js +3 -0
- package/dist/ui-core/rendering/pager-text.js.map +1 -1
- package/dist/ui-core/rendering/pager-view-policy.js +4 -2
- package/dist/ui-core/rendering/pager-view-policy.js.map +1 -1
- package/dist/ui-core/rendering/session-prompts-pager-source.d.ts +3 -0
- package/dist/ui-core/rendering/session-prompts-pager-source.js +40 -0
- package/dist/ui-core/rendering/session-prompts-pager-source.js.map +1 -0
- package/dist/ui-core/rendering/subagent-source.d.ts +4 -3
- package/dist/ui-core/rendering/subagent-source.js +79 -7
- package/dist/ui-core/rendering/subagent-source.js.map +1 -1
- package/dist/ui-core/rendering/text-width.d.ts +1 -0
- package/dist/ui-core/rendering/text-width.js +31 -0
- package/dist/ui-core/rendering/text-width.js.map +1 -1
- package/dist/ui-core/rendering/tool-presenter.d.ts +9 -4
- package/dist/ui-core/rendering/tool-presenter.js +43 -91
- package/dist/ui-core/rendering/tool-presenter.js.map +1 -1
- package/dist/ui-core/rendering/usage-pager-source.js +6 -2
- package/dist/ui-core/rendering/usage-pager-source.js.map +1 -1
- package/dist/ui-core/state/transcript-store.js +7 -2
- package/dist/ui-core/state/transcript-store.js.map +1 -1
- package/dist/ui-core/state/transcript-types.d.ts +1 -1
- package/dist/ui-core/state/transcript-types.js +4 -2
- package/dist/ui-core/state/transcript-types.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +6 -2
- package/dist/agent/turn/pentest-tools.d.ts +0 -3
- package/dist/agent/turn/pentest-tools.js +0 -17
- package/dist/agent/turn/pentest-tools.js.map +0 -1
- package/dist/classic/bootstrap/suspend-port.d.ts +0 -14
- package/dist/classic/bootstrap/suspend-port.js +0 -29
- package/dist/classic/bootstrap/suspend-port.js.map +0 -1
- package/dist/tools/capabilities.d.ts +0 -12
- package/dist/tools/capabilities.js +0 -225
- package/dist/tools/capabilities.js.map +0 -1
- package/dist/tools/definitions/network.d.ts +0 -2
- package/dist/tools/definitions/network.js +0 -17
- package/dist/tools/definitions/network.js.map +0 -1
- package/dist/tools/definitions/orchestration.d.ts +0 -2
- package/dist/tools/definitions/orchestration.js +0 -27
- package/dist/tools/definitions/orchestration.js.map +0 -1
- package/dist/tools/fs/search.d.ts +0 -32
- package/dist/tools/fs/search.js +0 -427
- package/dist/tools/fs/search.js.map +0 -1
- package/dist/tools/handlers/network-3.d.ts +0 -2
- package/dist/tools/handlers/network-3.js +0 -13
- package/dist/tools/handlers/network-3.js.map +0 -1
- package/dist/tools/handlers/orchestration-2.d.ts +0 -2
- package/dist/tools/handlers/orchestration-2.js +0 -16
- package/dist/tools/handlers/orchestration-2.js.map +0 -1
- package/dist/tools/net-ping-sweep.d.ts +0 -18
- package/dist/tools/net-ping-sweep.js +0 -274
- package/dist/tools/net-ping-sweep.js.map +0 -1
- package/dist/tools/wordlists.d.ts +0 -6
- package/dist/tools/wordlists.js +0 -390
- package/dist/tools/wordlists.js.map +0 -1
- package/dist/tui-v2/bootstrap/pager-export.d.ts +0 -7
- package/dist/tui-v2/bootstrap/pager-export.js +0 -19
- package/dist/tui-v2/bootstrap/pager-export.js.map +0 -1
- package/dist/ui-core/ports/pager-export-port.d.ts +0 -16
- package/dist/ui-core/ports/pager-export-port.js +0 -68
- package/dist/ui-core/ports/pager-export-port.js.map +0 -1
- package/dist/ui-core/rendering/fs-search-summary.d.ts +0 -11
- package/dist/ui-core/rendering/fs-search-summary.js +0 -65
- package/dist/ui-core/rendering/fs-search-summary.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,423 +1,308 @@
|
|
|
1
1
|
# clai
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
clai is a terminal AI assistant for software development, debugging, shell tasks, and authorized security testing. It can inspect a repository, edit files, run checks, manage background processes, and delegate independent research to subagents.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use a hosted API, an account sign-in, or a local Ollama model. Interactive sessions support live reattachment from multiple terminals on the same machine, so you can reconnect over SSH and continue working with the same agent.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **Persistent sessions:** streaming output and agent work continue after a terminal disconnect or `/minimise`; type from any attached terminal.
|
|
8
|
+
- **Three working modes:** ask questions, execute tasks, or review a plan before implementation.
|
|
9
|
+
- **Provider flexibility:** multiple credentials, automatic key rotation, and optional fallback between configured providers.
|
|
10
|
+
- **Tools and integrations:** file editing, shell commands, background jobs, interactive terminals, web search, MCP servers, and Agent Skills.
|
|
11
|
+
- **Long sessions:** saved transcripts, durable subagent findings, context compaction, and pagers for large outputs.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- **Account sign-in in the terminal.** Freebuff, ChatGPT, GitHub Copilot, Cline, and Kiro support account-based sign-in. Freebuff uses its browser/device approval flow and a hosted session; the subscription-backed providers use their respective subscription credentials.
|
|
11
|
-
- **One agent, ~25 providers.** DeepSeek, Kimi, GLM, MiniMax, MiMo, Qwen, OpenAI, Anthropic, Gemini, local Ollama, and a dozen OpenAI-compatible gateways — switch with one command, mid-session if you like.
|
|
12
|
-
- **It doesn't die on rate limits.** Up to 10 keys per provider with sticky rotation, optional cross-provider fallback, and retry/backoff tuned per provider. Long jobs survive flaky free tiers.
|
|
13
|
-
- **It's honest.** Findings need real tool output. Builds get typechecked/run before "done." Compaction and history keep long sessions coherent instead of hallucinating progress.
|
|
13
|
+
[Installation](#installation) · [Quick start](#quick-start) · [Persistent sessions](#persistent-sessions) · [Providers](#supported-providers) · [Terminals](#terminal-compatibility-and-recommendations) · [Commands](#commands) · [Contributing](CONTRIBUTING.md)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
This guide follows the `main` branch. Packaged releases can lag recent changes; use [source setup](CONTRIBUTING.md#source-setup) to run the current development version.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- **Account sign-in.** `clai auth <freebuff|cline|chatgpt|copilot|kiro>` — provider-specific browser/device approval, with supported `--import` paths and multi-credential rotation.
|
|
21
|
-
- **Multi-key smart switching.** Up to 10 keys per provider with a *sticky* active key and circular rotation on rate-limit, quota, transient, or 5xx errors. Disable any key to skip it without deleting it. Optional cross-provider fallback and a free-only filter.
|
|
22
|
-
- **Broad provider support.** 25+ built-in providers: Freebuff, DeepSeek, Kimi (Moonshot), GLM (Zhipu AI), MiniMax, Xiaomi MiMo, OpenAI, Anthropic, Google Gemini, Ollama, NVIDIA NIM, OpenRouter, Qwen Cloud, Cline, Codex (ChatGPT), GitHub Copilot, Kiro, AgentRouter, AWS Mantle, TokenRouter, Token Harbor, Lightning AI, Modal, Meta, Fireworks, Hetzner, OrcaRouter, Merge Gateway, ExpLabs, Vercel AI Gateway — plus custom OpenAI-compatible endpoints.
|
|
23
|
-
- **Parallel subagents.** Independent investigations (recon, research, large refactors) run as read-only subagents concurrently; `/orchestrator` and `/subagents` control and inspect them, with per-role model chains.
|
|
24
|
-
- **Agent Skills.** Loads `SKILL.md`-based skills on demand — `/skills` manages them, and relevant skills surface automatically per prompt.
|
|
25
|
-
- **Scope-based pentesting.** Opt-in engagement scope with authorized/excluded targets, allowed phases, rate and concurrency ceilings, redirect and DNS-rebinding escape detection, and out-of-scope flagging — designed for authorized pentests and bug-bounty programs.
|
|
26
|
-
- **Real building & debugging.** Scaffolds apps, edits code surgically, installs packages, runs builds/tests, starts dev servers as background jobs, and probes them before reporting success.
|
|
27
|
-
- **Durable plans.** `plan.create` / `task.update` drive a live checklist that survives context compaction and reloads with `/history` — the agent works task-by-task and won't fake completion.
|
|
28
|
-
- **State-preserving compaction.** Automatic and manual `/compact` keep a deterministic work envelope next to the summary: subagents (id, title, status, and a digest of results already read), live and finished background jobs, Responder-delegated tasks with their read state, touched files, and any credentials you supplied for the task, carried verbatim instead of being summarized away. When the history fits the model's window, the summary request replays the cached conversation prefix, so compaction is mostly a cache read.
|
|
29
|
-
- **Durable agent sessions.** Interactive sessions run behind a local broker, so an agent keeps working after `/minimise`, an SSH disconnect, or switching to another history session; `clai --resume <id>` reattaches to the same live UI and output stream.
|
|
30
|
-
- **Persistent interactive terminals.** Conversation-owned PTY or pipe sessions keep REPLs such as Python, Metasploit, Meterpreter, database consoles, and debuggers open across model turns.
|
|
31
|
-
- **Native + text tool calling.** Uses provider-native function calling where available, with a text-fence fallback (`toolCalling: auto|native|text`).
|
|
32
|
-
- **MCP, explicitly controlled.** Discovers local stdio and remote HTTP/SSE servers from project configs. MCP tools are off by default; `/mcp` inspects and adds servers, and picking one drops an editable `@mcp:<server>` token into your prompt.
|
|
33
|
-
- **Safety gate you control.** Every action is classified safe / confirm / block; deletes always confirm with a preview; destructive patterns are blocked.
|
|
19
|
+
Native releases are available for macOS, Linux, and Windows on x64 and ARM64. They include the runtime; Node.js is required for the npm package and development from source.
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
### macOS and Linux
|
|
36
22
|
|
|
37
|
-
## Install
|
|
38
|
-
|
|
39
|
-
### macOS
|
|
40
23
|
```sh
|
|
41
|
-
brew tap pentoshi007/clai && brew install clai
|
|
42
|
-
# or
|
|
43
24
|
curl -fsSL https://downloads.clai.aniketpandey.website/install/install.sh | sh
|
|
44
25
|
```
|
|
45
26
|
|
|
46
|
-
|
|
27
|
+
The installer verifies the binary's published SHA256 checksum. It installs to `/usr/local/bin` by default; `CLAI_BIN_DIR` selects another directory.
|
|
28
|
+
|
|
29
|
+
Homebrew is also available:
|
|
30
|
+
|
|
47
31
|
```sh
|
|
48
|
-
|
|
32
|
+
brew tap pentoshi007/clai
|
|
33
|
+
brew install clai
|
|
49
34
|
```
|
|
50
35
|
|
|
51
36
|
### Windows
|
|
37
|
+
|
|
38
|
+
Run in PowerShell:
|
|
39
|
+
|
|
52
40
|
```powershell
|
|
53
41
|
irm https://downloads.clai.aniketpandey.website/install/install.ps1 | iex
|
|
54
|
-
# or
|
|
55
|
-
scoop bucket add clai https://github.com/pentoshi007/clai && scoop install clai
|
|
56
42
|
```
|
|
57
43
|
|
|
58
|
-
### npm
|
|
44
|
+
### npm
|
|
45
|
+
|
|
46
|
+
Requires Node.js 22 or later:
|
|
47
|
+
|
|
59
48
|
```sh
|
|
60
|
-
npm
|
|
61
|
-
# or
|
|
62
|
-
git clone https://github.com/pentoshi007/clai.git
|
|
63
|
-
cd clai && npm install && npm run build && npm start
|
|
49
|
+
npm install -g @pentoshi/clai
|
|
64
50
|
```
|
|
65
51
|
|
|
66
|
-
|
|
52
|
+
On macOS and Linux, the npm installer sets up Bun for the OpenTUI interface when needed. Set `CLAI_NO_BUN_AUTO_INSTALL=1` to skip that setup and use `clai --classic`.
|
|
67
53
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
---
|
|
54
|
+
For manual downloads, use [GitHub Releases](https://github.com/pentoshi007/clai/releases). For a source checkout, follow [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
71
55
|
|
|
72
56
|
## Quick start
|
|
73
57
|
|
|
74
|
-
Out of the box, `clai` runs **keyless** on the built-in Free provider — no signup, no API key:
|
|
75
|
-
|
|
76
58
|
```sh
|
|
77
|
-
clai
|
|
59
|
+
clai
|
|
78
60
|
```
|
|
79
61
|
|
|
80
|
-
|
|
62
|
+
A fresh configuration uses the keyless Free provider and **ask** mode. Hosted availability and limits depend on the provider. Use `/agent` to enable task execution or `/plan` to prepare a plan for review.
|
|
63
|
+
|
|
64
|
+
To sign in with an existing account, for example ChatGPT:
|
|
81
65
|
|
|
82
66
|
```sh
|
|
83
|
-
clai auth chatgpt
|
|
67
|
+
clai auth chatgpt
|
|
84
68
|
clai use chatgpt
|
|
85
69
|
clai
|
|
86
70
|
```
|
|
87
71
|
|
|
88
|
-
|
|
72
|
+
To use an API key, `clai set` prompts with hidden input when the key is omitted:
|
|
89
73
|
|
|
90
74
|
```sh
|
|
91
|
-
|
|
92
|
-
clai set deepseek sk-your_key_here
|
|
75
|
+
clai set deepseek
|
|
93
76
|
clai use deepseek
|
|
94
|
-
|
|
95
|
-
# Launch the full-screen agent console
|
|
96
77
|
clai
|
|
97
|
-
|
|
98
|
-
# Or one-shot directly from the shell
|
|
99
|
-
clai "explain what this repo does and find the entrypoint"
|
|
100
|
-
clai --mode agent "add a /health endpoint to the Express app and run the tests"
|
|
101
78
|
```
|
|
102
79
|
|
|
103
|
-
|
|
80
|
+
For a local model, start Ollama and download the model you intend to use, then configure its endpoint:
|
|
104
81
|
|
|
105
82
|
```sh
|
|
106
83
|
clai set ollama --url http://localhost:11434
|
|
107
84
|
clai use ollama
|
|
85
|
+
clai model <downloaded-model>
|
|
86
|
+
clai
|
|
108
87
|
```
|
|
109
88
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## Providers & Key Management
|
|
113
|
-
|
|
114
|
-
### Account sign-in providers (no conventional API key needed)
|
|
115
|
-
|
|
116
|
-
Sign in with an account you already have. Browser/device-code flows work on headless servers through a copyable link; `--import` reuses supported local sign-ins or imports provider tokens.
|
|
117
|
-
|
|
118
|
-
| Provider | Sign-in | Notes |
|
|
119
|
-
|----------|---------|-------|
|
|
120
|
-
| **Freebuff** | `clai auth freebuff` | Free, session-gated catalog; browser sign-in or headless link |
|
|
121
|
-
| **ChatGPT (Codex)** | `clai auth chatgpt` | Any ChatGPT tier incl. Free; mimics the official Codex CLI |
|
|
122
|
-
| **GitHub Copilot** | `clai auth copilot` | Incl. Copilot Free; mimics VS Code Copilot Chat |
|
|
123
|
-
| **Cline** | `clai auth cline` | Free `cline-free/*` models plus frontier catalog |
|
|
124
|
-
| **Kiro (AWS)** | `clai auth kiro` | AWS Builder ID, Google/GitHub social login, or IAM Identity Center SSO |
|
|
125
|
-
|
|
126
|
-
Up to 10 credentials can be stored per provider, with automatic key rotation on applicable authentication/quota errors. `clai auth <p> --import` imports supported local sign-ins; Freebuff also imports `FREEBUFF_API_KEY`, `CODEBUFF_API_KEY`, or the upstream `~/.config/manicode/credentials.json` token.
|
|
127
|
-
|
|
128
|
-
### API-key providers
|
|
129
|
-
|
|
130
|
-
| Provider | Default Model | Tier | Environment Variable |
|
|
131
|
-
|----------|---------------|------|----------------------|
|
|
132
|
-
| **Free (keyless)** | `free-2/kilo-auto/free` | Free · Keyless | — (no key needed) |
|
|
133
|
-
| **DeepSeek** | `deepseek-chat` | Paid / Usage | `DEEPSEEK_API_KEY` |
|
|
134
|
-
| **Kimi (Moonshot)** | `kimi-k3` | Paid / Usage | `KIMI_API_KEY` / `MOONSHOT_API_KEY` |
|
|
135
|
-
| **GLM (Zhipu AI)** | `glm-4-plus` | Free tier / Paid | `GLM_API_KEY` / `ZHIPU_API_KEY` |
|
|
136
|
-
| **MiniMax** | `MiniMax-Text-01` | Paid / Usage | `MINIMAX_API_KEY` |
|
|
137
|
-
| **Xiaomi MiMo** | `mimo-v2.6-pro` | Paid / Usage | `MIMO_API_KEY` |
|
|
138
|
-
| **Google Gemini** | `gemini-3.5-flash` | Free tier / Paid | `GEMINI_API_KEY` |
|
|
139
|
-
| **NVIDIA NIM** | `openai/gpt-oss-20b` | Free tier | `NVIDIA_API_KEY` |
|
|
140
|
-
| **OpenRouter** | `meta-llama/llama-3.3-70b-instruct:free` | Free / Paid | `OPENROUTER_API_KEY` |
|
|
141
|
-
| **Ollama** | `llama3.1:8b` | Local / Free | `OLLAMA_HOST` |
|
|
142
|
-
| **OpenAI** | `gpt-5.4-mini` | Paid | `OPENAI_API_KEY` |
|
|
143
|
-
| **Anthropic** | `claude-3-5-haiku-latest` | Paid | `ANTHROPIC_API_KEY` |
|
|
144
|
-
| **Qwen Cloud** | `qwen3.7-plus` | Paid (DashScope) | `DASHSCOPE_API_KEY` |
|
|
145
|
-
| **Bynara** | `mimo-v2.5-free` | Free | `BYNARA_API_KEY` |
|
|
146
|
-
| **Hetzner** | `Qwen/Qwen3.6-35B-A3B-FP8` | Free (experiment) | `HETZNER_API_KEY` |
|
|
147
|
-
| **AgentRouter** | `claude-opus-4-6` | Paid gateway | `AGENTROUTER_API_KEY` |
|
|
148
|
-
| **AWS Mantle** | `anthropic.claude-haiku-4-5` | Paid (AWS) | `ANTHROPIC_API_KEY` |
|
|
149
|
-
| **TokenRouter** | `moonshotai/kimi-k3` | Paid gateway | `TOKENROUTER_API_KEY` |
|
|
150
|
-
| **Token Harbor** | `claude-sonnet-5.5` | Paid gateway (free tier) | `TOKENHARBOR_API_KEY` |
|
|
151
|
-
| **Lightning AI** | `openai/gpt-5` | Free grant / Paid | `LIGHTNING_API_KEY` |
|
|
152
|
-
| **Modal** | `moonshotai/Kimi-K3` | Your own endpoint ($30/mo credit) | `MODAL_PROXY_TOKEN_ID` |
|
|
153
|
-
| **Meta (Muse)** | `muse-spark-1.2` | Paid | `MODEL_API_KEY` |
|
|
154
|
-
| **Fireworks** | `accounts/fireworks/models/kimi-k2p6` | Paid | `FIREWORKS_API_KEY` |
|
|
155
|
-
| **OrcaRouter** | `openai/gpt-4o-mini` | Paid gateway (zero markup) | `ORCAROUTER_API_KEY` |
|
|
156
|
-
| **Merge Gateway** | `openai/gpt-5.2` | Paid gateway | `MERGE_GATEWAY_API_KEY` |
|
|
157
|
-
| **ExpLabs** | `claude-fable-5.1` | Paid / BYOK gateway | `EXPLABS_API_KEY` |
|
|
158
|
-
| **Vercel AI Gateway** | `openai/gpt-5.4-mini` | Paid gateway | `AI_GATEWAY_API_KEY` |
|
|
159
|
-
|
|
160
|
-
Model catalogs use each provider's supported discovery source; most expose a dedicated models endpoint. Freebuff does not: clai reads account-visible model IDs from its read-only session endpoint and merges them with a source-versioned fallback. You can switch models anytime using `/model` or `clai model <name>`, browse the whole fleet with `/models`, and read setup details for any provider with `/info <provider>`.
|
|
161
|
-
|
|
162
|
-
### Freebuff setup and behavior
|
|
163
|
-
|
|
164
|
-
Freebuff is a hosted, free-tier provider that requires an account sign-in. Free-mode inference is only served to the genuine freebuff CLI: the server refuses direct API calls (free_mode_cli_required), so clai manages sign-in and the live model catalog but refuses generation requests fast with an actionable message. The default model is `z-ai/glm-5.3-flash`.
|
|
89
|
+
You can also run a prompt directly or pipe input:
|
|
165
90
|
|
|
166
91
|
```sh
|
|
167
|
-
clai
|
|
168
|
-
clai
|
|
169
|
-
clai
|
|
170
|
-
clai model z-ai/glm-5.3-flash # set a model from the catalog
|
|
171
|
-
# in the interactive console: /model · /info freebuff
|
|
92
|
+
clai "explain this repository and identify its entrypoint"
|
|
93
|
+
clai --mode agent "add a health endpoint and run the relevant tests"
|
|
94
|
+
git diff | clai --quiet "review this diff for bugs"
|
|
172
95
|
```
|
|
173
96
|
|
|
174
|
-
|
|
97
|
+
## Persistent sessions
|
|
175
98
|
|
|
176
|
-
|
|
99
|
+
### Detach and resume
|
|
177
100
|
|
|
178
|
-
|
|
101
|
+
Run `/minimise` inside the interactive console to return to your shell while the agent continues. `/minimize` and `/minmize` are aliases. The detach message includes the session ID and a resume command.
|
|
179
102
|
|
|
180
|
-
|
|
103
|
+
| Command | Behavior |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `clai --resume` | Resume the most recently updated live or saved session across directories. |
|
|
106
|
+
| `clai --resume <id>` | Resume a specific session; a unique ID prefix also works. |
|
|
107
|
+
| `clai -c` or `clai --continue` | Prefer the latest session for the current directory, with a saved-session fallback when none matches. |
|
|
108
|
+
| `clai history` or `/history` | Find saved sessions and see whether an agent is running, attached, or detached. |
|
|
181
109
|
|
|
182
|
-
|
|
110
|
+
Reattaching to a live session opens its existing UI. Resuming a saved session restores its conversation and transcript. Bare `--resume` also uses the original working directory if it still exists. Resume flags apply to interactive sessions; prompts supplied on the command line run separately.
|
|
183
111
|
|
|
184
|
-
|
|
112
|
+
### SSH and multiple terminals
|
|
185
113
|
|
|
186
|
-
|
|
114
|
+
After an SSH disconnect, reconnect to the same machine as the same OS user and run `clai --resume`. To share a particular live session, run `clai --resume <id>` in another terminal or SSH connection.
|
|
187
115
|
|
|
188
|
-
|
|
116
|
+
Every attachment sees the same live screen and can type immediately, including prompts and shortcuts. Attachments share one composer and one running agent. The screen fits the smallest attached terminal. Closing or minimising one attachment keeps the agent and the other attachments running.
|
|
189
117
|
|
|
190
|
-
|
|
118
|
+
Durable sessions require an interactive terminal, a compatible PTY transport, and history enabled. Private mode and `--no-history` use foreground sessions. Saved history remains available after the live process ends; an active process still depends on its host machine remaining running.
|
|
191
119
|
|
|
192
|
-
|
|
193
|
-
- **409 session_superseded / 403 free_mode_cli_required on generation:** expected. The server only serves free-mode turns to the genuine freebuff CLI; clai refuses before spending anything. Use `freebuff` for these models or `/provider` for another provider.
|
|
194
|
-
- **Quota, model-unavailable, country, or account refusal:** follow the server's message; wait for the indicated reset/window or choose a currently available model with `/model`.
|
|
195
|
-
- **Wallet consent required:** clai has not spent anything. It always requests zero wallet spend; use a free-eligible model or review the purchase in a Freebuff-supported surface.
|
|
196
|
-
- **Catalog does not refresh:** `/model` uses the account-visible session response and a 30-minute per-account cache. If the session probe is unreachable, clai displays its bundled catalog fallback; the hosted `/api/v1/models` endpoint is not available.
|
|
197
|
-
- **Session remains after a forced stop:** clean exits attempt deletion; otherwise Freebuff's server-side expiry clears it.
|
|
120
|
+
### History and context
|
|
198
121
|
|
|
199
|
-
|
|
122
|
+
`/new` starts a fresh session and saves the previous one. If work is still running, it remains in its previous session. `/save <name>` names a session, and `/prompts` browses sent prompts with their timestamps and provider, model, and effort metadata.
|
|
200
123
|
|
|
201
|
-
|
|
202
|
-
clai set deepseek sk-first_key # store a key
|
|
203
|
-
clai set deepseek sk-second_key # add another key for multi-key rotation
|
|
204
|
-
clai set gemini --from-env GEMINI_API_KEY
|
|
205
|
-
echo "sk-..." | clai set deepseek --stdin
|
|
206
|
-
clai set ollama --url http://localhost:11434
|
|
207
|
-
clai keys # list providers with masked keys (★ active)
|
|
208
|
-
clai use deepseek # set active provider
|
|
209
|
-
clai provider # interactive provider/model selector
|
|
210
|
-
clai unset deepseek # remove keys for a provider
|
|
211
|
-
```
|
|
124
|
+
Context compaction reduces what the model receives while retaining recent requests, plans, task state, and available research findings. It does not erase the saved chat transcript. Use `/compact` to compact manually, `/context` to inspect context size, and `/output` to read retained tool output.
|
|
212
125
|
|
|
213
|
-
|
|
214
|
-
- **`/set`** opens the multi-row key editor. Add keys (`+`), set the active key (★), or disable a key (`○`) without deleting it.
|
|
215
|
-
- **`/keys`** displays configured keys (masked) and active status.
|
|
216
|
-
- **`/provider`** and **`/model`** open interactive pickers for switching providers and models on the fly.
|
|
217
|
-
- **`/info <provider>`** shows per-provider setup, pricing, and endpoint details.
|
|
126
|
+
`/clear` deletes the current session and starts fresh. `/reset` clears all saved history. These are deletion commands; use `/new` when you want to keep the previous conversation.
|
|
218
127
|
|
|
219
|
-
|
|
128
|
+
## Providers and usage
|
|
220
129
|
|
|
221
|
-
|
|
222
|
-
- **Disable without deleting** — Toggle any key disabled in the `/set` editor; rotation skips it until you re-enable it.
|
|
223
|
-
- **Cross-provider fallback** *(opt-in)* — `/fallback on` lets `clai` fall back to other configured providers when the active provider is exhausted.
|
|
224
|
-
- **Token-saving shell output** *(opt-in)* — `/rtk on` routes foreground `shell.exec` commands through [rtk](https://github.com/rtk-ai/rtk) via `rtk rewrite`, so the model reads compact output. Only the executed command changes: the model's tool call, approvals, and history keep the original, and the system prompt and tool schemas never change, so the prompt cache prefix is never invalidated. Background jobs, interactive/PTY sessions, sudo, and commands clai already reduces (nmap, ffuf, …) are never rewritten; if rtk is missing, busy updating, or fails, commands run unmodified. No rtk yet? `/rtk install` (or **Install rtk** on the `/rtk` screen) uses Homebrew, else rtk's checksum-verified installer, else cargo (winget, else cargo, on Windows) in the background; `/rtk update` upgrades through whichever tool installed it. rtk is found even when its directory is not on `PATH`, and a same-named impostor binary is skipped. All rewrite rules live in rtk itself, so updating rtk never requires a clai release.
|
|
225
|
-
- **Free-only mode** *(opt-in)* — `/freeonly on` restricts fallback strictly to free tiers (Free, Gemini, OpenRouter, NIM, Bynara, Hetzner, and the free-lane subscription providers) so you never accidentally spend.
|
|
226
|
-
- **Usage visibility** — `/usage` shows token consumption per provider and model, including cache reads and writes, so you can see what a session actually cost. It counts every billed request: subagents, title generation, compaction, and retried attempts whose stream died after the provider had already billed the prompt.
|
|
130
|
+
clai supports API credentials, account sign-ins, and local endpoints. Account integrations include ChatGPT, GitHub Copilot, Cline, Kiro, OmniRush, and Qoder. Freebuff has separate admission requirements described in the [provider guide](PROVIDERS.md#freebuff).
|
|
227
131
|
|
|
228
|
-
|
|
132
|
+
### Supported providers
|
|
229
133
|
|
|
230
|
-
|
|
134
|
+
Account sign-in integrations:
|
|
231
135
|
|
|
232
|
-
|
|
136
|
+
| Provider | Sign-in command | Notes |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
| ChatGPT (Codex) | `clai auth chatgpt` | Stored as `codex`; browser/headless sign-in or existing Codex CLI import. |
|
|
139
|
+
| GitHub Copilot | `clai auth copilot` | Browser/device sign-in or supported credential import. |
|
|
140
|
+
| Cline | `clai auth cline` | Account sign-in or supported credential import. |
|
|
141
|
+
| Kiro | `clai auth kiro` | Social login, AWS Builder ID, or IAM Identity Center. |
|
|
142
|
+
| OmniRush | `clai auth omnirush` | Device-code sign-in or existing OmniRush CLI import. |
|
|
143
|
+
| Qoder | `clai auth qoder` | Browser/headless sign-in, CLI import, or PAT via `--pat`. |
|
|
144
|
+
| Freebuff | `clai auth freebuff` | Sign-in and catalog support; inference requires server admission. |
|
|
233
145
|
|
|
234
|
-
|
|
146
|
+
API, keyless, and local integrations:
|
|
235
147
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
148
|
+
| Provider | Provider ID | Credential or endpoint variable |
|
|
149
|
+
| --- | --- | --- |
|
|
150
|
+
| Free | `free` | Keyless models; optional `FREE_API_KEY` for authenticated access. |
|
|
151
|
+
| Ollama | `ollama` | Local endpoint through `OLLAMA_HOST` or `clai set ollama --url <url>`. |
|
|
152
|
+
| Anthropic | `anthropic` | `ANTHROPIC_API_KEY` |
|
|
153
|
+
| DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` |
|
|
154
|
+
| Google Gemini | `gemini` | `GEMINI_API_KEY` |
|
|
155
|
+
| GLM / Zhipu | `glm` | `GLM_API_KEY`, `ZHIPU_API_KEY`, or `ZAI_API_KEY` |
|
|
156
|
+
| Kimi / Moonshot | `kimi` | `KIMI_API_KEY` or `MOONSHOT_API_KEY` |
|
|
157
|
+
| MiniMax | `minimax` | `MINIMAX_API_KEY` |
|
|
158
|
+
| Xiaomi MiMo | `mimo` | `MIMO_API_KEY` |
|
|
159
|
+
| NVIDIA NIM | `nvidia` | `NVIDIA_API_KEY` |
|
|
160
|
+
| OpenAI | `openai` | `OPENAI_API_KEY` |
|
|
161
|
+
| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` |
|
|
162
|
+
| Qwen Cloud / DashScope | `qwen-cloud` | `DASHSCOPE_API_KEY` |
|
|
163
|
+
| AgentRouter | `agentrouter` | `AGENTROUTER_API_KEY` |
|
|
164
|
+
| AWS Mantle | `aws-mantle` | `ANTHROPIC_API_KEY` for the configured Mantle endpoint. |
|
|
165
|
+
| Bynara | `bynara` | `BYNARA_API_KEY` |
|
|
166
|
+
| ExpLabs | `explabs` | `EXPLABS_API_KEY` |
|
|
167
|
+
| Fireworks | `fireworks` | `FIREWORKS_API_KEY` |
|
|
168
|
+
| Hetzner | `hetzner` | `HETZNER_API_KEY` |
|
|
169
|
+
| Lightning AI | `lightning` | `LIGHTNING_API_KEY` |
|
|
170
|
+
| Merge Gateway | `merge-gateway` | `MERGE_GATEWAY_API_KEY` |
|
|
171
|
+
| Meta Model API | `meta` | `MODEL_API_KEY` |
|
|
172
|
+
| Modal | `modal` | Both `MODAL_PROXY_TOKEN_ID` and `MODAL_PROXY_TOKEN_SECRET`; deployed endpoint required. |
|
|
173
|
+
| OrcaRouter | `orcarouter` | `ORCAROUTER_API_KEY` |
|
|
174
|
+
| Token Harbor | `tokenharbor` | `TOKENHARBOR_API_KEY` |
|
|
175
|
+
| TokenRouter | `tokenrouter` | `TOKENROUTER_API_KEY` |
|
|
176
|
+
| Vercel AI Gateway | `vercel` | `AI_GATEWAY_API_KEY` |
|
|
241
177
|
|
|
242
|
-
|
|
243
|
-
clai --mode agent "convert this Vite React app to Next.js App Router, keep all features, run the build"
|
|
244
|
-
clai --mode agent "this test is flaky — find the race and fix it"
|
|
245
|
-
```
|
|
178
|
+
Use `clai set <provider>` for a hidden-input credential prompt, or `--from-env <variable>` to import a credential. The [provider guide](PROVIDERS.md) includes account flows, endpoint setup, and provider-specific behavior. `/model` shows model choices; access, limits, and prices depend on the provider and account.
|
|
246
179
|
|
|
247
|
-
###
|
|
180
|
+
### Models, rotation, and usage
|
|
248
181
|
|
|
249
|
-
|
|
182
|
+
- `/provider` selects a provider; `/model` selects its model; `/models` browses models across providers.
|
|
183
|
+
- `/set` manages up to 10 credentials per provider, including disabled keys and the active key. Applicable authentication, quota, rate-limit, and server failures can trigger rotation.
|
|
184
|
+
- `/fallback on` enables cross-provider fallback; it is off by default. `/freeonly on` filters fallback using clai's provider categories. Check the selected model and account's billing terms when controlling spending.
|
|
185
|
+
- `/effort` configures reasoning where supported. Qoder uses the selected effort, including `xhigh`, and displays thinking when returned by the model.
|
|
186
|
+
- `/usage` shows reported token and cache usage across main turns, subagents, and auxiliary requests. Supported account providers also expose quota or subscription information. Token totals are not a billing invoice.
|
|
250
187
|
|
|
251
|
-
-
|
|
252
|
-
- `/subagents` — inspect live assignments; stop or restart one by id.
|
|
188
|
+
The [provider guide](PROVIDERS.md) covers authentication, environment variables, endpoint configuration, and provider-specific behavior. Model catalogs and account access can change; use `/model` and the provider's own dashboard for availability.
|
|
253
189
|
|
|
254
|
-
|
|
190
|
+
## Working with clai
|
|
255
191
|
|
|
256
|
-
###
|
|
192
|
+
### Modes and permissions
|
|
257
193
|
|
|
258
|
-
|
|
194
|
+
| Mode | Purpose |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| `ask` | Questions, explanations, and read-only investigation. This is the initial default. |
|
|
197
|
+
| `agent` | Execute tasks with file, shell, and other tools under the configured permission policy. |
|
|
198
|
+
| `plan` | Gather evidence and prepare a plan. Review it with `/view-plan`, then use `/implement` to approve execution or `/discard` to remove it. |
|
|
259
199
|
|
|
260
|
-
|
|
261
|
-
recon / discovery → fingerprint stack → plan.create (kind=pentest)
|
|
262
|
-
↑ │
|
|
263
|
-
│ /implement (approve)
|
|
264
|
-
│ ↓
|
|
265
|
-
└──── enumerate → exploit → post-ex → report
|
|
266
|
-
(revise the plan as surface grows; keep completed tasks)
|
|
267
|
-
```
|
|
200
|
+
Switch modes with `/ask`, `/agent`, `/plan`, or `Shift+Tab`. `clai mode <mode>` sets the default for new sessions.
|
|
268
201
|
|
|
269
|
-
|
|
270
|
-
2. **Recon first** (read-only discovery needs no plan): whois, DNS, `net.pingSweep`, `http.fetch`, and shell tools like `nmap`, `ffuf`, `nuclei`, `sqlmap` — orchestrated with durable checkpoints.
|
|
271
|
-
3. **Analyze real evidence**, then `plan.create` with `kind=pentest` from actual ports/services/endpoints — then stop for your approval.
|
|
272
|
-
4. `/implement` and execute task-by-task; expand the plan as new attack surface appears without wiping completed work.
|
|
273
|
-
5. **Report** with structure — title, severity, evidence, reproduction, impact, remediation — and honest residual/untested notes.
|
|
202
|
+
Fresh configurations use **auto-allow** permissions. `/permissions default` enables the more conservative confirmation policy; `/permissions auto-allow` allows eligible actions automatically while retaining confirmation for out-of-folder or unresolved deletions. `/permissions full-access` further relaxes confirmations. Ask/plan restrictions, OS permissions, engagement scope, and hard safety blocks still apply.
|
|
274
203
|
|
|
275
|
-
|
|
204
|
+
When an approval prompt appears, `Ctrl+O` opens the complete pending operation, including its arguments and working directory. Reading the operation does not approve it. These policies govern clai's tool execution; they are not an OS sandbox.
|
|
276
205
|
|
|
277
|
-
|
|
278
|
-
clai authorize-pentest AGREE
|
|
279
|
-
clai scope new --targets lab.example.com,10.10.0.0/24 --exclude prod.example.com \
|
|
280
|
-
--phases recon,enumeration --max-rate 5 --max-concurrency 2
|
|
281
|
-
# in the console: /scope show · /scope add <targets> · /scope clear
|
|
282
|
-
```
|
|
206
|
+
### Subagents and background work
|
|
283
207
|
|
|
284
|
-
|
|
208
|
+
`/orchestrator` controls delegation and subagent model choices. `/subagents` shows assignments and lets you stop or restart an investigation. Retained findings and delivery state help the parent reuse completed research after compaction or resuming a session.
|
|
285
209
|
|
|
286
|
-
|
|
210
|
+
The agent can keep development servers and long commands running as background jobs. Use `/jobs` to inspect them and `/output` to browse output. Conversation-owned interactive terminals support REPLs, debuggers, and database consoles across model turns.
|
|
287
211
|
|
|
288
|
-
|
|
212
|
+
`/rtk on` optionally compresses eligible foreground shell output through [rtk](https://github.com/rtk-ai/rtk). It is off by default; `/rtk install`, `/rtk update`, and `/rtk status` manage the integration.
|
|
289
213
|
|
|
290
|
-
|
|
214
|
+
### Authorized security testing
|
|
291
215
|
|
|
292
|
-
|
|
216
|
+
clai can assist with reconnaissance, enumeration, scoped testing, and reporting using installed tools. Test systems you own or have permission to assess.
|
|
293
217
|
|
|
294
|
-
|
|
295
|
-
|------|-----|
|
|
296
|
-
| **ask** | Answers, methodology, and read-only tools — no mutations, no attacks. |
|
|
297
|
-
| **agent** | Executes: edits, installs, scans, verifies, works the plan. |
|
|
298
|
-
| **plan** | Research and design a durable plan; approve with `/implement` before execution. |
|
|
218
|
+
`clai authorize-pentest AGREE` stores the authorization acknowledgement. Use `clai scope` to configure the default engagement scope inherited by new sessions, or `/scope` to configure the current session. Scope can define authorized targets, exclusions, phases, and limits. Plan mode supports evidence gathering before you approve implementation.
|
|
299
219
|
|
|
300
|
-
|
|
220
|
+
## Terminal interface
|
|
301
221
|
|
|
302
|
-
|
|
222
|
+
OpenTUI is selected by default on macOS and Linux when the terminal is at least 60 columns by 14 rows and the runtime is available. Windows and smaller terminals use Classic, which runs on React and Ink. `clai --classic` selects Classic explicitly; `clai --tui` requests OpenTUI with a Classic fallback when unavailable.
|
|
303
223
|
|
|
304
|
-
|
|
224
|
+
Both interfaces provide streaming chat, tool output, plans, session history, and provider controls.
|
|
305
225
|
|
|
306
|
-
|
|
226
|
+
### Terminal compatibility and recommendations
|
|
307
227
|
|
|
308
|
-
|
|
309
|
-
|-------|----------|
|
|
310
|
-
| **safe** | Auto-runs read-only work: `fs.read/list/search`, `tool.check`, `http.fetch` GET, `web.search`/`web.fetch`, recon commands. |
|
|
311
|
-
| **confirm** | Asks first for mutations: file writes/edits, installs, moves, mutating shell commands. |
|
|
312
|
-
| **block** | Refuses destructive patterns (`rm -rf /`, fork bombs, exfiltration signatures) and SSRF-prone fetches. |
|
|
228
|
+
Choose a terminal for the OS on your local device. These recommendations link to each terminal's official setup information:
|
|
313
229
|
|
|
314
|
-
|
|
230
|
+
| Local OS | Recommended terminal | Alternatives |
|
|
231
|
+
| --- | --- | --- |
|
|
232
|
+
| Linux | [Kitty](https://sw.kovidgoyal.net/kitty/binary/) | [WezTerm](https://wezterm.org/installation.html) or [Alacritty](https://alacritty.org/). |
|
|
233
|
+
| macOS | [iTerm2](https://iterm2.com/) | [Kitty](https://sw.kovidgoyal.net/kitty/binary/), [WezTerm](https://wezterm.org/installation.html), or [Alacritty](https://alacritty.org/); the built-in Terminal app is also an option. |
|
|
234
|
+
| Windows | [Windows Terminal](https://learn.microsoft.com/en-us/windows/terminal/) | [WezTerm](https://wezterm.org/installation.html) or [Alacritty](https://alacritty.org/). |
|
|
315
235
|
|
|
316
|
-
|
|
236
|
+
clai selects its interface using the OS where it runs. Native Windows uses Classic; WSL and SSH sessions on a Linux host use the Linux interface selection, even when the local window is Windows Terminal or iTerm2. Over SSH, key, mouse, and clipboard capabilities come from your local terminal and any intervening multiplexer.
|
|
317
237
|
|
|
318
|
-
|
|
238
|
+
Standard terminals can handle ordinary text input and output. Modified keys, mouse motion/hover, and clipboard integration vary by terminal and configuration. If `Shift+Enter` is not distinguishable from `Enter`, use `Ctrl+N` or `Alt+Enter` for a newline. Use `clai --classic` if OpenTUI cannot start, and `F5` or `/redraw` to repaint a scrambled screen.
|
|
319
239
|
|
|
320
|
-
|
|
240
|
+
### Keyboard shortcuts
|
|
321
241
|
|
|
322
|
-
| Action |
|
|
323
|
-
|
|
324
|
-
| Send
|
|
325
|
-
|
|
|
326
|
-
|
|
|
327
|
-
|
|
|
328
|
-
|
|
|
242
|
+
| Action | Shortcut |
|
|
243
|
+
| --- | --- |
|
|
244
|
+
| Send prompt | `Enter` |
|
|
245
|
+
| Insert newline | `Shift+Enter`, `Alt+Enter`, or `Ctrl+N` |
|
|
246
|
+
| Cancel current turn | `Esc` |
|
|
247
|
+
| Interrupt; press again to quit | `Ctrl+C` |
|
|
248
|
+
| Cycle mode | `Shift+Tab` |
|
|
249
|
+
| Toggle plan pane / details | `Ctrl+H` / `Ctrl+P` |
|
|
329
250
|
| Background jobs | `Ctrl+J` |
|
|
330
251
|
| Expand thinking / tool output | `Ctrl+T` / `Ctrl+O` |
|
|
331
|
-
|
|
|
332
|
-
|
|
|
333
|
-
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
|
355
|
-
|
|
356
|
-
| `/
|
|
357
|
-
| `/
|
|
358
|
-
| `/
|
|
359
|
-
| `/
|
|
360
|
-
| `/
|
|
361
|
-
| `/
|
|
362
|
-
| `/
|
|
363
|
-
| `/
|
|
364
|
-
| `/
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
|
369
|
-
|
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
374
|
-
|
|
|
375
|
-
|
|
|
376
|
-
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
```sh
|
|
386
|
-
clai [prompt...] # interactive UI, or one-shot with a prompt
|
|
387
|
-
--mode <ask|agent|plan> --provider <p> --model <m>
|
|
388
|
-
-y/--yes --no-history
|
|
389
|
-
--show-thinking --verbose --quiet # one-shot stream controls
|
|
390
|
-
--tui --classic
|
|
391
|
-
--resume <sessionId> -c/--continue # reattach live or reopen saved session
|
|
392
|
-
|
|
393
|
-
clai auth <provider> # OAuth sign-in: cline, chatgpt, copilot, kiro
|
|
394
|
-
# --import · --browser · --headless
|
|
395
|
-
clai set <provider> [key] # --from-env <VAR> | --stdin | --url <url> | --skip-ping
|
|
396
|
-
clai unset <provider> [--url] # remove all keys (or endpoint URLs) for a provider
|
|
397
|
-
clai keys # list providers with masked keys
|
|
398
|
-
clai use <provider> # set active provider
|
|
399
|
-
clai provider [provider] # switch provider or open picker
|
|
400
|
-
clai model <model> # set model for the active provider
|
|
401
|
-
clai mode <ask|agent|plan> # set default mode
|
|
402
|
-
clai search-provider <brave|tavily|exa|duckduckgo>
|
|
403
|
-
clai config [key] [value] # view or update configuration
|
|
404
|
-
clai doctor # check installed tools + provider config
|
|
405
|
-
clai history [--show <id>] # list saved sessions
|
|
406
|
-
clai update # check for updates and upgrade
|
|
407
|
-
clai authorize-pentest AGREE # enable scan/attack tools (one-time ack)
|
|
408
|
-
clai scope <show|new|add|clear> # engagement scope management
|
|
409
|
-
clai privacy <status|on|off|clear-all> # privacy and history clearing
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
---
|
|
413
|
-
|
|
414
|
-
## Model Context Protocol (MCP)
|
|
415
|
-
|
|
416
|
-
`clai` can discover and call tools from local or remote MCP servers. MCP tools are **off by default**; they are activated when a prompt mentions `@mcp:<server>` or via `/mcp all`.
|
|
417
|
-
|
|
418
|
-
### Project configuration
|
|
419
|
-
|
|
420
|
-
Define MCP servers in `.clai/mcp.json` (or standard `.vscode/mcp.json` / `.cursor/mcp.json` locations):
|
|
252
|
+
| Search transcript when focused | `Ctrl+R` |
|
|
253
|
+
| Repaint screen | `F5` or `/redraw` |
|
|
254
|
+
| Help / full shortcut reference | `Ctrl+G` / `/shortcuts` |
|
|
255
|
+
|
|
256
|
+
Type `/` for command suggestions and `@` for file mentions. Terminal support affects which modified key combinations are available; `/shortcuts` lists bindings by context.
|
|
257
|
+
|
|
258
|
+
## Commands
|
|
259
|
+
|
|
260
|
+
Run `clai --help` for CLI flags and `clai <command> --help` for a subcommand. In the interactive console, `/help` lists slash commands.
|
|
261
|
+
|
|
262
|
+
| Slash command | Purpose |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| `/ask`, `/agent`, `/plan` | Switch working mode. |
|
|
265
|
+
| `/view-plan`, `/implement`, `/discard` | Review, execute, or discard a plan. |
|
|
266
|
+
| `/provider [name]`, `/model [name]`, `/models [filter]` | Select providers and models. |
|
|
267
|
+
| `/set [provider]`, `/unset [provider]`, `/keys`, `/info [provider]` | Configure credentials and inspect provider setup. |
|
|
268
|
+
| `/effort [level]`, `/reasoning [level]` | Set reasoning effort or open its picker. |
|
|
269
|
+
| `/fallback [on\|off]`, `/freeonly [on\|off]` | Configure fallback. |
|
|
270
|
+
| `/orchestrator`, `/subagents` | Manage delegation and inspect subagents. |
|
|
271
|
+
| `/rtk [on\|off\|status\|install\|update]` | Manage shell output compression. |
|
|
272
|
+
| `/skills [name\|list\|refresh]`, `/mcp` | Manage skills and MCP servers. |
|
|
273
|
+
| `/search [provider]`, `/search-provider` | Select the web-search backend. |
|
|
274
|
+
| `/scope [show\|new\|add\|clear]` | Configure this session's engagement scope. |
|
|
275
|
+
| `/jobs`, `/output [last\|id\|list]` | Inspect jobs and tool output. |
|
|
276
|
+
| `/compact`, `/context`, `/usage` | Manage context and inspect usage. |
|
|
277
|
+
| `/history`, `/save <name>`, `/new`, `/prompts` | Browse, name, create, and inspect sessions. |
|
|
278
|
+
| `/clear`, `/reset` | Delete the current session or all saved history. |
|
|
279
|
+
| `/allow <tool>`, `/disallow <tool>`, `/permissions` | Configure tool permissions. |
|
|
280
|
+
| `/cwd <path>` | Change the working directory. |
|
|
281
|
+
| `/think`, `/thinking` | Show the last response's thinking. |
|
|
282
|
+
| `/privacy` | Manage private mode and clear retained data. |
|
|
283
|
+
| `/minimise`, `/minimize`, `/minmize` | Detach this terminal. |
|
|
284
|
+
| `/redraw`, `/refresh` | Repaint the screen. |
|
|
285
|
+
| `/update`, `/help`, `/shortcuts`, `/exit`, `/quit` | Updates, help, and exit. |
|
|
286
|
+
|
|
287
|
+
Useful CLI flags:
|
|
288
|
+
|
|
289
|
+
| Flag | Purpose |
|
|
290
|
+
| --- | --- |
|
|
291
|
+
| `--mode <ask\|agent\|plan>` | Set the mode for this invocation. |
|
|
292
|
+
| `--provider <id>`, `--model <name>` | Override the configured provider or model. |
|
|
293
|
+
| `--resume [id]`, `-c`, `--continue` | Resume an interactive session. |
|
|
294
|
+
| `--classic`, `--tui`, `--ui <classic\|tui>` | Select the interactive interface. |
|
|
295
|
+
| `--no-history` | Disable history persistence for this invocation. |
|
|
296
|
+
| `-y`, `--yes` | Auto-confirm eligible tool actions in a one-shot agent run. |
|
|
297
|
+
| `--quiet`, `--verbose`, `--show-thinking` | Control one-shot answer, tool output, and reasoning display. |
|
|
298
|
+
|
|
299
|
+
## Project context, skills, and MCP
|
|
300
|
+
|
|
301
|
+
Place project notes in `.clai/context.md` in the working directory to supply architecture, conventions, or testing context. Project skills live under `.clai/skills/` as `SKILL.md` playbooks; `/skills list` shows discovered skills and `/skills refresh` rescans them.
|
|
302
|
+
|
|
303
|
+
MCP servers can expose local or remote tools. Tools are disabled by default; activate a server with an `@mcp:<server>` prompt mention or enable all configured servers with `/mcp all`. `/mcp` also supports configuration, connection status, authentication, and logs.
|
|
304
|
+
|
|
305
|
+
Example `.clai/mcp.json`:
|
|
421
306
|
|
|
422
307
|
```json
|
|
423
308
|
{
|
|
@@ -425,129 +310,35 @@ Define MCP servers in `.clai/mcp.json` (or standard `.vscode/mcp.json` / `.curso
|
|
|
425
310
|
"local": {
|
|
426
311
|
"command": "my-mcp-server",
|
|
427
312
|
"args": ["--root", "${workspaceFolder}"],
|
|
428
|
-
"env": {
|
|
429
|
-
"MCP_TOKEN": "${env:MCP_TOKEN}"
|
|
430
|
-
}
|
|
313
|
+
"env": { "MCP_TOKEN": "${env:MCP_TOKEN}" }
|
|
431
314
|
},
|
|
432
315
|
"remote": {
|
|
433
316
|
"url": "https://mcp.example.com/mcp",
|
|
434
|
-
"headers": {
|
|
435
|
-
"Authorization": "Bearer ${env:MCP_TOKEN}"
|
|
436
|
-
}
|
|
317
|
+
"headers": { "Authorization": "Bearer ${env:MCP_TOKEN}" }
|
|
437
318
|
}
|
|
438
319
|
}
|
|
439
320
|
}
|
|
440
321
|
```
|
|
441
322
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
## Built-in tools
|
|
447
|
-
|
|
448
|
-
| Group | Tools |
|
|
449
|
-
|-------|-------|
|
|
450
|
-
| **Files** | `fs.read` · `fs.list` · `fs.search` · `fs.write` · `fs.writeMany` · `fs.edit` · `fs.replaceLines` · `fs.append` · `fs.delete` |
|
|
451
|
-
| **Shell & jobs** | `shell.exec` (servers: `background:"always"` + `name`) · `shell.jobs` · `shell.tail` · `shell.wait` · `shell.stop` |
|
|
452
|
-
| **Terminals** | `terminal.start` · `terminal.send` · `terminal.read` · `terminal.status` · `terminal.close` |
|
|
453
|
-
| **Network** | `tool.check` (with the install command for this OS) · `net.pingSweep` · `wordlist.find` (pentest sessions; plus `nmap`, `ffuf`, etc. via shell) |
|
|
454
|
-
| **HTTP / web** | `http.fetch` (raw evidence) · `web.search` · `web.fetch` (readable) |
|
|
455
|
-
| **Orchestration** | `subagent.start` · `subagent.list` · `subagent.wait` · `subagent.read` · `subagent.stop` — independent read-only tool calls in one response run in parallel |
|
|
456
|
-
| **Plan** | `plan.create` · `plan.clear` · `task.add` · `task.update` · `task.move` · `agent.handoff` |
|
|
457
|
-
| **MCP** | `mcp.list` · `mcp.tools` · `mcp.call` · `mcp.enable` · `mcp.connect` · `mcp.login` · `mcp.add` |
|
|
458
|
-
| **Context** | `image.ocr` · `image.view` · `pdf.read` · `skill.load` — OS, shell, and cwd arrive with every request |
|
|
459
|
-
|
|
460
|
-
---
|
|
461
|
-
|
|
462
|
-
## Web search / OSINT
|
|
463
|
-
|
|
464
|
-
| Provider | Key | Environment Variable |
|
|
465
|
-
|----------|-----|----------------------|
|
|
466
|
-
| **DuckDuckGo** | None (default) | — |
|
|
467
|
-
| **Brave** | Required | `BRAVE_SEARCH_API_KEY` |
|
|
468
|
-
| **Tavily** | Required | `TAVILY_API_KEY` |
|
|
469
|
-
| **Exa** | Required | `EXA_API_KEY` |
|
|
470
|
-
|
|
471
|
-
```sh
|
|
472
|
-
clai set brave bsx-...
|
|
473
|
-
clai set tavily tvly-...
|
|
474
|
-
clai search-provider tavily
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
---
|
|
478
|
-
|
|
479
|
-
## Per-project context
|
|
480
|
-
|
|
481
|
-
Drop a `.clai/context.md` in any project root, and its content is injected automatically on every turn — repo architecture, stack conventions, testing instructions, or scope rules. Project-level Agent Skills live alongside it under `.clai/skills/`.
|
|
482
|
-
|
|
483
|
-
---
|
|
484
|
-
|
|
485
|
-
## Interactive REPLs and terminals
|
|
486
|
-
|
|
487
|
-
When a task requires multi-step interactive terminal interactions, `clai` maintains a persistent terminal session attached to the conversation:
|
|
488
|
-
|
|
489
|
-
```text
|
|
490
|
-
Start a Python REPL, test the regular expression against our test cases, and show me the output.
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
The agent runs interactive commands in persistent PTY sessions, reads incremental output, sends follow-up commands, and safely terminates processes upon completion.
|
|
494
|
-
|
|
495
|
-
---
|
|
323
|
+
## Configuration and privacy
|
|
496
324
|
|
|
497
|
-
|
|
325
|
+
`clai config` prints the configuration and its location. Use `clai mode`, `clai model`, and `clai use` to change defaults. History, prompt journals, logs, and runtime data normally live under `~/.clai/`; saved chat records include `history.jsonl`. Large outputs may also use per-session temporary directories.
|
|
498
326
|
|
|
499
327
|
```sh
|
|
500
|
-
clai
|
|
501
|
-
clai
|
|
502
|
-
clai
|
|
503
|
-
|
|
504
|
-
/privacy clear-all # wipe history, logs, and artifacts
|
|
328
|
+
clai privacy status
|
|
329
|
+
clai privacy on
|
|
330
|
+
clai privacy off
|
|
331
|
+
clai privacy retention 0
|
|
505
332
|
```
|
|
506
333
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
---
|
|
510
|
-
|
|
511
|
-
## Development
|
|
334
|
+
Private mode disables chat and prompt persistence and durable background attachment; `--no-history` applies to a single invocation. Retention defaults to `0` (unlimited saved sessions). These settings do not erase previously saved data. `clai privacy clear-history`, `clear-logs`, `clear-artifacts`, and `clear-all` explicitly delete retained data; the corresponding `/privacy` actions are available in the UI.
|
|
512
335
|
|
|
513
|
-
|
|
514
|
-
npm install
|
|
515
|
-
npm run dev # run from source
|
|
516
|
-
npm run typecheck
|
|
517
|
-
npm run build
|
|
518
|
-
npm test # full test suite
|
|
519
|
-
npm run compile # compile native binaries with Bun
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
---
|
|
523
|
-
|
|
524
|
-
## Architecture
|
|
525
|
-
|
|
526
|
-
```
|
|
527
|
-
clai/
|
|
528
|
-
├─ src/
|
|
529
|
-
│ ├─ index.ts # CLI entry + subcommands
|
|
530
|
-
│ ├─ agent/ # loop, plans, compaction, resume orientation, tool parsing
|
|
531
|
-
│ ├─ llm/ # providers, OAuth auth flows, streaming, key rotation + fallback
|
|
532
|
-
│ ├─ mcp/ # discovery, validation, transports, lifecycle, and tool dispatch
|
|
533
|
-
│ ├─ tools/ # fs, shell, terminal, net, http, web, batch, plan, subagents
|
|
534
|
-
│ ├─ skills/ # Agent Skills discovery, catalog, and on-demand loading
|
|
535
|
-
│ ├─ safety/ # risk classifier + engagement (scope) policy
|
|
536
|
-
│ ├─ store/ # config, history, keys, plans, scope
|
|
537
|
-
│ ├─ ui-core/ # renderer-neutral state, actions, layout, rendering, and ports
|
|
538
|
-
│ ├─ classic/ # React + Ink classic UI and POSIX terminal bootstrap
|
|
539
|
-
│ ├─ tui-v2/ # OpenTUI full-screen renderer
|
|
540
|
-
│ ├─ noninteractive/ # stdout/stderr-split one-shot stream renderer
|
|
541
|
-
│ ├─ app/ # session controllers, commands, events, and ports
|
|
542
|
-
│ └─ prompts/ # agent methodology (embedded for the compiled binary)
|
|
543
|
-
├─ install/ · manifests/
|
|
544
|
-
└─ package.json
|
|
545
|
-
```
|
|
336
|
+
Credentials saved with `clai set` or account sign-in are retained in `~/.clai/keys.json`, a **plaintext** file with restricted permissions (`0600` on POSIX). clai also attempts to store them in the OS keyring when available; the local file is retained for recovery. Recognized secrets are masked or redacted in supported displays and storage paths, but review logs and transcripts before sharing them.
|
|
546
337
|
|
|
547
|
-
|
|
338
|
+
Cloud requests send the model's context and relevant tool results to the selected provider. Provider-specific metadata uploads, including OmniRush's optional lifecycle upload, are described in the [provider guide](PROVIDERS.md#omnirush-lifecycle-uploads).
|
|
548
339
|
|
|
549
|
-
##
|
|
340
|
+
## Development and support
|
|
550
341
|
|
|
551
|
-
|
|
342
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for source setup, architecture boundaries, and the CI checks. Report reproducible bugs through [GitHub Issues](https://github.com/pentoshi007/clai/issues), and use [Discussions](https://github.com/pentoshi007/clai/discussions) for questions. Follow [SECURITY.md](SECURITY.md) for vulnerability reporting and the [Code of Conduct](CODE_OF_CONDUCT.md) when participating.
|
|
552
343
|
|
|
553
|
-
|
|
344
|
+
Licensed under the [MIT License](LICENSE).
|