@kolisachint/hoocode-agent 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +1 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +4 -4
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -5
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -3
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +28 -1
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/extensions/core/hoo-core.d.ts.map +1 -1
- package/dist/extensions/core/hoo-core.js +50 -4
- package/dist/extensions/core/hoo-core.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +4 -3
- package/dist/init.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts +2 -2
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +2 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +12 -9
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/docs/compaction.md +9 -9
- package/docs/custom-provider.md +4 -4
- package/docs/development.md +6 -6
- package/docs/extensions.md +21 -21
- package/docs/index.md +9 -9
- package/docs/json.md +3 -3
- package/docs/keybindings.md +5 -5
- package/docs/models.md +6 -6
- package/docs/packages.md +37 -37
- package/docs/prompt-templates.md +4 -4
- package/docs/providers.md +12 -44
- package/docs/quickstart.md +28 -28
- package/docs/rpc.md +10 -10
- package/docs/sdk.md +13 -13
- package/docs/session-format.md +7 -7
- package/docs/sessions.md +11 -11
- package/docs/settings.md +14 -14
- package/docs/shell-aliases.md +2 -2
- package/docs/skills.md +10 -10
- package/docs/terminal-setup.md +7 -7
- package/docs/termux.md +6 -6
- package/docs/themes.md +9 -9
- package/docs/tmux.md +3 -3
- package/docs/tui.md +3 -3
- package/docs/usage.md +47 -47
- package/docs/windows.md +2 -2
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +5 -5
- package/examples/extensions/claude-rules.ts +1 -1
- package/examples/extensions/commands.ts +1 -1
- package/examples/extensions/custom-header.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/doom-overlay/README.md +3 -3
- package/examples/extensions/pirate.ts +1 -1
- package/examples/extensions/preset.ts +4 -4
- package/examples/extensions/prompt-customizer.ts +1 -1
- package/examples/extensions/sandbox/index.ts +3 -3
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/README.md +13 -13
- package/examples/extensions/subagent/agents.ts +1 -1
- package/examples/extensions/subagent/index.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/examples/sdk/README.md +2 -2
- package/package.json +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/with-deps/package-lock.json +0 -31
package/docs/packages.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
>
|
|
1
|
+
> hoocode can help you create hoocode packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# HooCode Packages
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
HooCode packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `pi` key, or use conventional directories.
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
9
9
|
- [Install and Manage](#install-and-manage)
|
|
10
10
|
- [Package Sources](#package-sources)
|
|
11
|
-
- [Creating a
|
|
11
|
+
- [Creating a HooCode Package](#creating-a-hoocode-package)
|
|
12
12
|
- [Package Structure](#package-structure)
|
|
13
13
|
- [Dependencies](#dependencies)
|
|
14
14
|
- [Package Filtering](#package-filtering)
|
|
@@ -17,37 +17,37 @@ Pi packages bundle extensions, skills, prompt templates, and themes so you can s
|
|
|
17
17
|
|
|
18
18
|
## Install and Manage
|
|
19
19
|
|
|
20
|
-
> **Security:**
|
|
20
|
+
> **Security:** HooCode packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
hoocode install npm:@foo/bar@1.0.0
|
|
24
|
+
hoocode install git:github.com/user/repo@v1
|
|
25
|
+
hoocode install https://github.com/user/repo # raw URLs work too
|
|
26
|
+
hoocode install /absolute/path/to/package
|
|
27
|
+
hoocode install ./relative/path/to/package
|
|
28
|
+
|
|
29
|
+
hoocode remove npm:@foo/bar
|
|
30
|
+
hoocode list # show installed packages from settings
|
|
31
|
+
hoocode update # update hoocode and all non-pinned packages
|
|
32
|
+
hoocode update --extensions # update all non-pinned packages only
|
|
33
|
+
hoocode update --self # update hoocode only
|
|
34
|
+
hoocode update --self --force # reinstall hoocode even if current
|
|
35
|
+
hoocode update npm:@foo/bar # update one package
|
|
36
|
+
hoocode update --extension npm:@foo/bar
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
By default, `install` and `remove` write to global settings (`~/.
|
|
39
|
+
By default, `install` and `remove` write to global settings (`~/.hoocode/agent/settings.json`). Use `-l` to write to project settings (`.hoocode/settings.json`) instead. Project settings can be shared with your team, and hoocode installs any missing packages automatically on startup.
|
|
40
40
|
|
|
41
41
|
To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
hoocode -e npm:@foo/bar
|
|
45
|
+
hoocode -e git:github.com/user/repo
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Package Sources
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
HooCode accepts three source types in settings and `hoocode install`.
|
|
51
51
|
|
|
52
52
|
### npm
|
|
53
53
|
|
|
@@ -56,9 +56,9 @@ npm:@scope/pkg@1.2.3
|
|
|
56
56
|
npm:pkg
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
- Versioned specs are pinned and skipped by package updates (`
|
|
59
|
+
- Versioned specs are pinned and skipped by package updates (`hoocode update`, `hoocode update --extensions`).
|
|
60
60
|
- Global installs use `npm install -g`.
|
|
61
|
-
- Project installs go under `.
|
|
61
|
+
- Project installs go under `.hoocode/npm/`.
|
|
62
62
|
- Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
|
|
63
63
|
|
|
64
64
|
Example:
|
|
@@ -83,20 +83,20 @@ ssh://git@github.com/user/repo@v1
|
|
|
83
83
|
- HTTPS and SSH URLs are both supported.
|
|
84
84
|
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
|
85
85
|
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
|
|
86
|
-
- Refs pin the package and skip package updates (`
|
|
87
|
-
- Cloned to `~/.
|
|
86
|
+
- Refs pin the package and skip package updates (`hoocode update`, `hoocode update --extensions`).
|
|
87
|
+
- Cloned to `~/.hoocode/agent/git/<host>/<path>` (global) or `.hoocode/git/<host>/<path>` (project).
|
|
88
88
|
- Runs `npm install` after clone or pull if `package.json` exists.
|
|
89
89
|
|
|
90
90
|
**SSH examples:**
|
|
91
91
|
```bash
|
|
92
92
|
# git@host:path shorthand (requires git: prefix)
|
|
93
|
-
|
|
93
|
+
hoocode install git:git@github.com:user/repo
|
|
94
94
|
|
|
95
95
|
# ssh:// protocol format
|
|
96
|
-
|
|
96
|
+
hoocode install ssh://git@github.com/user/repo
|
|
97
97
|
|
|
98
98
|
# With version ref
|
|
99
|
-
|
|
99
|
+
hoocode install git:git@github.com:user/repo@v1.0.0
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
### Local Paths
|
|
@@ -106,9 +106,9 @@ pi install git:git@github.com:user/repo@v1.0.0
|
|
|
106
106
|
./relative/path/to/package
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory,
|
|
109
|
+
Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, hoocode loads resources using package rules.
|
|
110
110
|
|
|
111
|
-
## Creating a
|
|
111
|
+
## Creating a HooCode Package
|
|
112
112
|
|
|
113
113
|
Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
|
|
114
114
|
|
|
@@ -129,7 +129,7 @@ Paths are relative to the package root. Arrays support glob patterns and `!exclu
|
|
|
129
129
|
|
|
130
130
|
### Gallery Metadata
|
|
131
131
|
|
|
132
|
-
The [package gallery](https://
|
|
132
|
+
The [package gallery](https://hoocode.dev/packages) displays packages tagged with `pi-package`. Add `video` or `image` fields to show a preview:
|
|
133
133
|
|
|
134
134
|
```json
|
|
135
135
|
{
|
|
@@ -152,7 +152,7 @@ If both are set, video takes precedence.
|
|
|
152
152
|
|
|
153
153
|
### Convention Directories
|
|
154
154
|
|
|
155
|
-
If no `pi` manifest is present,
|
|
155
|
+
If no `pi` manifest is present, hoocode auto-discovers resources from these directories:
|
|
156
156
|
|
|
157
157
|
- `extensions/` loads `.ts` and `.js` files
|
|
158
158
|
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
|
|
@@ -161,11 +161,11 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
|
|
|
161
161
|
|
|
162
162
|
## Dependencies
|
|
163
163
|
|
|
164
|
-
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When
|
|
164
|
+
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When hoocode installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
|
165
165
|
|
|
166
166
|
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@kolisachint/hoocode-ai`, `@kolisachint/hoocode-agent-core`, `@kolisachint/hoocode-agent`, `@kolisachint/hoocode-tui`, `typebox`.
|
|
167
167
|
|
|
168
|
-
Other
|
|
168
|
+
Other hoocode packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. HooCode loads packages with separate module roots, so separate installs do not collide or share modules.
|
|
169
169
|
|
|
170
170
|
Example:
|
|
171
171
|
|
|
@@ -212,7 +212,7 @@ Filter what a package loads using the object form in settings:
|
|
|
212
212
|
|
|
213
213
|
## Enable and Disable Resources
|
|
214
214
|
|
|
215
|
-
Use `
|
|
215
|
+
Use `hoocode config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.hoocode/agent`) and project (`.hoocode/`) scopes.
|
|
216
216
|
|
|
217
217
|
## Scope and Deduplication
|
|
218
218
|
|
package/docs/prompt-templates.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
>
|
|
1
|
+
> hoocode can create prompt templates. Ask it to build one for your workflow.
|
|
2
2
|
|
|
3
3
|
# Prompt Templates
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ Prompt templates are Markdown snippets that expand into full prompts. Type `/nam
|
|
|
6
6
|
|
|
7
7
|
## Locations
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
HooCode loads prompt templates from:
|
|
10
10
|
|
|
11
|
-
- Global: `~/.
|
|
12
|
-
- Project: `.
|
|
11
|
+
- Global: `~/.hoocode/agent/prompts/*.md`
|
|
12
|
+
- Project: `.hoocode/prompts/*.md`
|
|
13
13
|
- Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
|
|
14
14
|
- Settings: `prompts` array with files or directories
|
|
15
15
|
- CLI: `--prompt-template <path>` (repeatable)
|
package/docs/providers.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Providers
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
HooCode supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, hoocode knows all available models. The list is updated with every hoocode release.
|
|
4
4
|
|
|
5
5
|
## Table of Contents
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ Use `/login` in interactive mode, then select a provider:
|
|
|
19
19
|
- Claude Pro/Max
|
|
20
20
|
- GitHub Copilot
|
|
21
21
|
|
|
22
|
-
Use `/logout` to clear credentials. Tokens are stored in `~/.
|
|
22
|
+
Use `/logout` to clear credentials. Tokens are stored in `~/.hoocode/agent/auth.json` and auto-refresh when expired.
|
|
23
23
|
|
|
24
24
|
### OpenAI Codex
|
|
25
25
|
|
|
@@ -43,44 +43,12 @@ Use `/login` in interactive mode and select a provider to store an API key in `a
|
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
46
|
-
|
|
46
|
+
hoocode
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
53
|
-
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
54
|
-
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
|
|
55
|
-
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
56
|
-
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
57
|
-
| Groq | `GROQ_API_KEY` | `groq` |
|
|
58
|
-
| Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
|
|
59
|
-
| Cloudflare AI Gateway | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_GATEWAY_ID`) | `cloudflare-ai-gateway` |
|
|
60
|
-
| Cloudflare Workers AI | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`) | `cloudflare-workers-ai` |
|
|
61
|
-
| xAI | `XAI_API_KEY` | `xai` |
|
|
62
|
-
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
63
|
-
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
64
|
-
| ZAI | `ZAI_API_KEY` | `zai` |
|
|
65
|
-
| OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
|
|
66
|
-
| OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
|
|
67
|
-
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
68
|
-
| Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
|
|
69
|
-
| Together AI | `TOGETHER_API_KEY` | `together` |
|
|
70
|
-
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
|
71
|
-
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
72
|
-
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
73
|
-
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
|
|
74
|
-
| Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
|
|
75
|
-
| Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
|
|
76
|
-
| Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
|
|
77
|
-
| NVIDIA | `NVIDIA_API_KEY` | `nvidia` |
|
|
78
|
-
|
|
79
|
-
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/kolisachint/hoocode/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/kolisachint/hoocode/blob/main/packages/ai/src/env-api-keys.ts).
|
|
80
|
-
|
|
81
|
-
#### Auth File
|
|
82
|
-
|
|
83
|
-
Store credentials in `~/.pi/agent/auth.json`:
|
|
49
|
+
### Auth File
|
|
50
|
+
|
|
51
|
+
Store credentials in `~/.hoocode/agent/auth.json`:
|
|
84
52
|
|
|
85
53
|
```json
|
|
86
54
|
{
|
|
@@ -158,14 +126,14 @@ export AWS_REGION=us-west-2
|
|
|
158
126
|
Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
|
|
159
127
|
|
|
160
128
|
```bash
|
|
161
|
-
|
|
129
|
+
hoocode --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
|
|
162
130
|
```
|
|
163
131
|
|
|
164
132
|
Prompt caching is enabled automatically for Claude models whose ID contains a recognizable model name (base models and system-defined inference profiles). For application inference profiles (whose ARNs don't contain the model name), set `AWS_BEDROCK_FORCE_CACHE=1` to enable cache points:
|
|
165
133
|
|
|
166
134
|
```bash
|
|
167
135
|
export AWS_BEDROCK_FORCE_CACHE=1
|
|
168
|
-
|
|
136
|
+
hoocode --provider amazon-bedrock --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123
|
|
169
137
|
```
|
|
170
138
|
|
|
171
139
|
If you are connecting to a Bedrock API proxy, the following environment variables can be used:
|
|
@@ -189,7 +157,7 @@ export AWS_BEDROCK_FORCE_HTTP1=1
|
|
|
189
157
|
export CLOUDFLARE_API_KEY=... # or use /login
|
|
190
158
|
export CLOUDFLARE_ACCOUNT_ID=...
|
|
191
159
|
export CLOUDFLARE_GATEWAY_ID=... # create at dash.cloudflare.com → AI → AI Gateway
|
|
192
|
-
|
|
160
|
+
hoocode --provider cloudflare-ai-gateway --model "claude-sonnet-4-5"
|
|
193
161
|
```
|
|
194
162
|
|
|
195
163
|
Routes to OpenAI, Anthropic, and Workers AI through Cloudflare AI Gateway. Workers AI uses the Unified API (`/compat`) and prefixed model IDs (`workers-ai/@cf/...`). OpenAI uses the OpenAI passthrough route (`/openai`) with native OpenAI model IDs such as `gpt-5.1`. Anthropic uses the Anthropic passthrough route (`/anthropic`) with native Anthropic model IDs such as `claude-sonnet-4-5`.
|
|
@@ -203,7 +171,7 @@ AI Gateway authentication uses `CLOUDFLARE_API_KEY` as `cf-aig-authorization`. U
|
|
|
203
171
|
| Stored BYOK | Cloudflare token only | Cloudflare injects provider keys stored in the AI Gateway dashboard |
|
|
204
172
|
| Inline BYOK | Cloudflare token plus upstream `Authorization` header | The request supplies the upstream provider key |
|
|
205
173
|
|
|
206
|
-
For normal
|
|
174
|
+
For normal hoocode usage, prefer unified billing or stored BYOK. Inline BYOK requires configuring an additional upstream `Authorization` header for the Cloudflare AI Gateway provider, for example via a `models.json` provider/model override.
|
|
207
175
|
|
|
208
176
|
### Cloudflare Workers AI
|
|
209
177
|
|
|
@@ -212,10 +180,10 @@ For normal pi usage, prefer unified billing or stored BYOK. Inline BYOK requires
|
|
|
212
180
|
```bash
|
|
213
181
|
export CLOUDFLARE_API_KEY=... # or use /login
|
|
214
182
|
export CLOUDFLARE_ACCOUNT_ID=...
|
|
215
|
-
|
|
183
|
+
hoocode --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
|
|
216
184
|
```
|
|
217
185
|
|
|
218
|
-
|
|
186
|
+
HooCode automatically sets `x-session-affinity` for [prefix caching](https://developers.cloudflare.com/workers-ai/features/prompt-caching/) discounts.
|
|
219
187
|
|
|
220
188
|
### Google Vertex AI
|
|
221
189
|
|
package/docs/quickstart.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
This page gets you from install to a useful first
|
|
3
|
+
This page gets you from install to a useful first hoocode session.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
HooCode is distributed as an npm package:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g @kolisachint/hoocode-agent
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Then start
|
|
13
|
+
Then start hoocode in the project directory you want it to work on:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
cd /path/to/project
|
|
17
|
-
|
|
17
|
+
hoocode
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Authenticate
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
HooCode can use subscription providers through `/login`, or API-key providers through environment variables or the auth file.
|
|
23
23
|
|
|
24
24
|
### Option 1: subscription login
|
|
25
25
|
|
|
26
|
-
Start
|
|
26
|
+
Start hoocode and run:
|
|
27
27
|
|
|
28
28
|
```text
|
|
29
29
|
/login
|
|
@@ -33,37 +33,37 @@ Then select a provider. Built-in subscription logins include Claude Pro/Max, Cha
|
|
|
33
33
|
|
|
34
34
|
### Option 2: API key
|
|
35
35
|
|
|
36
|
-
Set an API key before launching
|
|
36
|
+
Set an API key before launching hoocode:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
40
|
-
|
|
40
|
+
hoocode
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
You can also run `/login` and select an API-key provider to store the key in `~/.
|
|
43
|
+
You can also run `/login` and select an API-key provider to store the key in `~/.hoocode/agent/auth.json`.
|
|
44
44
|
|
|
45
45
|
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
46
46
|
|
|
47
47
|
## First session
|
|
48
48
|
|
|
49
|
-
Once
|
|
49
|
+
Once hoocode starts, type a request and press Enter:
|
|
50
50
|
|
|
51
51
|
```text
|
|
52
52
|
Summarize this repository and tell me how to run its checks.
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
By default,
|
|
55
|
+
By default, hoocode gives the model four tools:
|
|
56
56
|
|
|
57
57
|
- `read` - read files
|
|
58
58
|
- `write` - create or overwrite files
|
|
59
59
|
- `edit` - patch files
|
|
60
60
|
- `bash` - run shell commands
|
|
61
61
|
|
|
62
|
-
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options.
|
|
62
|
+
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options. HooCode runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
|
|
63
63
|
|
|
64
|
-
## Give
|
|
64
|
+
## Give hoocode project instructions
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
HooCode loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
67
67
|
|
|
68
68
|
```markdown
|
|
69
69
|
# Project Instructions
|
|
@@ -73,12 +73,12 @@ Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to wor
|
|
|
73
73
|
- Keep responses concise.
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
HooCode loads:
|
|
77
77
|
|
|
78
|
-
- `~/.
|
|
78
|
+
- `~/.hoocode/agent/AGENTS.md` for global instructions
|
|
79
79
|
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
80
80
|
|
|
81
|
-
Restart
|
|
81
|
+
Restart hoocode, or run `/reload`, after changing context files.
|
|
82
82
|
|
|
83
83
|
## Common things to try
|
|
84
84
|
|
|
@@ -87,8 +87,8 @@ Restart pi, or run `/reload`, after changing context files.
|
|
|
87
87
|
Type `@` in the editor to fuzzy-search files, or pass files on the command line:
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
hoocode @README.md "Summarize this"
|
|
91
|
+
hoocode @src/app.ts @src/app.test.ts "Review these together"
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
|
|
@@ -112,31 +112,31 @@ Use `/model` or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level.
|
|
|
112
112
|
Sessions are saved automatically:
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
hoocode -c # Continue most recent session
|
|
116
|
+
hoocode -r # Browse previous sessions
|
|
117
|
+
hoocode --session <path|id> # Open a specific session
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Inside
|
|
120
|
+
Inside hoocode, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
121
121
|
|
|
122
122
|
### Non-interactive mode
|
|
123
123
|
|
|
124
124
|
For one-shot prompts:
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
|
-
|
|
128
|
-
cat README.md |
|
|
129
|
-
|
|
127
|
+
hoocode -p "Summarize this codebase"
|
|
128
|
+
cat README.md | hoocode -p "Summarize this text"
|
|
129
|
+
hoocode -p @screenshot.png "What's in this image?"
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
Use `--mode json` for JSON event output or `--mode rpc` for process integration.
|
|
133
133
|
|
|
134
134
|
## Next steps
|
|
135
135
|
|
|
136
|
-
- [Using
|
|
136
|
+
- [Using HooCode](usage.md) - interactive mode, slash commands, sessions, context files, and CLI reference.
|
|
137
137
|
- [Providers](providers.md) - authentication and model setup.
|
|
138
138
|
- [Settings](settings.md) - global and project configuration.
|
|
139
139
|
- [Keybindings](keybindings.md) - shortcuts and customization.
|
|
140
|
-
- [
|
|
140
|
+
- [HooCode Packages](packages.md) - install shared extensions, skills, prompts, and themes.
|
|
141
141
|
|
|
142
142
|
Platform notes: [Windows](windows.md), [Termux](termux.md), [tmux](tmux.md), [Terminal setup](terminal-setup.md), [Shell aliases](shell-aliases.md).
|
package/docs/rpc.md
CHANGED
|
@@ -7,7 +7,7 @@ RPC mode enables headless operation of the coding agent via a JSON protocol over
|
|
|
7
7
|
## Starting RPC Mode
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
hoocode --mode rpc [options]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Common options:
|
|
@@ -455,7 +455,7 @@ If output was truncated, includes `fullOutputPath`:
|
|
|
455
455
|
"exitCode": 0,
|
|
456
456
|
"cancelled": false,
|
|
457
457
|
"truncated": true,
|
|
458
|
-
"fullOutputPath": "/tmp/
|
|
458
|
+
"fullOutputPath": "/tmp/hoocode-bash-abc123.log"
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
```
|
|
@@ -714,9 +714,9 @@ Response:
|
|
|
714
714
|
"success": true,
|
|
715
715
|
"data": {
|
|
716
716
|
"commands": [
|
|
717
|
-
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.
|
|
718
|
-
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.
|
|
719
|
-
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.
|
|
717
|
+
{"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.hoocode/agent/extensions/session.ts"},
|
|
718
|
+
{"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.hoocode/agent/prompts/fix-tests.md"},
|
|
719
|
+
{"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.hoocode/agent/skills/brave-search/SKILL.md"}
|
|
720
720
|
]
|
|
721
721
|
}
|
|
722
722
|
}
|
|
@@ -730,8 +730,8 @@ Each command has:
|
|
|
730
730
|
- `"prompt"`: Loaded from a prompt template `.md` file
|
|
731
731
|
- `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
|
|
732
732
|
- `location`: Where it was loaded from (optional, not present for extensions):
|
|
733
|
-
- `"user"`: User-level (`~/.
|
|
734
|
-
- `"project"`: Project-level (`./.
|
|
733
|
+
- `"user"`: User-level (`~/.hoocode/agent/`)
|
|
734
|
+
- `"project"`: Project-level (`./.hoocode/agent/`)
|
|
735
735
|
- `"path"`: Explicit path via CLI or settings
|
|
736
736
|
- `path`: Absolute file path to the command source (optional)
|
|
737
737
|
|
|
@@ -1132,7 +1132,7 @@ Set the terminal window/tab title. Fire-and-forget.
|
|
|
1132
1132
|
"type": "extension_ui_request",
|
|
1133
1133
|
"id": "uuid-8",
|
|
1134
1134
|
"method": "setTitle",
|
|
1135
|
-
"title": "
|
|
1135
|
+
"title": "hoocode - my project"
|
|
1136
1136
|
}
|
|
1137
1137
|
```
|
|
1138
1138
|
|
|
@@ -1319,7 +1319,7 @@ import subprocess
|
|
|
1319
1319
|
import json
|
|
1320
1320
|
|
|
1321
1321
|
proc = subprocess.Popen(
|
|
1322
|
-
["
|
|
1322
|
+
["hoocode", "--mode", "rpc", "--no-session"],
|
|
1323
1323
|
stdin=subprocess.PIPE,
|
|
1324
1324
|
stdout=subprocess.PIPE,
|
|
1325
1325
|
text=True
|
|
@@ -1358,7 +1358,7 @@ For a complete example of handling the extension UI protocol, see [`examples/rpc
|
|
|
1358
1358
|
const { spawn } = require("child_process");
|
|
1359
1359
|
const { StringDecoder } = require("string_decoder");
|
|
1360
1360
|
|
|
1361
|
-
const agent = spawn("
|
|
1361
|
+
const agent = spawn("hoocode", ["--mode", "rpc", "--no-session"]);
|
|
1362
1362
|
|
|
1363
1363
|
function attachJsonlReader(stream, onLine) {
|
|
1364
1364
|
const decoder = new StringDecoder("utf8");
|
package/docs/sdk.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
>
|
|
1
|
+
> hoocode can help you use the SDK. Ask it to build an integration for your use case.
|
|
2
2
|
|
|
3
3
|
# SDK
|
|
4
4
|
|
|
5
|
-
The SDK provides programmatic access to
|
|
5
|
+
The SDK provides programmatic access to hoocode's agent capabilities. Use it to embed hoocode in other applications, build custom interfaces, or integrate with automated workflows.
|
|
6
6
|
|
|
7
7
|
**Example use cases:**
|
|
8
8
|
- Build a custom UI (web, desktop, mobile)
|
|
@@ -338,23 +338,23 @@ const { session } = await createAgentSession({
|
|
|
338
338
|
cwd: process.cwd(), // default
|
|
339
339
|
|
|
340
340
|
// Global config directory
|
|
341
|
-
agentDir: "~/.
|
|
341
|
+
agentDir: "~/.hoocode/agent", // default (expands ~)
|
|
342
342
|
});
|
|
343
343
|
```
|
|
344
344
|
|
|
345
345
|
`cwd` is used by `DefaultResourceLoader` for:
|
|
346
|
-
- Project extensions (`.
|
|
346
|
+
- Project extensions (`.hoocode/extensions/`)
|
|
347
347
|
- Project skills:
|
|
348
|
-
- `.
|
|
348
|
+
- `.hoocode/skills/`
|
|
349
349
|
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
|
|
350
|
-
- Project prompts (`.
|
|
350
|
+
- Project prompts (`.hoocode/prompts/`)
|
|
351
351
|
- Context files (`AGENTS.md` walking up from cwd)
|
|
352
352
|
- Session directory naming
|
|
353
353
|
|
|
354
354
|
`agentDir` is used by `DefaultResourceLoader` for:
|
|
355
355
|
- Global extensions (`extensions/`)
|
|
356
356
|
- Global skills:
|
|
357
|
-
- `skills/` under `agentDir` (for example `~/.
|
|
357
|
+
- `skills/` under `agentDir` (for example `~/.hoocode/agent/skills/`)
|
|
358
358
|
- `~/.agents/skills/`
|
|
359
359
|
- Global prompts (`prompts/`)
|
|
360
360
|
- Global context file (`AGENTS.md`)
|
|
@@ -418,7 +418,7 @@ API key resolution priority (handled by AuthStorage):
|
|
|
418
418
|
```typescript
|
|
419
419
|
import { AuthStorage, ModelRegistry } from "@kolisachint/hoocode-agent";
|
|
420
420
|
|
|
421
|
-
// Default: uses ~/.
|
|
421
|
+
// Default: uses ~/.hoocode/agent/auth.json and ~/.hoocode/agent/models.json
|
|
422
422
|
const authStorage = AuthStorage.create();
|
|
423
423
|
const modelRegistry = ModelRegistry.create(authStorage);
|
|
424
424
|
|
|
@@ -518,7 +518,7 @@ const { session } = await createAgentSession({
|
|
|
518
518
|
```
|
|
519
519
|
|
|
520
520
|
**When you don't need factories:**
|
|
521
|
-
- If you omit `tools`,
|
|
521
|
+
- If you omit `tools`, hoocode automatically creates them with the correct `cwd`
|
|
522
522
|
- If you use `process.cwd()` as your `cwd`, the pre-built instances work fine
|
|
523
523
|
|
|
524
524
|
**When you must use factories:**
|
|
@@ -560,7 +560,7 @@ Custom tools passed via `customTools` are combined with extension-registered too
|
|
|
560
560
|
|
|
561
561
|
### Extensions
|
|
562
562
|
|
|
563
|
-
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.
|
|
563
|
+
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.hoocode/agent/extensions/`, `.hoocode/extensions/`, and settings.json extension sources.
|
|
564
564
|
|
|
565
565
|
```typescript
|
|
566
566
|
import { createAgentSession, DefaultResourceLoader } from "@kolisachint/hoocode-agent";
|
|
@@ -818,8 +818,8 @@ const { session } = await createAgentSession({
|
|
|
818
818
|
**Project-specific settings:**
|
|
819
819
|
|
|
820
820
|
Settings load from two locations and merge:
|
|
821
|
-
1. Global: `~/.
|
|
822
|
-
2. Project: `<cwd>/.
|
|
821
|
+
1. Global: `~/.hoocode/agent/settings.json`
|
|
822
|
+
2. Project: `<cwd>/.hoocode/settings.json`
|
|
823
823
|
|
|
824
824
|
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
|
|
825
825
|
|
|
@@ -1081,7 +1081,7 @@ See [RPC documentation](rpc.md) for the JSON protocol.
|
|
|
1081
1081
|
For subprocess-based integration without building with the SDK, use the CLI directly:
|
|
1082
1082
|
|
|
1083
1083
|
```bash
|
|
1084
|
-
|
|
1084
|
+
hoocode --mode rpc --no-session
|
|
1085
1085
|
```
|
|
1086
1086
|
|
|
1087
1087
|
See [RPC documentation](rpc.md) for the JSON protocol.
|
package/docs/session-format.md
CHANGED
|
@@ -5,16 +5,16 @@ Sessions are stored as JSONL (JSON Lines) files. Each line is a JSON object with
|
|
|
5
5
|
## File Location
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
~/.
|
|
8
|
+
~/.hoocode/agent/sessions/--<path>--/<timestamp>_<uuid>.jsonl
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Where `<path>` is the working directory with `/` replaced by `-`.
|
|
12
12
|
|
|
13
13
|
## Deleting Sessions
|
|
14
14
|
|
|
15
|
-
Sessions can be removed by deleting their `.jsonl` files under `~/.
|
|
15
|
+
Sessions can be removed by deleting their `.jsonl` files under `~/.hoocode/agent/sessions/`.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
HooCode also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, hoocode uses the `trash` CLI to avoid permanent deletion.
|
|
18
18
|
|
|
19
19
|
## Session Version
|
|
20
20
|
|
|
@@ -69,7 +69,7 @@ interface ToolCall {
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
### Base Message Types (from
|
|
72
|
+
### Base Message Types (from @kolisachint/hoocode-ai)
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
75
|
interface UserMessage {
|
|
@@ -116,7 +116,7 @@ interface Usage {
|
|
|
116
116
|
}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### Extended Message Types (from
|
|
119
|
+
### Extended Message Types (from @kolisachint/hoocode-agent)
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
interface BashExecutionMessage {
|
|
@@ -233,7 +233,7 @@ Created when context is compacted. Stores a summary of earlier messages.
|
|
|
233
233
|
|
|
234
234
|
Optional fields:
|
|
235
235
|
- `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
|
|
236
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
236
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if hoocode-generated (legacy field name)
|
|
237
237
|
|
|
238
238
|
### BranchSummaryEntry
|
|
239
239
|
|
|
@@ -245,7 +245,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
|
|
|
245
245
|
|
|
246
246
|
Optional fields:
|
|
247
247
|
- `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
|
|
248
|
-
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if
|
|
248
|
+
- `fromHook`: `true` if generated by an extension, `false`/`undefined` if hoocode-generated (legacy field name)
|
|
249
249
|
|
|
250
250
|
### CustomEntry
|
|
251
251
|
|