@travisennis/acai 0.0.9 → 0.0.10
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/README.md +49 -762
- package/bin/acai +52 -0
- package/dist/agent/index.d.ts +12 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +378 -199
- package/dist/agent/sub-agent.d.ts +23 -0
- package/dist/agent/sub-agent.d.ts.map +1 -0
- package/dist/agent/sub-agent.js +109 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/{cli.js → cli/index.js} +84 -77
- package/dist/cli/stdin.d.ts.map +1 -0
- package/dist/{stdin.js → cli/stdin.js} +11 -0
- package/dist/commands/copy/index.js +2 -2
- package/dist/commands/copy/utils.d.ts.map +1 -1
- package/dist/commands/copy/utils.js +15 -13
- package/dist/commands/generate-rules/index.d.ts +1 -1
- package/dist/commands/generate-rules/index.d.ts.map +1 -1
- package/dist/commands/generate-rules/index.js +16 -101
- package/dist/commands/generate-rules/service.d.ts +21 -0
- package/dist/commands/generate-rules/service.d.ts.map +1 -0
- package/dist/commands/generate-rules/service.js +103 -0
- package/dist/commands/handoff/index.js +2 -2
- package/dist/commands/health/index.js +1 -1
- package/dist/commands/health/utils.d.ts.map +1 -1
- package/dist/commands/health/utils.js +6 -0
- package/dist/commands/history/index.d.ts +1 -1
- package/dist/commands/history/index.d.ts.map +1 -1
- package/dist/commands/history/index.js +17 -18
- package/dist/commands/history/types.d.ts +38 -0
- package/dist/commands/history/types.d.ts.map +1 -1
- package/dist/commands/history/utils.d.ts.map +1 -1
- package/dist/commands/history/utils.js +63 -58
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +3 -8
- package/dist/commands/init-project/index.d.ts.map +1 -1
- package/dist/commands/init-project/index.js +3 -3
- package/dist/commands/init-project/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.js +10 -2
- package/dist/commands/list-tools/index.d.ts.map +1 -1
- package/dist/commands/list-tools/index.js +7 -31
- package/dist/commands/manager.d.ts +2 -2
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +55 -33
- package/dist/commands/model/index.d.ts.map +1 -1
- package/dist/commands/model/index.js +20 -151
- package/dist/commands/model/model-panel.d.ts +4 -0
- package/dist/commands/model/model-panel.d.ts.map +1 -0
- package/dist/commands/model/model-panel.js +144 -0
- package/dist/commands/paste/index.d.ts.map +1 -1
- package/dist/commands/paste/index.js +59 -62
- package/dist/commands/paste/utils.d.ts.map +1 -1
- package/dist/commands/paste/utils.js +88 -58
- package/dist/commands/pickup/index.d.ts.map +1 -1
- package/dist/commands/pickup/index.js +6 -3
- package/dist/commands/pickup/utils.js +3 -3
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +33 -50
- package/dist/commands/review/index.d.ts.map +1 -1
- package/dist/commands/review/index.js +3 -117
- package/dist/commands/review/review-panel.d.ts +3 -0
- package/dist/commands/review/review-panel.d.ts.map +1 -0
- package/dist/commands/review/review-panel.js +186 -0
- package/dist/commands/review/utils.d.ts +9 -0
- package/dist/commands/review/utils.d.ts.map +1 -1
- package/dist/commands/review/utils.js +127 -68
- package/dist/commands/session/index.d.ts +1 -1
- package/dist/commands/session/index.d.ts.map +1 -1
- package/dist/commands/session/index.js +124 -135
- package/dist/commands/shell/index.d.ts.map +1 -1
- package/dist/commands/shell/index.js +16 -1
- package/dist/commands/types.d.ts +2 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/{config.d.ts → config/index.d.ts} +20 -9
- package/dist/config/index.d.ts.map +1 -0
- package/dist/{config.js → config/index.js} +43 -42
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +75 -55
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -141
- package/dist/middleware/cache.d.ts.map +1 -1
- package/dist/middleware/cache.js +18 -36
- package/dist/models/ai-config.d.ts +1 -0
- package/dist/models/ai-config.d.ts.map +1 -1
- package/dist/models/ai-config.js +4 -3
- package/dist/models/anthropic-provider.d.ts +2 -5
- package/dist/models/anthropic-provider.d.ts.map +1 -1
- package/dist/models/anthropic-provider.js +3 -70
- package/dist/models/deepseek-provider.d.ts +1 -0
- package/dist/models/deepseek-provider.d.ts.map +1 -1
- package/dist/models/google-provider.d.ts +2 -3
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +0 -26
- package/dist/models/groq-provider.d.ts +1 -0
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/manager.d.ts +13 -2
- package/dist/models/manager.d.ts.map +1 -1
- package/dist/models/manager.js +20 -8
- package/dist/models/openai-provider.d.ts +2 -5
- package/dist/models/openai-provider.d.ts.map +1 -1
- package/dist/models/openai-provider.js +0 -52
- package/dist/models/opencode-zen-provider.d.ts +7 -3
- package/dist/models/opencode-zen-provider.d.ts.map +1 -1
- package/dist/models/opencode-zen-provider.js +49 -10
- package/dist/models/openrouter-provider.d.ts +24 -31
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +84 -182
- package/dist/models/providers.d.ts +1 -1
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/xai-provider.d.ts +4 -3
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +18 -18
- package/dist/modes/manager.d.ts +23 -0
- package/dist/modes/manager.d.ts.map +1 -0
- package/dist/modes/manager.js +77 -0
- package/dist/modes/prompts.d.ts +2 -0
- package/dist/modes/prompts.d.ts.map +1 -0
- package/dist/modes/prompts.js +143 -0
- package/dist/prompts/mentions.d.ts +11 -0
- package/dist/prompts/mentions.d.ts.map +1 -0
- package/dist/{mentions.js → prompts/mentions.js} +21 -80
- package/dist/{prompts.d.ts → prompts/system-prompt.d.ts} +7 -2
- package/dist/prompts/system-prompt.d.ts.map +1 -0
- package/dist/{prompts.js → prompts/system-prompt.js} +31 -16
- package/dist/repl/index.d.ts +174 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/{repl-new.js → repl/index.js} +389 -76
- package/dist/repl/project-status.d.ts +1 -0
- package/dist/repl/project-status.d.ts.map +1 -1
- package/dist/repl/project-status.js +4 -1
- package/dist/sessions/manager.d.ts +93 -1
- package/dist/sessions/manager.d.ts.map +1 -1
- package/dist/sessions/manager.js +262 -9
- package/dist/sessions/summary.d.ts +4 -0
- package/dist/sessions/summary.d.ts.map +1 -0
- package/dist/sessions/summary.js +30 -0
- package/dist/{skills.d.ts → skills/index.d.ts} +14 -2
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +294 -0
- package/dist/subagents/index.d.ts +15 -0
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +231 -0
- package/dist/terminal/control.d.ts +1 -1
- package/dist/terminal/control.d.ts.map +1 -1
- package/dist/terminal/control.js +3 -3
- package/dist/terminal/east-asian-width.d.ts.map +1 -1
- package/dist/terminal/east-asian-width.js +404 -351
- package/dist/terminal/keys.d.ts +17 -0
- package/dist/terminal/keys.d.ts.map +1 -1
- package/dist/terminal/keys.js +37 -0
- package/dist/terminal/select-prompt.d.ts.map +1 -1
- package/dist/terminal/select-prompt.js +24 -12
- package/dist/terminal/string-width.d.ts.map +1 -1
- package/dist/terminal/string-width.js +25 -27
- package/dist/terminal/style.d.ts.map +1 -1
- package/dist/terminal/style.js +4 -7
- package/dist/terminal/supports-color.d.ts.map +1 -1
- package/dist/terminal/supports-color.js +41 -27
- package/dist/terminal/table/cell.d.ts +12 -0
- package/dist/terminal/table/cell.d.ts.map +1 -1
- package/dist/terminal/table/cell.js +40 -25
- package/dist/terminal/table/layout-manager.d.ts.map +1 -1
- package/dist/terminal/table/layout-manager.js +100 -68
- package/dist/terminal/table/utils.d.ts.map +1 -1
- package/dist/terminal/table/utils.js +17 -10
- package/dist/terminal/wrap-ansi.d.ts.map +1 -1
- package/dist/terminal/wrap-ansi.js +172 -103
- package/dist/tokens/tracker.d.ts +1 -0
- package/dist/tokens/tracker.d.ts.map +1 -1
- package/dist/tokens/tracker.js +3 -0
- package/dist/tools/agent.d.ts +27 -0
- package/dist/tools/agent.d.ts.map +1 -0
- package/dist/tools/agent.js +81 -0
- package/dist/tools/bash.d.ts +4 -3
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +324 -137
- package/dist/tools/code-search.d.ts +41 -0
- package/dist/tools/code-search.d.ts.map +1 -0
- package/dist/tools/code-search.js +195 -0
- package/dist/tools/directory-tree.d.ts +3 -3
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +8 -5
- package/dist/tools/dynamic-tool-loader.d.ts +2 -5
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +20 -4
- package/dist/tools/edit-file.d.ts +7 -7
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +164 -66
- package/dist/tools/glob.d.ts +6 -6
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +95 -55
- package/dist/tools/grep.d.ts +15 -12
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +300 -192
- package/dist/tools/index.d.ts +143 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +39 -24
- package/dist/tools/ls.d.ts +2 -2
- package/dist/tools/ls.d.ts.map +1 -1
- package/dist/tools/ls.js +7 -5
- package/dist/tools/read-file.d.ts +3 -3
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +74 -34
- package/dist/tools/save-file.d.ts +3 -3
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +11 -11
- package/dist/tools/skill.d.ts +23 -0
- package/dist/tools/skill.d.ts.map +1 -0
- package/dist/tools/skill.js +65 -0
- package/dist/tools/think.d.ts.map +1 -1
- package/dist/tools/think.js +2 -9
- package/dist/tools/utils.d.ts +2 -0
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +12 -0
- package/dist/tools/web-fetch.d.ts +62 -0
- package/dist/tools/web-fetch.d.ts.map +1 -0
- package/dist/tools/web-fetch.js +429 -0
- package/dist/tools/web-search.d.ts +62 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +226 -0
- package/dist/tui/autocomplete/attachment-provider.d.ts +3 -6
- package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/attachment-provider.js +25 -78
- package/dist/tui/autocomplete/base-provider.d.ts +1 -0
- package/dist/tui/autocomplete/base-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/combined-provider.d.ts +1 -4
- package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/combined-provider.js +3 -17
- package/dist/tui/autocomplete/command-provider.d.ts +1 -0
- package/dist/tui/autocomplete/command-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/command-provider.js +3 -0
- package/dist/tui/autocomplete/file-search-provider.d.ts +2 -1
- package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -1
- package/dist/tui/autocomplete/file-search-provider.js +36 -16
- package/dist/tui/autocomplete/skill-provider.d.ts +17 -0
- package/dist/tui/autocomplete/skill-provider.d.ts.map +1 -0
- package/dist/tui/autocomplete/skill-provider.js +49 -0
- package/dist/tui/autocomplete.d.ts +2 -2
- package/dist/tui/autocomplete.d.ts.map +1 -1
- package/dist/tui/autocomplete.js +3 -5
- package/dist/tui/components/assistant-message.d.ts.map +1 -1
- package/dist/tui/components/assistant-message.js +0 -4
- package/dist/tui/components/editor.d.ts +16 -2
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +211 -237
- package/dist/tui/components/footer.d.ts +6 -4
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +49 -25
- package/dist/tui/components/markdown.d.ts +8 -5
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/markdown.js +57 -39
- package/dist/tui/components/modal.d.ts.map +1 -1
- package/dist/tui/components/modal.js +35 -33
- package/dist/tui/components/notification.d.ts +13 -2
- package/dist/tui/components/notification.d.ts.map +1 -1
- package/dist/tui/components/notification.js +36 -2
- package/dist/tui/components/progress-bar.js +1 -1
- package/dist/tui/components/select-list.d.ts +1 -0
- package/dist/tui/components/select-list.d.ts.map +1 -1
- package/dist/tui/components/select-list.js +14 -11
- package/dist/tui/components/text.d.ts +16 -0
- package/dist/tui/components/text.d.ts.map +1 -1
- package/dist/tui/components/text.js +72 -57
- package/dist/tui/components/thinking-block.d.ts +9 -0
- package/dist/tui/components/thinking-block.d.ts.map +1 -1
- package/dist/tui/components/thinking-block.js +43 -11
- package/dist/tui/components/tool-execution.d.ts +5 -1
- package/dist/tui/components/tool-execution.d.ts.map +1 -1
- package/dist/tui/components/tool-execution.js +19 -10
- package/dist/tui/components/user-message.d.ts.map +1 -1
- package/dist/tui/components/user-message.js +0 -3
- package/dist/tui/components/welcome.js +2 -2
- package/dist/tui/terminal.d.ts.map +1 -1
- package/dist/tui/terminal.js +10 -2
- package/dist/tui/tui.d.ts +42 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +157 -41
- package/dist/utils/bash/parse.d.ts +19 -0
- package/dist/utils/bash/parse.d.ts.map +1 -0
- package/dist/utils/bash/parse.js +223 -0
- package/dist/utils/bash/quote.d.ts +6 -0
- package/dist/utils/bash/quote.d.ts.map +1 -0
- package/dist/utils/bash/quote.js +23 -0
- package/dist/utils/bash.d.ts.map +1 -1
- package/dist/utils/bash.js +211 -126
- package/dist/utils/command-protection.d.ts +28 -0
- package/dist/utils/command-protection.d.ts.map +1 -0
- package/dist/utils/command-protection.js +324 -0
- package/dist/utils/dedent.d.ts.map +1 -0
- package/dist/utils/env-expand.d.ts +2 -0
- package/dist/utils/env-expand.d.ts.map +1 -0
- package/dist/utils/env-expand.js +8 -0
- package/dist/utils/filesystem/path-display.d.ts +11 -0
- package/dist/utils/filesystem/path-display.d.ts.map +1 -0
- package/dist/utils/filesystem/path-display.js +32 -0
- package/dist/utils/filesystem/security.d.ts +2 -2
- package/dist/utils/filesystem/security.d.ts.map +1 -1
- package/dist/utils/filesystem/security.js +28 -30
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/{formatting.js → utils/formatting.js} +1 -1
- package/dist/utils/git.d.ts +4 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +30 -0
- package/dist/utils/glob.d.ts +1 -1
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/{logger.js → utils/logger.js} +1 -1
- package/dist/utils/parsing.d.ts.map +1 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +90 -37
- package/dist/utils/templates.d.ts +2 -0
- package/dist/utils/templates.d.ts.map +1 -0
- package/dist/utils/templates.js +24 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/{version.js → utils/version.js} +1 -1
- package/package.json +34 -25
- package/dist/cli.d.ts +0 -23
- package/dist/cli.d.ts.map +0 -1
- package/dist/commands/exit/index.d.ts +0 -10
- package/dist/commands/exit/index.d.ts.map +0 -1
- package/dist/commands/exit/index.js +0 -21
- package/dist/commands/exit/types.d.ts +0 -8
- package/dist/commands/exit/types.d.ts.map +0 -1
- package/dist/commands/exit/types.js +0 -1
- package/dist/commands/exit/utils.d.ts +0 -2
- package/dist/commands/exit/utils.d.ts.map +0 -1
- package/dist/commands/exit/utils.js +0 -13
- package/dist/commands/prompt/index.d.ts +0 -5
- package/dist/commands/prompt/index.d.ts.map +0 -1
- package/dist/commands/prompt/index.js +0 -122
- package/dist/commands/prompt/types.d.ts +0 -15
- package/dist/commands/prompt/types.d.ts.map +0 -1
- package/dist/commands/prompt/types.js +0 -1
- package/dist/commands/prompt/utils.d.ts +0 -12
- package/dist/commands/prompt/utils.d.ts.map +0 -1
- package/dist/commands/prompt/utils.js +0 -107
- package/dist/commands/reset/index.d.ts +0 -3
- package/dist/commands/reset/index.d.ts.map +0 -1
- package/dist/commands/reset/index.js +0 -25
- package/dist/commands/reset/types.d.ts +0 -1
- package/dist/commands/reset/types.d.ts.map +0 -1
- package/dist/commands/reset/types.js +0 -3
- package/dist/commands/save/index.d.ts +0 -3
- package/dist/commands/save/index.d.ts.map +0 -1
- package/dist/commands/save/index.js +0 -19
- package/dist/config.d.ts.map +0 -1
- package/dist/dedent.d.ts.map +0 -1
- package/dist/formatting.d.ts.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/mentions.d.ts +0 -14
- package/dist/mentions.d.ts.map +0 -1
- package/dist/parsing.d.ts.map +0 -1
- package/dist/prompts.d.ts.map +0 -1
- package/dist/repl-new.d.ts +0 -65
- package/dist/repl-new.d.ts.map +0 -1
- package/dist/skills.d.ts.map +0 -1
- package/dist/skills.js +0 -233
- package/dist/stdin.d.ts.map +0 -1
- package/dist/tui/autocomplete/path-provider.d.ts +0 -21
- package/dist/tui/autocomplete/path-provider.d.ts.map +0 -1
- package/dist/tui/autocomplete/path-provider.js +0 -164
- package/dist/version.d.ts.map +0 -1
- /package/dist/{stdin.d.ts → cli/stdin.d.ts} +0 -0
- /package/dist/{dedent.d.ts → utils/dedent.d.ts} +0 -0
- /package/dist/{dedent.js → utils/dedent.js} +0 -0
- /package/dist/{formatting.d.ts → utils/formatting.d.ts} +0 -0
- /package/dist/{logger.d.ts → utils/logger.d.ts} +0 -0
- /package/dist/{parsing.d.ts → utils/parsing.d.ts} +0 -0
- /package/dist/{parsing.js → utils/parsing.js} +0 -0
- /package/dist/{version.d.ts → utils/version.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,209 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-
<!-- Add more badges as appropriate, e.g., build status, version, etc. -->
|
|
6
5
|
|
|
7
|
-
##
|
|
6
|
+
## Overview
|
|
8
7
|
|
|
9
|
-
Acai is
|
|
8
|
+
Acai is an AI-driven command-line tool that assists software developers with coding, debugging, refactoring, and workflow automation. It provides both a conversational REPL and a modern TUI for interacting with large language models in the context of your codebase.
|
|
10
9
|
|
|
11
|
-
###
|
|
10
|
+
### Key Capabilities
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* **Terminal User Interface:** Modern TUI with modal dialogs, autocomplete, and rich text formatting.
|
|
12
|
+
- **Interactive AI Assistant:** Conversational REPL and TUI with modal dialogs, autocomplete, and rich text formatting.
|
|
13
|
+
- **Codebase Interaction:** Read, edit, search, and navigate files with context-aware AI assistance.
|
|
14
|
+
- **Git Integration:** Generate conventional commits, review pull requests, and manage local changes.
|
|
15
|
+
- **Multi-Model Support:** Switch between OpenAI, Anthropic, Google, DeepSeek, Groq, X.AI, OpenRouter, and OpenCode Zen.
|
|
16
|
+
- **Piped Input:** Pipe text via stdin for REPL mode or as context with the `-p` flag.
|
|
17
|
+
- **Skills System:** Discover and load specialized instruction files for specific tasks.
|
|
18
|
+
- **Multi-workspace Support:** Work across multiple project directories simultaneously.
|
|
21
19
|
|
|
22
|
-
##
|
|
20
|
+
## Prerequisites
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* **Code Navigation & Analysis:** Advanced file searching and code analysis capabilities.
|
|
29
|
-
* **Git Workflow Automation:** Streamline commit messages and code reviews.
|
|
30
|
-
* **Extensible Commands:** A rich set of built-in commands (`/help`, `/model`, `/session`, `/list-tools`, etc.).
|
|
31
|
-
* **Token Usage Tracking:** Monitor AI token consumption with comprehensive session overview.
|
|
32
|
-
* **Configurable AI Models:** Easily switch between different LLM providers and models.
|
|
33
|
-
* **Shell Integration:** Execute shell commands inline using `!`command`` syntax or via `/shell` command.
|
|
34
|
-
* **Dynamic Tools:** Create and load custom tools from JavaScript files in your project or user directory.
|
|
35
|
-
* **Multi-workspace Support:** Work across multiple project directories simultaneously.
|
|
36
|
-
* **Skills System:** Discover and load specialized instruction files for specific tasks (PDF extraction, database migrations, etc.).
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## 🛠️ Technologies Used
|
|
40
|
-
|
|
41
|
-
Acai is built primarily with **TypeScript** and runs on **Node.js**. Key technologies and dependencies include:
|
|
42
|
-
|
|
43
|
-
* **TypeScript:** For type-safe and scalable code.
|
|
44
|
-
* **Node.js:** The JavaScript runtime environment.
|
|
45
|
-
* **AI SDK (`@ai-sdk/*`):** For integrating with various Large Language Models (LLMs) like OpenAI, Google Gemini, Anthropic, DeepSeek, Groq, and OpenRouter.
|
|
46
|
-
* **`ripgrep` (via `grep.ts` tool):** For fast file content searching.
|
|
47
|
-
* **`pino`:** For structured logging.
|
|
48
|
-
* **`zod`:** For schema validation.
|
|
49
|
-
* **`biomejs/biome`:** For code formatting and linting.
|
|
50
|
-
|
|
51
|
-
## 🚀 Getting Started
|
|
52
|
-
|
|
53
|
-
### Prerequisites
|
|
54
|
-
|
|
55
|
-
**Required:**
|
|
56
|
-
* Node.js 20 or higher
|
|
57
|
-
* Git
|
|
58
|
-
* [Ripgrep](https://github.com/BurntSushi/ripgrep) (`rg` command) - Fast file content searching
|
|
59
|
-
* [GitHub CLI](https://cli.github.com/) (`gh` command) - Git operations and repository management
|
|
60
|
-
|
|
61
|
-
**Installation of system dependencies:**
|
|
22
|
+
- Node.js 20 or higher
|
|
23
|
+
- Git
|
|
24
|
+
- [Ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`) - Fast file content searching
|
|
25
|
+
- [GitHub CLI](https://cli.github.com/) (`gh`) - Git operations and repository management
|
|
62
26
|
|
|
63
27
|
```bash
|
|
64
|
-
# macOS
|
|
28
|
+
# macOS
|
|
65
29
|
brew install ripgrep gh
|
|
66
30
|
|
|
67
31
|
# Ubuntu/Debian
|
|
68
32
|
sudo apt install ripgrep gh
|
|
69
|
-
|
|
70
|
-
# Windows (using Chocolatey)
|
|
71
|
-
choco install ripgrep gh
|
|
72
|
-
|
|
73
|
-
# Or using winget
|
|
74
|
-
winget install BurntSushi.ripgrep GitHub.cli
|
|
75
33
|
```
|
|
76
34
|
|
|
77
|
-
|
|
78
|
-
* API keys for AI providers (see Environment Variables section below)
|
|
79
|
-
|
|
80
|
-
### Installation for Users
|
|
35
|
+
## Installation
|
|
81
36
|
|
|
82
37
|
```bash
|
|
83
38
|
npm install -g @travisennis/acai
|
|
84
39
|
```
|
|
85
40
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Clone the repository
|
|
90
|
-
git clone https://github.com/travisennis/acai-ts.git # Assuming this is the repo URL
|
|
91
|
-
cd acai-ts
|
|
92
|
-
|
|
93
|
-
# Install dependencies
|
|
94
|
-
npm install
|
|
95
|
-
|
|
96
|
-
# Set up environment variables (see Environment Variables section)
|
|
97
|
-
cp .env.example .env # If .env.example exists, or create .env manually
|
|
98
|
-
# Edit .env file with your API keys
|
|
99
|
-
|
|
100
|
-
# Build the project
|
|
101
|
-
npm run build
|
|
102
|
-
|
|
103
|
-
# Link the CLI tool globally (optional, for easy access)
|
|
104
|
-
npm link
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Environment Variables
|
|
108
|
-
|
|
109
|
-
Acai supports various AI providers and web services through environment variables. Create a `.env` file in your project root or set these variables in your shell environment.
|
|
110
|
-
|
|
111
|
-
### AI Provider API Keys
|
|
41
|
+
## Quick Start
|
|
112
42
|
|
|
113
43
|
```bash
|
|
114
|
-
#
|
|
115
|
-
OPENAI_API_KEY=your_openai_api_key_here
|
|
116
|
-
|
|
117
|
-
# Anthropic (Claude models)
|
|
118
|
-
ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
|
119
|
-
|
|
120
|
-
# Google (Gemini models)
|
|
121
|
-
GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key_here
|
|
122
|
-
|
|
123
|
-
# DeepSeek
|
|
124
|
-
DEEPSEEK_API_KEY=your_deepseek_api_key_here
|
|
125
|
-
|
|
126
|
-
# Groq (Kimi models)
|
|
127
|
-
GROQ_API_KEY=your_groq_api_key_here
|
|
128
|
-
|
|
129
|
-
# X.AI (Grok models)
|
|
130
|
-
X_AI_API_KEY=your_xai_api_key_here
|
|
131
|
-
# Alternative name also supported:
|
|
132
|
-
# XAI_API_KEY=your_xai_api_key_here
|
|
133
|
-
|
|
134
|
-
# OpenRouter (Access to multiple models)
|
|
135
|
-
OPENROUTER_API_KEY=your_openrouter_api_key_here
|
|
136
|
-
|
|
137
|
-
# OpenCode Zen
|
|
138
|
-
OPENCODE_ZEN_API_TOKEN=your_opencode_zen_api_token_here
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Application Configuration
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
# Logging level (optional, defaults to "debug")
|
|
145
|
-
# Options: trace, debug, info, warn, error, fatal
|
|
146
|
-
LOG_LEVEL=info
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Example .env File
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
# Core AI providers (at least one recommended)
|
|
153
|
-
OPENAI_API_KEY=sk-...
|
|
154
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
155
|
-
|
|
156
|
-
# Optional: Additional providers
|
|
157
|
-
GOOGLE_GENERATIVE_AI_API_KEY=...
|
|
158
|
-
GROQ_API_KEY=...
|
|
159
|
-
OPENROUTER_API_KEY=sk-or-...
|
|
160
|
-
|
|
161
|
-
# Optional: Application settings
|
|
162
|
-
LOG_LEVEL=info
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
**Note:** You need at least one AI provider API key to use Acai. The tool will work with any combination of the supported providers.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
### Usage
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Start interactive mode with default model
|
|
44
|
+
# Start interactive mode
|
|
172
45
|
acai
|
|
173
46
|
|
|
174
47
|
# Specify a model
|
|
175
48
|
acai --model anthropic:sonnet
|
|
176
49
|
|
|
177
|
-
# CLI mode
|
|
50
|
+
# One-shot CLI mode
|
|
178
51
|
acai -p "What files contain the term 'toolCallRepair'?"
|
|
179
52
|
|
|
180
|
-
# Pipe input
|
|
53
|
+
# Pipe input
|
|
181
54
|
echo "How many TypeScript files are in this project?" | acai
|
|
182
55
|
|
|
183
|
-
#
|
|
184
|
-
echo "Context information here" | acai -p "Process this context"
|
|
185
|
-
|
|
186
|
-
# Disable skills discovery
|
|
187
|
-
acai --no-skills
|
|
188
|
-
|
|
189
|
-
# Add additional working directories
|
|
190
|
-
acai --add-dir /path/to/project1 --add-dir /path/to/project2
|
|
191
|
-
|
|
192
|
-
# Resume a previous session by selecting from a list
|
|
193
|
-
acai --continue
|
|
194
|
-
|
|
195
|
-
# Resume the most recent session
|
|
56
|
+
# Resume a previous session
|
|
196
57
|
acai --resume
|
|
197
|
-
|
|
198
|
-
# Resume a specific session by ID
|
|
199
|
-
acai --resume a1b2c3d4-e5f6-7890-1234-567890abcdef
|
|
200
58
|
```
|
|
201
59
|
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
To resume this session call acai --resume <session-id>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Once in the REPL, you can type your prompts or use commands:
|
|
60
|
+
Once in the REPL, type prompts or use commands:
|
|
208
61
|
|
|
209
62
|
```
|
|
210
63
|
> How do I read a file in Node.js?
|
|
@@ -212,619 +65,53 @@ Once in the REPL, you can type your prompts or use commands:
|
|
|
212
65
|
> /help
|
|
213
66
|
```
|
|
214
67
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
You can reference files and directories directly in your prompts:
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
> Explain the purpose of @source/index.ts
|
|
221
|
-
> What patterns do you see in @source/tools/ directory
|
|
222
|
-
> Find security issues in @config/ directory
|
|
223
|
-
> Check if `!ls -la` shows any suspicious files
|
|
224
|
-
> Analyze @README.md for typos
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
**Supported syntax:**
|
|
228
|
-
- `@filename` - Include contents of a specific file
|
|
229
|
-
- `@dirname` - Recursively include all files in a directory
|
|
230
|
-
- `@http://example.com` - Fetch and include web content
|
|
231
|
-
- ``!`command` `` - Execute shell command and include output
|
|
232
|
-
|
|
233
|
-
### Prompt Arguments
|
|
234
|
-
|
|
235
|
-
Pass dynamic values to commands using argument placeholders in custom prompts:
|
|
236
|
-
|
|
237
|
-
#### All arguments with `$ARGUMENTS`
|
|
238
|
-
|
|
239
|
-
The `$ARGUMENTS` placeholder captures all arguments passed to the command:
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
# Command definition
|
|
243
|
-
echo 'Fix issue #$ARGUMENTS following our coding standards' > .acai/prompts/fix-issue.md
|
|
244
|
-
|
|
245
|
-
# Usage
|
|
246
|
-
> /fix-issue 123 high-priority
|
|
247
|
-
# $ARGUMENTS becomes: "123 high-priority"
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
#### Individual arguments with `$1`, `$2`, `$3`, etc.
|
|
251
|
-
|
|
252
|
-
Access specific arguments individually using positional parameters (similar to shell scripts):
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Command definition
|
|
256
|
-
echo 'Review PR #$1 with priority $2 and assign to $3' > .acai/prompts/review-pr.md
|
|
257
|
-
|
|
258
|
-
# Usage
|
|
259
|
-
> /review-pr 456 high alice
|
|
260
|
-
# $1 becomes "456", $2 becomes "high", $3 becomes "alice"
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
Use positional arguments when you need to:
|
|
264
|
-
- Access arguments individually in different parts of your command
|
|
265
|
-
- Provide defaults for missing arguments
|
|
266
|
-
- Build more structured commands with specific parameter roles
|
|
267
|
-
|
|
268
|
-
#### Backward compatibility with `{{INPUT}}`
|
|
269
|
-
|
|
270
|
-
The legacy `{{INPUT}}` placeholder is still supported and works the same as `$ARGUMENTS`:
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
# Command definition
|
|
274
|
-
echo 'Analyze the following code: {{INPUT}}' > .acai/prompts/analyze.md
|
|
275
|
-
|
|
276
|
-
# Usage
|
|
277
|
-
> /analyze src/file.ts
|
|
278
|
-
# {{INPUT}} becomes: "src/file.ts"
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
**Note:** Using `-p/--prompt` runs in CLI mode (one-shot execution), while running without a prompt starts interactive REPL mode.
|
|
68
|
+
Reference files directly with `@filename`, directories with `@dirname`, or run shell commands with `` !`command` ``.
|
|
282
69
|
|
|
283
|
-
|
|
70
|
+
## Technologies
|
|
284
71
|
|
|
285
|
-
|
|
72
|
+
- **TypeScript** and **Node.js**
|
|
73
|
+
- **AI SDK (`@ai-sdk/*`)** for LLM provider integration
|
|
74
|
+
- **Ripgrep** for fast file content searching
|
|
75
|
+
- **Pino** for structured logging
|
|
76
|
+
- **Zod** for schema validation
|
|
77
|
+
- **Biome** for formatting and linting
|
|
286
78
|
|
|
287
|
-
|
|
288
|
-
# REPL mode: piped text becomes the initial prompt, processed immediately
|
|
289
|
-
echo "What can you do?" | acai
|
|
290
|
-
# Acai starts, processes the prompt, displays response,
|
|
291
|
-
# then enters interactive mode for continued conversation
|
|
292
|
-
|
|
293
|
-
# CLI mode: piped text becomes additional context
|
|
294
|
-
echo "Codebase overview: 50 files, TypeScript project" | acai -p "Summarize this project"
|
|
295
|
-
# Piped content is added as context, -p value is the main prompt
|
|
296
|
-
# Runs in single-shot CLI mode and exits
|
|
297
|
-
|
|
298
|
-
# Multiple inputs
|
|
299
|
-
echo "Large context file" | acai -p "Analyze and improve"
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
**Input size limits:**
|
|
303
|
-
- **Soft limit (50KB):** Warning logged to stderr, processing continues
|
|
304
|
-
- **Hard limit (200KB):** Error displayed, process exits with code 1
|
|
305
|
-
|
|
306
|
-
**Empty input handling:**
|
|
307
|
-
- Empty stdin without `-p` flag: Prints message and exits with code 0
|
|
308
|
-
- Empty stdin with `-p` flag: Proceeds normally (no context added)
|
|
309
|
-
|
|
310
|
-
For a list of available commands, type `/help` within the REPL.
|
|
311
|
-
|
|
312
|
-
## Interactive CLI Commands
|
|
313
|
-
|
|
314
|
-
- `/help` - Shows usage information
|
|
315
|
-
- `/reset` - Saves chat history and resets the conversation
|
|
316
|
-
- `/save` - Saves chat history
|
|
317
|
-
- `/exit` or `/bye` - Exits and saves chat history
|
|
318
|
-
- `/init` - Generate or improve `AGENTS.md`
|
|
319
|
-
- `/paste` - Add clipboard contents to the next prompt
|
|
320
|
-
- `/prompt <name> [arguments...]` - Load saved prompts with optional arguments. Project prompts override user prompts. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) in prompt files.
|
|
321
|
-
- `/model [provider:model|category|provider]` - List or switch models
|
|
322
|
-
- `/session` - Show comprehensive session information including usage and costs
|
|
323
|
-
- `/clear` - Clears the terminal screen for the current session
|
|
324
|
-
- `/generateRules` - Analyze the current conversation and suggest project rules
|
|
325
|
-
- `/copy` - Copy the last assistant response to the system clipboard
|
|
326
|
-
- `/list-tools` or `/lt` - List all available static and dynamic tools
|
|
327
|
-
- `/add-dir <path>` - Add additional working directory
|
|
328
|
-
- `/list-dirs` - List all working directories
|
|
329
|
-
- `/remove-dir <path>` - Remove a working directory
|
|
330
|
-
- `/health` - Check system health and dependencies
|
|
331
|
-
- `/history` - View and manage conversation history
|
|
332
|
-
- `/pickup` - Resume a previous conversation
|
|
333
|
-
- `/handoff` - Hand off conversation to another agent
|
|
334
|
-
- `/share` - Share the current session as a GitHub Gist for viewing in a web browser
|
|
335
|
-
- `/shell` - Execute shell commands
|
|
336
|
-
|
|
337
|
-
**Note**: Some commands mentioned in older documentation may no longer be available. Use `/help` to see current commands.
|
|
338
|
-
|
|
339
|
-
Clipboard notes:
|
|
340
|
-
- macOS: uses `pbcopy`
|
|
341
|
-
- Windows: uses `clip`
|
|
342
|
-
- Linux: tries `xclip`, falls back to `xsel`
|
|
343
|
-
|
|
344
|
-
## Custom Tools
|
|
345
|
-
|
|
346
|
-
Acai supports dynamic custom tools that users can define as executable Node.js scripts. These tools extend the core functionality without modifying the source code.
|
|
347
|
-
|
|
348
|
-
### Directories
|
|
349
|
-
|
|
350
|
-
- **Project tools**: `./.acai/tools/*.(m)js` (project-specific, override global tools with the same name).
|
|
351
|
-
- **User tools**: `~/.acai/tools/*.(m)js` (global, available across all projects).
|
|
352
|
-
|
|
353
|
-
### Format Specification
|
|
354
|
-
|
|
355
|
-
Custom tools are Node.js scripts that respond to environment variables:
|
|
356
|
-
|
|
357
|
-
- **Describe mode**: Set `TOOL_ACTION=describe` to output YAML metadata to stdout.
|
|
358
|
-
|
|
359
|
-
Example output:
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
name: run-tests
|
|
363
|
-
description: Run tests in a project workspace with proper output formatting
|
|
364
|
-
parameters:
|
|
365
|
-
- name: dir
|
|
366
|
-
type: string
|
|
367
|
-
description: the workspace directory to run tests in
|
|
368
|
-
required: false
|
|
369
|
-
default: "."
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
- **Execute mode**: Set `TOOL_ACTION=execute` and read JSON parameters from stdin (array of `{name: string, value: any}`), perform the action, and output results to stdout (JSON or text). Exit with 0 on success, non-zero on error.
|
|
373
|
-
|
|
374
|
-
Scripts should include `#!/usr/bin/env node` shebang for executability.
|
|
375
|
-
|
|
376
|
-
### Security Notes
|
|
377
|
-
|
|
378
|
-
- Dynamic tools run in sandboxed child processes with limited permissions (no network access beyond what's allowed, timeout of 30s, isolated environment).
|
|
379
|
-
- Scripts have access to the project directory but cannot access Acai internals.
|
|
380
|
-
- Validate inputs and handle errors gracefully.
|
|
381
|
-
- Malicious scripts could perform unintended actions; review tools before use.
|
|
382
|
-
- Future enhancements may include script signing or allowlisting.
|
|
383
|
-
|
|
384
|
-
### Example Script
|
|
385
|
-
|
|
386
|
-
Create `./.acai/tools/run-tests.js`:
|
|
387
|
-
|
|
388
|
-
```javascript
|
|
389
|
-
#!/usr/bin/env node
|
|
390
|
-
|
|
391
|
-
const { spawn } = require('node:child_process');
|
|
392
|
-
|
|
393
|
-
if (process.env.TOOL_ACTION === 'describe') {
|
|
394
|
-
console.log(JSON.stringify({
|
|
395
|
-
name: 'run-tests',
|
|
396
|
-
description: 'Run tests in the specified directory',
|
|
397
|
-
parameters: [
|
|
398
|
-
{
|
|
399
|
-
name: 'dir',
|
|
400
|
-
type: 'string',
|
|
401
|
-
description: 'Directory to run tests in (default: current directory)',
|
|
402
|
-
required: false,
|
|
403
|
-
default: '.'
|
|
404
|
-
}
|
|
405
|
-
]
|
|
406
|
-
}, null, 2));
|
|
407
|
-
process.exit(0);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
if (process.env.TOOL_ACTION === 'execute') {
|
|
411
|
-
let params = [];
|
|
412
|
-
process.stdin.setEncoding('utf8');
|
|
413
|
-
process.stdin.on('readable', () => {
|
|
414
|
-
let chunk;
|
|
415
|
-
while (null !== (chunk = process.stdin.read())) {
|
|
416
|
-
params = JSON.parse(chunk);
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
process.stdin.on('end', () => {
|
|
421
|
-
const dir = params.find(p => p.name === 'dir')?.value || '.';
|
|
422
|
-
const child = spawn('npm', ['test'], { cwd: dir, stdio: 'pipe' });
|
|
423
|
-
let output = '';
|
|
424
|
-
child.stdout.on('data', (data) => output += data);
|
|
425
|
-
child.on('close', (code) => {
|
|
426
|
-
console.log(output);
|
|
427
|
-
process.exit(code);
|
|
428
|
-
});
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Loading Tools
|
|
434
|
-
|
|
435
|
-
Dynamic tools are loaded automatically on each user input.
|
|
436
|
-
|
|
437
|
-
For more details, see the implementation in `source/tools/dynamic-tool-loader.ts`.
|
|
438
|
-
|
|
439
|
-
## Dynamic Tools
|
|
440
|
-
|
|
441
|
-
Acai supports dynamic tools - custom tools that you can create and load from JavaScript files. This allows you to extend Acai's functionality with your own specialized tools.
|
|
442
|
-
|
|
443
|
-
### Creating Dynamic Tools
|
|
444
|
-
|
|
445
|
-
Dynamic tools are JavaScript files that follow a specific structure. Here's a simple example:
|
|
446
|
-
|
|
447
|
-
```javascript
|
|
448
|
-
#!/usr/bin/env node
|
|
449
|
-
|
|
450
|
-
if (process.env.TOOL_ACTION === 'describe') {
|
|
451
|
-
console.log(JSON.stringify({
|
|
452
|
-
name: 'my-custom-tool',
|
|
453
|
-
description: 'A custom tool that does something useful',
|
|
454
|
-
parameters: [
|
|
455
|
-
{
|
|
456
|
-
name: 'input',
|
|
457
|
-
type: 'string',
|
|
458
|
-
description: 'Input to process',
|
|
459
|
-
required: true
|
|
460
|
-
}
|
|
461
|
-
]
|
|
462
|
-
}, null, 2));
|
|
463
|
-
process.exit(0);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
if (process.env.TOOL_ACTION === 'execute') {
|
|
467
|
-
let params = [];
|
|
468
|
-
process.stdin.setEncoding('utf8');
|
|
469
|
-
process.stdin.on('readable', () => {
|
|
470
|
-
let chunk;
|
|
471
|
-
while (null !== (chunk = process.stdin.read())) {
|
|
472
|
-
params = JSON.parse(chunk);
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
process.stdin.on('end', () => {
|
|
477
|
-
const input = params.find(p => p.name === 'input')?.value;
|
|
478
|
-
// Your tool logic here
|
|
479
|
-
const result = `Processed: ${input}`;
|
|
480
|
-
console.log(result);
|
|
481
|
-
process.exit(0);
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
### Tool Structure
|
|
487
|
-
|
|
488
|
-
- **Describe Phase**: When `TOOL_ACTION=describe`, the tool must output JSON metadata
|
|
489
|
-
- `name`: Tool name (will be prefixed with `dynamic:`)
|
|
490
|
-
- `description`: Human-readable description
|
|
491
|
-
- `parameters`: Array of parameter definitions
|
|
492
|
-
- **Execute Phase**: When `TOOL_ACTION=execute`, the tool reads parameters from stdin and outputs results
|
|
493
|
-
|
|
494
|
-
### Parameter Definition
|
|
495
|
-
|
|
496
|
-
Each parameter can have:
|
|
497
|
-
- `name`: Parameter name
|
|
498
|
-
- `type`: "string", "number", or "boolean"
|
|
499
|
-
- `description`: Human-readable description
|
|
500
|
-
- `required`: Boolean (default: false)
|
|
501
|
-
- `default`: Default value for optional parameters
|
|
502
|
-
|
|
503
|
-
### Tool Locations
|
|
504
|
-
|
|
505
|
-
Dynamic tools are loaded from two locations:
|
|
506
|
-
1. **Project tools**: `.acai/tools/` in your project directory
|
|
507
|
-
2. **User tools**: `~/.acai/tools/` in your home directory
|
|
508
|
-
|
|
509
|
-
Project tools override user tools with the same name.
|
|
510
|
-
|
|
511
|
-
### Configuration
|
|
512
|
-
|
|
513
|
-
Dynamic tools are configured in your `.acai.json` file:
|
|
514
|
-
|
|
515
|
-
```json
|
|
516
|
-
{
|
|
517
|
-
"tools": {
|
|
518
|
-
"dynamicTools": {
|
|
519
|
-
"enabled": true,
|
|
520
|
-
"maxTools": 50
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
- `enabled`: Enable/disable dynamic tools (default: true)
|
|
527
|
-
- `maxTools`: Maximum number of tools to load (default: 50)
|
|
528
|
-
|
|
529
|
-
### Security Considerations
|
|
530
|
-
|
|
531
|
-
Dynamic tools run with the same privileges as Acai itself. Keep these security points in mind:
|
|
532
|
-
|
|
533
|
-
- **Input Validation**: Always validate and sanitize input parameters
|
|
534
|
-
- **Path Safety**: Be careful with file paths to prevent directory traversal
|
|
535
|
-
- **Resource Limits**: Tools are automatically killed after 30 seconds
|
|
536
|
-
- **No Shell Access**: Tools run directly with Node.js, not through a shell
|
|
537
|
-
|
|
538
|
-
### Example Tools
|
|
539
|
-
|
|
540
|
-
See the included `run-tests.js` tool in `.acai/tools/` for a complete example.
|
|
541
|
-
|
|
542
|
-
### Listing Tools
|
|
543
|
-
|
|
544
|
-
Use the `/list-tools` command to see all available tools, including dynamic tools:
|
|
545
|
-
|
|
546
|
-
```
|
|
547
|
-
> /list-tools
|
|
548
|
-
Available tools:
|
|
549
|
-
Static tools:
|
|
550
|
-
bash
|
|
551
|
-
readFile
|
|
552
|
-
editFile
|
|
553
|
-
...
|
|
554
|
-
Dynamic tools:
|
|
555
|
-
dynamic:run-tests
|
|
556
|
-
dynamic:my-custom-tool
|
|
557
|
-
|
|
558
|
-
Total: 14 static, 2 dynamic
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
## Skills System
|
|
562
|
-
|
|
563
|
-
Acai includes a powerful skills system that allows you to create and use specialized instruction files for specific tasks. Skills are markdown files with YAML frontmatter that provide detailed instructions for particular domains (e.g., database migrations, PDF extraction, code review).
|
|
564
|
-
|
|
565
|
-
### How Skills Work
|
|
566
|
-
|
|
567
|
-
1. **Discovery**: At startup, Acai scans multiple locations for skills
|
|
568
|
-
2. **Listing**: Available skills are listed in the system prompt
|
|
569
|
-
3. **On-demand loading**: When a task matches a skill's description, the agent uses the `read` tool to load the skill file
|
|
570
|
-
4. **Execution**: The agent follows the instructions in the skill file
|
|
571
|
-
|
|
572
|
-
### Skill File Format
|
|
573
|
-
|
|
574
|
-
Skills are markdown files named `SKILL.md` with YAML frontmatter:
|
|
575
|
-
|
|
576
|
-
```markdown
|
|
577
|
-
---
|
|
578
|
-
description: Extract text and tables from PDF files
|
|
579
|
-
name: pdf-extract # Optional, defaults to directory name
|
|
580
|
-
---
|
|
581
|
-
|
|
582
|
-
# PDF Processing Instructions
|
|
583
|
-
|
|
584
|
-
1. Use `pdftotext` to extract plain text
|
|
585
|
-
2. For tables, use `tabula-py` or similar
|
|
586
|
-
3. Always verify extraction quality
|
|
587
|
-
|
|
588
|
-
Scripts are in: {baseDir}/scripts/
|
|
589
|
-
Configuration: {baseDir}/config.json
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
**Required fields:**
|
|
593
|
-
- `description`: Short description shown in system prompt
|
|
594
|
-
|
|
595
|
-
**Optional fields:**
|
|
596
|
-
- `name`: Override the skill name (defaults to directory name or colon-separated path)
|
|
597
|
-
|
|
598
|
-
**Placeholder:**
|
|
599
|
-
- `{baseDir}`: Replaced with the skill's base directory path
|
|
600
|
-
|
|
601
|
-
### Skill Locations
|
|
602
|
-
|
|
603
|
-
Skills are loaded from these locations (later sources override earlier ones):
|
|
604
|
-
|
|
605
|
-
1. `~/.codex/skills/**/SKILL.md` (Codex CLI user skills)
|
|
606
|
-
2. `~/.claude/skills/*/SKILL.md` (Claude Code user skills)
|
|
607
|
-
3. `<cwd>/.claude/skills/*/SKILL.md` (Claude Code project skills)
|
|
608
|
-
4. `~/.acai/skills/**/SKILL.md` (Acai user skills)
|
|
609
|
-
5. `<cwd>/.acai/skills/**/SKILL.md` (Acai project skills)
|
|
610
|
-
|
|
611
|
-
### Directory Structure
|
|
612
|
-
|
|
613
|
-
Skills can be organized hierarchically with colon-separated names:
|
|
614
|
-
|
|
615
|
-
```
|
|
616
|
-
~/.acai/skills/
|
|
617
|
-
├── pdf-extract/
|
|
618
|
-
│ ├── SKILL.md # Becomes "pdf-extract" skill
|
|
619
|
-
│ └── scripts/ # Optional: supporting files
|
|
620
|
-
├── db/
|
|
621
|
-
│ └── migrate/
|
|
622
|
-
│ └── SKILL.md # Becomes "db:migrate" skill
|
|
623
|
-
└── aws/
|
|
624
|
-
└── s3/
|
|
625
|
-
└── upload/
|
|
626
|
-
└── SKILL.md # Becomes "aws:s3:upload" skill
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
### Compatibility
|
|
630
|
-
|
|
631
|
-
Acai's skills system is compatible with:
|
|
632
|
-
- **Pi Native Format**: `~/.acai/skills/**/SKILL.md` (recursive, colon-separated paths)
|
|
633
|
-
- **Claude Code Format**: `~/.claude/skills/*/SKILL.md` (single level only)
|
|
634
|
-
- **Codex CLI Format**: `~/.codex/skills/**/SKILL.md` (recursive, simple names)
|
|
635
|
-
|
|
636
|
-
### Configuration
|
|
637
|
-
|
|
638
|
-
Skills are enabled by default. You can disable them via:
|
|
639
|
-
|
|
640
|
-
1. **CLI flag**: `acai --no-skills`
|
|
641
|
-
2. **Settings file**: Add to `~/.acai/acai.json` or `.acai/acai.json`:
|
|
642
|
-
```json
|
|
643
|
-
{
|
|
644
|
-
"skills": {
|
|
645
|
-
"enabled": false
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
```
|
|
649
|
-
|
|
650
|
-
### Usage Example
|
|
651
|
-
|
|
652
|
-
1. **Agent startup**: Scans all skill locations
|
|
653
|
-
2. **System prompt**: Lists available skills
|
|
654
|
-
3. **User request**: "Extract text from this PDF"
|
|
655
|
-
4. **Agent matches**: Sees "pdf-extract: Extract text and tables from PDF files"
|
|
656
|
-
5. **Skill loading**: Uses `read` tool to load `~/.acai/skills/pdf-extract/SKILL.md`
|
|
657
|
-
6. **Placeholder substitution**: Replaces `{baseDir}` with skill directory path
|
|
658
|
-
7. **Execution**: Follows instructions in skill file
|
|
659
|
-
|
|
660
|
-
## Configuration
|
|
661
|
-
|
|
662
|
-
### Project Configuration
|
|
663
|
-
|
|
664
|
-
Acai supports project-specific configuration through a `.acai/acai.json` file in your project directory:
|
|
665
|
-
|
|
666
|
-
```json
|
|
667
|
-
{
|
|
668
|
-
"logs": {
|
|
669
|
-
"path": "~/.acai/logs/acai.log" // Optional: Custom log file location
|
|
670
|
-
},
|
|
671
|
-
"notify": true, // Optional: Enable system notifications (default: false)
|
|
672
|
-
"tools": {
|
|
673
|
-
"maxTokens": 30000 // Optional: Global max token limit for tools
|
|
674
|
-
},
|
|
675
|
-
"skills": {
|
|
676
|
-
"enabled": true // Optional: Enable/disable skills discovery (default: true)
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
### Project-Specific Customization
|
|
685
|
-
|
|
686
|
-
- **Rules/Guidelines**: Add project-specific AI behavior rules in `AGENTS.md`
|
|
687
|
-
- **Custom Prompts**: Store reusable prompts in `.acai/prompts/`. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) for dynamic content.
|
|
688
|
-
|
|
689
|
-
- **File Selections**: Save file/directory selections in `.acai/selections/`
|
|
690
|
-
- **Memory/Rules**: Persistent project rules stored in `.acai/rules/`
|
|
691
|
-
|
|
692
|
-
### Global Configuration
|
|
693
|
-
|
|
694
|
-
Global application settings are stored in:
|
|
695
|
-
- **Configuration**: `~/.acai/`
|
|
696
|
-
- **Logs**: `~/.acai/logs/acai.log`
|
|
697
|
-
- **Message History**: `~/.acai/message-history/`
|
|
698
|
-
|
|
699
|
-
### Environment-Specific Setup
|
|
700
|
-
|
|
701
|
-
For development, you can use different configurations:
|
|
702
|
-
|
|
703
|
-
```bash
|
|
704
|
-
# Development with .env file
|
|
705
|
-
npm run dev
|
|
706
|
-
|
|
707
|
-
# Production
|
|
708
|
-
acai
|
|
709
|
-
|
|
710
|
-
# Custom log level
|
|
711
|
-
LOG_LEVEL=warn acai
|
|
712
|
-
```
|
|
713
|
-
|
|
714
|
-
## Web Skills
|
|
715
|
-
|
|
716
|
-
Acai's web functionality has been moved to standalone skills that operate independently of the core codebase. These skills provide web-related capabilities while keeping the main acai-ts project lightweight and focused.
|
|
717
|
-
|
|
718
|
-
### Skill Locations
|
|
719
|
-
|
|
720
|
-
Web skills are located in:
|
|
721
|
-
- `~/.acai/skills/web-fetch/` - User-level web fetch skill
|
|
722
|
-
- `~/.acai/skills/web-search/` - User-level web search skill
|
|
723
|
-
- `<project>/.acai/skills/web-fetch/` - Project-level web fetch skill
|
|
724
|
-
- `<project>/.acai/skills/web-search/` - Project-level web search skill
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
## ⚙️ Development
|
|
728
|
-
|
|
729
|
-
### Development Environment Setup
|
|
730
|
-
|
|
731
|
-
1. **Clone and install dependencies:**
|
|
732
|
-
```bash
|
|
733
|
-
git clone https://github.com/travisennis/acai-ts.git
|
|
734
|
-
cd acai-ts
|
|
735
|
-
npm install
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
2. **Set up environment variables:**
|
|
739
|
-
```bash
|
|
740
|
-
# Create .env file with your API keys
|
|
741
|
-
touch .env
|
|
742
|
-
# Add your API keys (see Environment Variables section above)
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
3. **Development workflow:**
|
|
746
|
-
```bash
|
|
747
|
-
# Run in development mode (uses .env file)
|
|
748
|
-
npm run dev
|
|
749
|
-
|
|
750
|
-
# Build and test
|
|
751
|
-
npm run build
|
|
752
|
-
npm test
|
|
753
|
-
|
|
754
|
-
# Code quality
|
|
755
|
-
npm run lint
|
|
756
|
-
npm run format
|
|
757
|
-
```
|
|
758
|
-
|
|
759
|
-
### Available NPM Scripts
|
|
760
|
-
|
|
761
|
-
Here's a list of useful `npm` scripts for development:
|
|
762
|
-
|
|
763
|
-
| Script | Description |
|
|
764
|
-
| :------------ | :----------------------------------------------------------------------- |
|
|
765
|
-
| `npm run build` | Compiles the TypeScript source code to JavaScript. |
|
|
766
|
-
| `npm run clean` | Removes the `dist/` directory. |
|
|
767
|
-
| `npm run compile` | Compiles TypeScript files (`tsc --pretty`). |
|
|
768
|
-
| `npm run lint` | Runs Biome linter to check for code style and quality issues. |
|
|
769
|
-
| `npm run lint:fix` | Automatically fixes linting issues using Biome. |
|
|
770
|
-
| `npm run test` | Runs unit tests with code coverage using `c8`. |
|
|
771
|
-
| `npm run format` | Formats the codebase using Biome. |
|
|
772
|
-
| `npm run dev` | Starts the application in development mode (loads .env file automatically). |
|
|
773
|
-
| `npm run oxlint` | Runs Oxlint for additional code quality checks. |
|
|
774
|
-
| `npm run knip` | Detects unused files, dependencies, and exports. |
|
|
775
|
-
| `npm run check` | Interactively checks for and updates outdated npm packages. |
|
|
776
|
-
| `npm run cpd` | Checks for copy-pasted code using `jscpd`. |
|
|
777
|
-
| `npm run typecheck` | Type checks the codebase without emitting files. |
|
|
778
|
-
|
|
779
|
-
### Code Structure
|
|
780
|
-
|
|
781
|
-
The project is organized as follows:
|
|
79
|
+
## Project Structure
|
|
782
80
|
|
|
783
81
|
```
|
|
784
82
|
.
|
|
785
|
-
├── .acai/ # Internal configuration and temporary files
|
|
786
83
|
├── source/ # Main application source code
|
|
787
|
-
│ ├── agent/ # Agent loop and
|
|
788
|
-
│ ├── api/ # External API integrations (e.g., Exa)
|
|
84
|
+
│ ├── agent/ # Agent loop and sub-agent execution
|
|
789
85
|
│ ├── cli.ts # CLI entry point
|
|
790
|
-
│ ├── commands/ #
|
|
86
|
+
│ ├── commands/ # REPL command implementations
|
|
791
87
|
│ ├── execution/ # Command execution utilities
|
|
792
|
-
│ ├── middleware/
|
|
88
|
+
│ ├── middleware/ # AI request/response middleware
|
|
793
89
|
│ ├── models/ # AI model providers and management
|
|
90
|
+
│ ├── modes/ # Agent mode management
|
|
794
91
|
│ ├── prompts/ # Prompt generation and management
|
|
795
|
-
│ ├── repl/ # REPL
|
|
92
|
+
│ ├── repl/ # REPL utilities
|
|
93
|
+
│ ├── sessions/ # Session persistence and management
|
|
796
94
|
│ ├── terminal/ # Terminal output formatting and rendering
|
|
797
95
|
│ ├── tui/ # Terminal User Interface components
|
|
798
96
|
│ ├── tools/ # AI-callable tools (filesystem, git, web, bash, etc.)
|
|
799
97
|
│ ├── tokens/ # Token counting and tracking
|
|
800
98
|
│ └── utils/ # Utility functions
|
|
801
99
|
├── test/ # Unit tests
|
|
100
|
+
├── docs/ # Additional documentation
|
|
802
101
|
├── ARCHITECTURE.md # Detailed architectural overview and flow diagrams
|
|
803
|
-
├──
|
|
804
|
-
|
|
805
|
-
├── package.json # Project metadata, dependencies, and scripts
|
|
806
|
-
└── README.md # This file
|
|
102
|
+
├── CONTRIBUTING.md # Development setup and guidelines
|
|
103
|
+
└── AGENTS.md # Project-specific AI rules and guidelines
|
|
807
104
|
```
|
|
808
105
|
|
|
809
|
-
|
|
106
|
+
## Documentation
|
|
810
107
|
|
|
811
|
-
|
|
108
|
+
- [Usage Guide](docs/usage.md) - Commands, keyboard shortcuts, piped input, and prompt syntax
|
|
109
|
+
- [Configuration](docs/configuration.md) - Environment variables, project and global settings
|
|
110
|
+
- [Skills System](docs/skills.md) - Creating and using specialized instruction files
|
|
111
|
+
- [Dynamic Tools](docs/dynamic-tools.md) - Creating custom tools to extend acai
|
|
112
|
+
- [Architecture](ARCHITECTURE.md) - Internal architecture and flow diagrams
|
|
113
|
+
- [Contributing](CONTRIBUTING.md) - Development setup, scripts, and code style
|
|
812
114
|
|
|
813
|
-
|
|
814
|
-
* **[AGENTS.md](AGENTS.md):** Contains specific rules and guidelines for the AI agent's behavior within this project.
|
|
815
|
-
* **In-app `/help` command:** Use `/help` within the Acai REPL for a list of available commands and their usage.
|
|
816
|
-
* **`source/commands/` directory:** Review the TypeScript files in this directory to understand how each REPL command is implemented.
|
|
817
|
-
* **`source/tools/` directory:** Explore the available tools that the AI can leverage.
|
|
818
|
-
|
|
819
|
-
## 🤝 Contributing
|
|
820
|
-
|
|
821
|
-
We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) (if it exists, otherwise remove this line) for guidelines on how to contribute.
|
|
822
|
-
|
|
823
|
-
## 📄 License
|
|
115
|
+
## License
|
|
824
116
|
|
|
825
117
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
826
|
-
|
|
827
|
-
## 📞 Contact
|
|
828
|
-
|
|
829
|
-
For questions or feedback, please open an issue on the GitHub repository.
|
|
830
|
-
```
|