Skip to content
This repository was archived by the owner on Jul 18, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ CLAUDE.md
package-lock.json
/.claude
coverage/
# npm pack output from deploy:pack / scripts/deploy-from-source.sh pack
gitlawb-openclaude-*.tgz
74 changes: 74 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "OpenClaude: smoke",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bun run smoke",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 All VS Code tasks reference non-existent scripts/cursor-dev-path.sh

Every task in .vscode/tasks.json invokes ${workspaceFolder}/scripts/cursor-dev-path.sh as its command prefix (lines 7, 21, 32, 43, 54, 65), but this script does not exist anywhere in the repository — not on any branch, not gitignored, and never committed. Running any of these tasks (smoke, unit tests, provider tests, runtime doctor, deploy pack, deploy link) will immediately fail with a "No such file or directory" error. The docs/deploy.md:14 documentation also references this script, compounding the issue.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "OpenClaude: unit tests",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bun test --max-concurrency=1",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "OpenClaude: provider tests",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bun run test:provider",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "OpenClaude: runtime doctor",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bun run doctor:runtime",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "OpenClaude: deploy pack",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bash scripts/deploy-from-source.sh pack",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "OpenClaude: deploy link",
"type": "shell",
"command": "${workspaceFolder}/scripts/cursor-dev-path.sh bash scripts/deploy-from-source.sh link",
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
]
}
Comment on lines +1 to +74

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Shipping .vscode/tasks.json violates AGENTS.md rule against editor-specific trees

AGENTS.md line 52 states: "This repository does not ship editor-only trees (for example .cursor/ or team-local MCP pins) on main. Keep personal or team agent configuration outside the repo or in your fork only, so the upstream tree stays neutral for all contributors." Adding .vscode/tasks.json — a VS Code/Cursor-specific configuration file — directly violates this mandatory rule. The .vscode/ directory is an editor-only tree analogous to the .cursor/ example cited in the rule.

Prompt for agents
The .vscode/tasks.json file violates AGENTS.md's explicit rule (line 52) that the repository does not ship editor-only trees on main. The file should be removed from the repository. If these tasks are useful for contributors, they could be documented in docs/deploy.md or docs/agent-workflow.md as copy-paste snippets, or kept in a contributor's personal fork. The .vscode/ directory should also be added to .gitignore to prevent future commits. The reference to these palette tasks in docs/deploy.md:14 would also need updating.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

2 changes: 2 additions & 0 deletions docs/advanced-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This guide is for users who want source builds, Bun workflows, provider profiles

## Install Options

See **[deploy.md](./deploy.md)** for a single index of registry install, `npm pack`, `npm link`, global install from a checkout, upstream CI publish, and fork-scoped npm.

### Option A: npm

```bash
Expand Down
95 changes: 95 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Deploy and install OpenClaude

This document covers every supported way to get **`openclaude`** onto a machine: from npm, from a source checkout, as a tarball, and how **upstream** publishes. Fork maintainers: see **Fork-scoped npm** at the end.

## Quick reference (`package.json`)

| Script | Equivalent shell |
|--------|-------------------|
| `bun run deploy:registry` | `bash scripts/deploy-from-source.sh registry` |
| `bun run deploy:install-global` | `bash scripts/deploy-from-source.sh global` |
| `bun run deploy:link` | `bash scripts/deploy-from-source.sh link` |
| `bun run deploy:pack` | `bash scripts/deploy-from-source.sh pack` |

Comment on lines +5 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

deploy:* commands appear undocumented in package.json and may fail at runtime.

Line 5 onward documents bun run deploy:registry|deploy:install-global|deploy:link|deploy:pack, but the provided package.json snippet does not include these script keys. If that reflects current code, these commands will fail with “Missing script” and the doc’s primary flows break.

Proposed fix
# package.json (scripts)
{
  "scripts": {
+   "deploy:pack": "bash scripts/deploy-from-source.sh pack",
+   "deploy:link": "bash scripts/deploy-from-source.sh link",
+   "deploy:install-global": "bash scripts/deploy-from-source.sh global",
+   "deploy:registry": "bash scripts/deploy-from-source.sh registry"
  }
}
# docs/deploy.md (if scripts are intentionally omitted)
- | `bun run deploy:registry` | `bash scripts/deploy-from-source.sh registry` |
+ | `npm run deploy:registry` | `bash scripts/deploy-from-source.sh registry` |
# (or remove the bun-run wrapper rows entirely and keep only shell commands)

Also applies to: 25-30, 39-41, 51-53, 61-63

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/deploy.md` around lines 5 - 13, The docs list package.json scripts
deploy:registry, deploy:install-global, deploy:link, and deploy:pack that don't
exist; either add those script entries to package.json (e.g., "deploy:registry",
"deploy:install-global", "deploy:link", "deploy:pack" mapping to the shell
commands used in the docs) or change the docs to reference the actual existing
script names; update every occurrence of those script symbols in the doc (the
four deploy:* script mentions at lines noted) so the documented commands match
the real package.json scripts and won't produce "Missing script" errors at
runtime.

