localclawd 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # localclawd
2
+
3
+ localclawd is a local-first fork of the upstream hosted coding CLI focused on self-hosted inference. It preserves the terminal-first coding loop, tool orchestration, agents, and computer-use workflow, while replacing the hosted model dependency with user-controlled backends such as vLLM, Ollama, and OpenAI-compatible gateways.
4
+
5
+ ## Overview
6
+
7
+ localclawd keeps the parts of the upstream CLI that were operationally strong and extends them for local deployment. The project is designed for users who want the same terminal-first workflow without depending on hosted Anthropic inference.
8
+
9
+ ### Key additions
10
+
11
+ - In-app backend setup for provider, endpoint, model, and optional API key during onboarding or later in `/config`.
12
+ - An OpenAI-compatible transport layer that maps internal assistant requests onto `/v1/chat/completions`.
13
+ - vLLM-first defaults, with Ollama and generic OpenAI-compatible endpoints supported as first-class backends.
14
+ - Backend diagnostics in `localclawd doctor`, including endpoint reachability, auth state, and last probe result.
15
+ - Compact-context controls for local models that degrade before their advertised context limit.
16
+ - Multimodal passthrough for local models that support image and screenshot input.
17
+ - **Lattice memory scoring** — memory files tagged with `tags:` frontmatter are ranked using Jaccard similarity and co-occurrence lattice math. Works offline as a fallback when a hosted side-query model is unavailable.
18
+ - **`/keepgoing`** — autonomous task continuation. Type `/keepgoing` to instruct the model to work through all outstanding steps without waiting for user input. The model signals completion with `TASK COMPLETE:` or blocks with `NEEDS INPUT:`. Aliases: `/kg`, `/continue`.
19
+
20
+ ## Installation
21
+
22
+ The bootstrap installers use a release-first strategy. They attempt to install a platform-native binary from GitHub Releases and fall back to a source checkout when no matching release asset is available yet.
23
+
24
+ ### npm
25
+
26
+ Global install:
27
+
28
+ ```bash
29
+ npm install -g localclawd
30
+ ```
31
+
32
+ Run without installing globally:
33
+
34
+ ```bash
35
+ npx localclawd --version
36
+ ```
37
+
38
+ The npm package name is lowercase: `localclawd`. Any mixed-case install attempt will fail because npm package names cannot contain capital letters. The published CLI command is also `localclawd`.
39
+
40
+ ### Windows
41
+
42
+ One-line install in PowerShell:
43
+
44
+ ```powershell
45
+ irm https://raw.githubusercontent.com/chromebookwiz/localclawd/main/tools/bootstrap-localclawd.ps1 | iex
46
+ ```
47
+
48
+ This is the primary Windows install command. It installs Bun automatically when needed, runs `bun install` for the source fallback checkout, and then adds the `localclawd` launcher to your user path.
49
+
50
+ Do not use the Linux/macOS `bootstrap-localclawd.sh` command from PowerShell. PowerShell aliases `curl` to `Invoke-WebRequest`, so the Unix `curl -fsSL ... | bash` form will fail there.
51
+
52
+ PowerShell-native equivalent:
53
+
54
+ ```powershell
55
+ powershell -NoProfile -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/chromebookwiz/localclawd/main/tools/bootstrap-localclawd.ps1').Content))"
56
+ ```
57
+
58
+ From an existing checkout:
59
+
60
+ ```powershell
61
+ powershell -ExecutionPolicy Bypass -File .\tools\install-localclawd.ps1
62
+ ```
63
+
64
+ The Windows bootstrap installer first looks for a matching GitHub Release binary. If no release asset is available, it downloads the repository source bundle, installs Bun automatically if needed, runs `bun install`, and creates a source-checkout launcher.
65
+
66
+ Default Windows paths:
67
+
68
+ - Native binary install: `%USERPROFILE%\.local\bin\localclawd.exe`
69
+ - Source fallback checkout: `%USERPROFILE%\.localclawd\source`
70
+ - Source fallback launcher: `%USERPROFILE%\.local\bin\localclawd.cmd`
71
+
72
+ ### Linux
73
+
74
+ One-line install in a Unix shell such as `bash` or `zsh`:
75
+
76
+ ```bash
77
+ curl -fsSL https://raw.githubusercontent.com/chromebookwiz/localclawd/main/tools/bootstrap-localclawd.sh | bash
78
+ ```
79
+
80
+ This command is for Linux shells only. If you are on Windows PowerShell, use the Windows command above instead.
81
+
82
+ From an existing checkout:
83
+
84
+ ```bash
85
+ bash ./tools/install-localclawd.sh
86
+ ```
87
+
88
+ The Unix bootstrap installer first looks for a matching GitHub Release binary. If no release asset is available, it downloads the source bundle, installs Bun if needed, writes the source-checkout launcher to `~/.local/bin/localclawd`, and updates common shell startup files so that directory is on your `PATH`.
89
+
90
+ Default Linux paths:
91
+
92
+ - Native binary install: `~/.local/bin/localclawd`
93
+ - Source fallback checkout: `~/.localclawd/source`
94
+ - Source fallback launcher: `~/.local/bin/localclawd`
95
+
96
+ ### macOS
97
+
98
+ One-line install in Terminal, iTerm, or another Unix shell:
99
+
100
+ ```bash
101
+ curl -fsSL https://raw.githubusercontent.com/chromebookwiz/localclawd/main/tools/bootstrap-localclawd.sh | bash
102
+ ```
103
+
104
+ This command is for macOS shells only. If you are on Windows PowerShell, use the Windows command above instead.
105
+
106
+ From an existing checkout:
107
+
108
+ ```bash
109
+ bash ./tools/install-localclawd.sh
110
+ ```
111
+
112
+ The macOS flow matches Linux: the bootstrap installer prefers a release binary and falls back to the source-checkout launcher when no release asset is available.
113
+
114
+ Default macOS paths:
115
+
116
+ - Native binary install: `~/.local/bin/localclawd`
117
+ - Source fallback checkout: `~/.localclawd/source`
118
+ - Source fallback launcher: `~/.local/bin/localclawd`
119
+
120
+ ### Release asset naming
121
+
122
+ The bootstrap scripts expect release assets to follow the native installer platform naming already used in the codebase:
123
+
124
+ - `localclawd-win32-x64.exe`
125
+ - `localclawd-win32-arm64.exe`
126
+ - `localclawd-linux-x64`
127
+ - `localclawd-linux-arm64`
128
+ - `localclawd-darwin-x64`
129
+ - `localclawd-darwin-arm64`
130
+
131
+ ### Backend setup after install
132
+
133
+ localclawd accepts native environment variable names. Legacy `CLAUDE_CODE_*` names are still accepted as compatibility aliases, but new setups should prefer `LOCALCLAWD_*`.
134
+
135
+ Most users should configure the backend during first-run onboarding or later in `/config`. Environment variables still work when you want non-interactive setup, shell-specific overrides, or CI automation.
136
+
137
+ For vLLM:
138
+
139
+ ```powershell
140
+ $env:LOCALCLAWD_USE_VLLM = '1'
141
+ $env:LOCALCLAWD_LOCAL_BASE_URL = 'http://127.0.0.1:8000/v1'
142
+ $env:LOCALCLAWD_LOCAL_MODEL = 'qwen2.5-coder-32b-instruct'
143
+ ```
144
+
145
+ For Ollama:
146
+
147
+ ```powershell
148
+ $env:LOCALCLAWD_USE_OLLAMA = '1'
149
+ $env:LOCALCLAWD_LOCAL_BASE_URL = 'http://127.0.0.1:11434/v1'
150
+ $env:LOCALCLAWD_LOCAL_MODEL = 'qwen2.5-coder:32b'
151
+ ```
152
+
153
+ Optional:
154
+
155
+ ```powershell
156
+ $env:LOCALCLAWD_LOCAL_API_KEY = 'anything'
157
+ ```
158
+
159
+ Then run:
160
+
161
+ ```powershell
162
+ localclawd
163
+ ```
164
+
165
+ ## Release status
166
+
167
+ `v1.0.0` is currently a source-first release. The repository contains the source code, bootstrap installers, and Bun-based fallback launcher needed to publish and run localclawd from GitHub today. Native multi-platform binaries can be added later without changing the install surface.
168
+
169
+ External native update metadata is now expected under `release-manifests/`, the main verification workflow lives in `.github/workflows/ci.yml`, and the native asset publication workflow lives in `.github/workflows/publish-release-assets.yml`. See `docs/release.md` for the expected asset set and publish sequence.
170
+
171
+ ### Native install
172
+
173
+ If you already have a runnable `localclawd` executable, install it natively with:
174
+
175
+ ```powershell
176
+ localclawd install
177
+ ```
178
+
179
+ That installs the stable launcher to:
180
+
181
+ - Unix-like systems: `~/.local/bin/localclawd`
182
+ - Windows: `%USERPROFILE%\.local\bin\localclawd.exe`
183
+
184
+ After installation, verify the CLI is on your path:
185
+
186
+ ```powershell
187
+ localclawd --version
188
+ localclawd doctor
189
+ ```
190
+
191
+ To update an existing native install:
192
+
193
+ ```powershell
194
+ localclawd update
195
+ ```
196
+
197
+ ### Power tools
198
+
199
+ - `tools\bootstrap-localclawd.ps1` installs a Windows release binary when one exists and otherwise falls back to the source-checkout installer.
200
+ - `tools/bootstrap-localclawd.sh` installs a Unix release binary when one exists and otherwise falls back to the source-checkout installer.
201
+ - `tools\install-localclawd.ps1` creates a Bun-based launcher for a checked-out repository on Windows.
202
+ - `tools/install-localclawd.sh` creates a Bun-based launcher for a checked-out repository on Unix-like systems.
203
+ - `tools\rebrand-localclawd.ps1` performs broad rebranding replacements across the repository.
204
+ - `tools\localclawd-tools.ps1` wraps install, rebrand, and branding audit operations in one PowerShell entrypoint.
205
+
206
+ ### Backend environment variables
207
+
208
+ localclawd currently recognizes both native and legacy variable names for the local backend configuration. Prefer the native names below for new setups:
209
+
210
+ - `LOCALCLAWD_USE_SPARK`
211
+ - `LOCALCLAWD_USE_VLLM`
212
+ - `LOCALCLAWD_USE_OLLAMA`
213
+ - `LOCALCLAWD_USE_OPENAI`
214
+ - `LOCALCLAWD_LOCAL_BASE_URL`
215
+ - `LOCALCLAWD_LOCAL_MODEL`
216
+ - `LOCALCLAWD_LOCAL_API_KEY`
217
+ - `LOCALCLAWD_AUTO_COMPACT_WINDOW`
218
+
219
+ Legacy compatibility aliases that still work:
220
+
221
+ - `LOCALCLAWD_USE_SPARK` and `CLAUDE_CODE_USE_SPARK` are treated as vLLM aliases.
222
+ - `CLAUDE_CODE_USE_OPENAI` is accepted as a compatibility alias for `LOCALCLAWD_USE_OPENAI`.
223
+ - Existing legacy environment variable aliases from the upstream fork are still accepted.
224
+
225
+ ### Production checklist
226
+
227
+ For a production-style rollout of this fork:
228
+
229
+ 1. Build and publish platform binaries named according to the release asset convention listed above.
230
+ 2. Verify `localclawd install`, `localclawd update`, and `localclawd doctor` against those published artifacts.
231
+ 3. Keep `.github/workflows/ci.yml` green for `audit:branding`, `bun run build`, and `verify:npm-install` before tagging.
232
+ 4. Use `.github/workflows/publish-release-assets.yml` to publish native assets and manifests after the verification workflow is green.
233
+ 5. Keep the legacy environment-variable aliases enabled until downstream wrappers and scripts have migrated.
234
+
235
+ ## CLI install flow
236
+
237
+ The native install and update commands are exposed directly from the CLI for packaged builds:
238
+
239
+ ```powershell
240
+ localclawd install
241
+ localclawd update
242
+ localclawd doctor
243
+ ```
244
+
245
+ The native installer places the executable at `~/.local/bin/localclawd` on Unix-like systems and `%USERPROFILE%\.local\bin\localclawd.exe` on Windows.
246
+
247
+ ## Compact context window
248
+
249
+ During first-run setup, localclawd asks for a compact context window cap. Use this when your local model becomes unstable before its advertised maximum context size. You can change it later in `/config` under `Compact context window`.
250
+
251
+ ## Why use it instead of the upstream hosted CLI
252
+
253
+ - You can point the CLI at your own inference stack instead of a Claude-hosted backend.
254
+ - Backend configuration lives inside the app, not only in shell variables.
255
+ - `doctor` validates the configured local backend instead of only checking install state.
256
+ - vLLM, Ollama, and generic OpenAI-compatible gateways are all supported under the same terminal UX.
257
+ - Local models that need earlier summarization can be tuned with a compact-context cap during setup.
258
+
259
+ ## Backend notes
260
+
261
+ - Internal `/v1/messages` payloads are translated into OpenAI-compatible `/v1/chat/completions` requests.
262
+ - vLLM is the default OpenAI-compatible target for source installs.
263
+ - Tool calls are mapped to function-calling so agent loops remain intact.
264
+ - Token counting is estimated locally.
265
+ - Text, tool, and image workflows are translated for OpenAI-compatible backends.
266
+
267
+ ## Repository
268
+
269
+ Primary repository target: https://github.com/chromebookwiz/localclawd
package/bin/localclawd ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import '../dist/cli.mjs'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import('../dist/cli.mjs')
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import '../dist/cli.mjs'