Run `bash scripts/deploy-from-source.sh help` for the same usage text. Palette tasks **OpenClaude: deploy pack** / **OpenClaude: deploy link** live in `.vscode/tasks.json` (PATH via `cursor-dev-path.sh`).

## 1. Install from npm (recommended for users)

Uses the package published by maintainers (`@gitlawb/openclaude`).

```bash
npm install -g @gitlawb/openclaude@latest
openclaude --version
```

From the repo you can run the same via:

```bash
bun run deploy:registry
# equivalent: bash scripts/deploy-from-source.sh registry
```

## 2. Global install from a git checkout

After cloning, install dependencies, build the bundle, then install globally from the current directory.

```bash
cd openclaude
bun install --frozen-lockfile
bun run deploy:install-global
# equivalent: bash scripts/deploy-from-source.sh global
```

Requires **Bun** and **npm**. This installs whatever **`version`** is set to in **`package.json`** at install time.

## 3. Development link (`npm link`)

Keeps `openclaude` pointing at your working tree (good for active development).

```bash
bun install --frozen-lockfile
bun run deploy:link
# equivalent: bash scripts/deploy-from-source.sh link
```

## 4. Pack a tarball (CI, air-gapped, or manual install)

`npm pack` runs **`prepack`** → **`npm run build`**, so you get a built tarball without a separate build step.

```bash
bun install --frozen-lockfile
bun run deploy:pack
# equivalent: bash scripts/deploy-from-source.sh pack
```

Install elsewhere (use the **exact** `.tgz` name printed by `npm pack`, or a glob that resolves to one file):

```bash
npm install -g ./gitlawb-openclaude-<version>.tgz
# e.g. ./gitlawb-openclaude-0.5.2.tgz — the middle segment matches package.json "version"
```

## 5. Upstream automated release (GitHub + npm + GHCR)

On **`Gitlawb/openclaude`** only, pushing to **`main`** runs **Release Please**. When it opens and merges a release PR and creates a tag, CI publishes:

- **`npm publish`** for `@gitlawb/openclaude` (with provenance)
- **Docker** image to `ghcr.io/gitlawb/openclaude`

Forks (`github.repository != 'Gitlawb/openclaude'`) do **not** run that workflow gate—see `.github/workflows/release.yml` `if:` conditions.

## 6. Fork-scoped npm package (optional)

To publish **your fork** under your own scope (example: `@myuser/openclaude`):

1. Change **`package.json`** field **`name`** to your scope (and update **`bin`** / docs references if you rename the CLI—non-trivial).
2. Ensure **`publishConfig.access`** matches your registry policy.
3. `npm login` and **`npm publish --access public`** from a clean **`bun run build`** tree.

Do not publish to **`@gitlawb`** unless you are a maintainer with npm access. Prefer contributing upstream and using the **registry install** or **upstream automated release** paths above for end users.

## See also

- [Advanced setup](./advanced-setup.md) — source builds, `npm link`, providers.
- [README](../README.md) — quick start and links.
- [SECURITY.md](../SECURITY.md) — release and disclosure policy.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
"doctor:report": "bun run scripts/system-check.ts --out reports/doctor-runtime.json",
"hardening:check": "bun run smoke && bun run doctor:runtime",
"hardening:strict": "bun run typecheck && bun run hardening:check",
"deploy:pack": "bash scripts/deploy-from-source.sh pack",
"deploy:link": "bash scripts/deploy-from-source.sh link",
"deploy:install-global": "bash scripts/deploy-from-source.sh global",
"deploy:registry": "bash scripts/deploy-from-source.sh registry",
"prepack": "npm run build"
},
"dependencies": {
Expand Down
48 changes: 48 additions & 0 deletions scripts/deploy-from-source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Install OpenClaude from a git checkout: pack tarball, npm link, global install,
# or refresh from the public registry. Run from repo root or via package.json scripts.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"

usage() {
echo "Usage: $0 {pack|link|global|registry|help}" >&2
echo " pack — bun install, npm pack (prepack runs build → .tgz in repo root)" >&2
echo " link — bun install, build, npm link (dev symlink)" >&2
echo " global — bun install, build, npm install -g . (global openclaude from this tree)" >&2
echo " registry — npm install -g @gitlawb/openclaude@latest (official publish)" >&2
echo " help — print this message and exit 0" >&2
}

MODE="${1:-}"
case "$MODE" in
help)
usage
exit 0
;;
"")
usage
exit 1
;;
pack)
bun install --frozen-lockfile
npm pack
;;
link)
bun install --frozen-lockfile
bun run build
npm link
;;
global)
bun install --frozen-lockfile
bun run build
npm install -g .
;;
registry)
npm install -g @gitlawb/openclaude@latest
;;
*)
usage
exit 1
;;
esac