From d90936116dd8f54acd1024439c66c8090ca686a5 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 1 Dec 2025 21:09:53 -0800 Subject: [PATCH] docs: add go install fallback for Claude Code web (GH #439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add documentation for users experiencing npm postinstall failures in Claude Code web environments due to network restrictions. Closes: bd-8q0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .beads/issues.jsonl | 4 +-- README.md | 6 ++++ npm-package/CLAUDE_CODE_WEB.md | 56 ++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 1f28cfc2..df335848 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -23,12 +23,12 @@ {"id":"bd-63l","title":"bd hooks install fails in git worktrees","description":"When bd is used in a git worktree, bd hooks install fails with 'mkdir .git: not a directory' because .git is a file (gitdir pointer) not a directory. Beads should detect and follow the .git gitdir pointer to install hooks in the correct location. This blocks normal worktree workflows.\n\n## Symptoms of this bug:\n- Git hooks don't install automatically\n- Auto-sync doesn't run (5-second debounce)\n- Hash mismatch warnings in bd output\n- Daemon fails to start with 'auto_start_failed'\n\n## Workaround:\nUse `git rev-parse --git-dir` to find the actual hooks directory and copy hooks manually:\n```bash\nmkdir -p $(git rev-parse --git-dir)/hooks\ncp -r .beads-hooks/* $(git rev-parse --git-dir)/hooks/\n```","status":"closed","priority":1,"issue_type":"bug","created_at":"2025-11-29T00:27:59.111163003-07:00","updated_at":"2025-11-29T23:20:04.196608-08:00","closed_at":"2025-11-29T23:20:01.394894-08:00"} {"id":"bd-6ic","title":"Second worktree test","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-30T00:40:28.768125-08:00","updated_at":"2025-11-30T00:40:58.06615-08:00","closed_at":"2025-11-30T00:40:58.06615-08:00"} {"id":"bd-736d","title":"Refactor path canonicalization into helper function","description":"The path canonicalization logic (filepath.Abs + EvalSymlinks) is duplicated in 3 places:\n- beads.go:131-137 (BEADS_DIR handling)\n- cmd/bd/main.go:446-451 (--no-db cleanup)\n- cmd/bd/nodb.go:26-31 (--no-db initialization)\n\nRefactoring suggestion:\nExtract to a helper function like:\n func canonicalizePath(path string) string\n\nThis would:\n- Reduce code duplication\n- Make the logic easier to maintain\n- Ensure consistent behavior across all path handling\n\nRelated to bd-e16b implementation.","status":"closed","priority":3,"issue_type":"chore","created_at":"2025-11-02T18:33:47.727443-08:00","updated_at":"2025-11-25T22:27:33.738672-08:00","closed_at":"2025-11-25T22:27:33.738672-08:00"} -{"id":"bd-73u","title":"Refactor daemon local-only sync functions to reduce duplication","description":"PR #433 added three new local-only sync functions (createLocalSyncFunc, createLocalExportFunc, createLocalAutoImportFunc) that are largely copy-paste of existing ones with git operations removed. Refactor to use a single implementation with a skipGit bool parameter or extract shared logic into helper functions to reduce ~200 lines of duplication.","status":"in_progress","priority":3,"issue_type":"task","created_at":"2025-12-01T17:38:02.632264-08:00","updated_at":"2025-12-01T17:38:50.810193-08:00"} +{"id":"bd-73u","title":"Refactor daemon local-only sync functions to reduce duplication","description":"PR #433 added three new local-only sync functions (createLocalSyncFunc, createLocalExportFunc, createLocalAutoImportFunc) that are largely copy-paste of existing ones with git operations removed. Refactor to use a single implementation with a skipGit bool parameter or extract shared logic into helper functions to reduce ~200 lines of duplication.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-01T17:38:02.632264-08:00","updated_at":"2025-12-01T21:08:11.952459-08:00","closed_at":"2025-12-01T21:08:11.952459-08:00","close_reason":"Refactored createSyncFunc and createLocalSyncFunc to use shared performSync implementation. Reduced 54 lines of duplication."} {"id":"bd-81a","title":"Add programmatic tip injection API","description":"Allow tips to be programmatically injected at runtime based on detected conditions. This enables dynamic tips (not just pre-defined ones) to be shown with custom priority and frequency.","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-11T23:29:46.645583-08:00","updated_at":"2025-11-25T17:52:35.096882-08:00","closed_at":"2025-11-25T17:52:35.096882-08:00","dependencies":[{"issue_id":"bd-81a","depends_on_id":"bd-d4i","type":"blocks","created_at":"2025-11-11T23:29:46.646327-08:00","created_by":"daemon"}]} {"id":"bd-8a5","title":"Refactor: deduplicate FindJSONLInDir and FindJSONLPath","description":"## Background\n\nAfter fixing bd-tqo, we now have two nearly identical functions for finding the JSONL file:\n- `autoimport.FindJSONLInDir(dbDir string)` in internal/autoimport/autoimport.go\n- `beads.FindJSONLPath(dbPath string)` in internal/beads/beads.go\n\nBoth implement the same logic:\n1. Prefer issues.jsonl\n2. Fall back to beads.jsonl for legacy support\n3. Skip deletions.jsonl and merge artifacts\n4. Default to issues.jsonl if nothing found\n\n## Problem\n\nCode duplication means bug fixes need to be applied in multiple places (as we just experienced with bd-tqo).\n\n## Proposed Solution\n\nExtract shared logic to a utility package that both can import. Options:\n1. Create `internal/jsonlpath` package with the core logic\n2. Have `autoimport` import `beads` and call `FindJSONLPath` (but APIs differ slightly)\n3. Move to `internal/utils` if appropriate\n\nNeed to verify no import cycles would be created.\n\n## Affected Files\n- internal/autoimport/autoimport.go\n- internal/beads/beads.go","status":"closed","priority":4,"issue_type":"task","created_at":"2025-11-26T23:45:18.974339-08:00","updated_at":"2025-11-29T22:06:06.330185-08:00","closed_at":"2025-11-28T23:07:08.912247-08:00"} {"id":"bd-8an","title":"bd import auto-detects wrong prefix from directory name instead of issue IDs","description":"When importing issues.jsonl into a fresh database, 'bd import' prints:\n\n ✓ Initialized database with prefix 'beads' (detected from issues)\n\nBut the issues all have prefix 'bd-' (e.g., bd-03r). It appears to be detecting the prefix from the directory name (.beads/) rather than from the actual issue IDs in the JSONL.\n\nThis causes import to fail with:\n validate ID prefix for bd-03r: issue ID 'bd-03r' does not match configured prefix 'beads'\n\nWorkaround: Run 'bd config set issue_prefix bd' before import, or use 'bd init --prefix bd'.","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-11-26T22:28:01.582564-08:00","updated_at":"2025-11-28T22:17:12.607316-08:00","closed_at":"2025-11-27T22:38:48.971617-08:00"} {"id":"bd-8ib","title":"Update git hooks to be sync.branch aware","description":"## Problem\n\nThe pre-push hook blocks pushes when .beads/issues.jsonl has uncommitted changes. But with sync.branch configured, those changes are intentionally NOT committed to main - they go to the sync branch via worktree.\n\n## Current Behavior\n\n1. User configures sync.branch=beads-sync\n2. bd sync commits changes to beads-sync via worktree \n3. Local .beads/issues.jsonl is updated (needed for import)\n4. git push to main triggers pre-push hook\n5. Hook sees uncommitted .beads changes and blocks push\n6. User must use --no-verify to push\n\n## Expected Behavior\n\nWhen sync.branch is configured, the pre-push hook should:\n1. Check if sync.branch is set (bd config get sync.branch)\n2. If set, skip the .beads uncommitted check OR\n3. Verify changes are committed to the sync branch instead\n\n## Affected Files\n\n- examples/git-hooks/pre-push\n- examples/git-hooks/pre-commit (may also need update)\n\n## Workaround\n\nUse git push --no-verify","status":"closed","priority":2,"issue_type":"task","created_at":"2025-11-30T00:43:40.991951-08:00","updated_at":"2025-11-30T11:12:09.91242-08:00","closed_at":"2025-11-30T11:12:09.91242-08:00"} -{"id":"bd-8q0","title":"Add Claude Code web installation docs to README","description":"GH #439 reported installation issues in Claude Code web environment. The go install fallback works, but users need guidance. Add a section to README documenting the workaround: go install + PATH export.","status":"open","priority":3,"issue_type":"task","created_at":"2025-12-01T21:02:24.511955-08:00","updated_at":"2025-12-01T21:02:24.511955-08:00"} +{"id":"bd-8q0","title":"Add Claude Code web installation docs to README","description":"GH #439 reported installation issues in Claude Code web environment. The go install fallback works, but users need guidance. Add a section to README documenting the workaround: go install + PATH export.","status":"in_progress","priority":3,"issue_type":"task","created_at":"2025-12-01T21:02:24.511955-08:00","updated_at":"2025-12-01T21:08:54.553399-08:00"} {"id":"bd-91x","title":"Fix dependency naming inconsistencies (GH #440)","description":"Parent-child dependency documentation is backwards and UI labels are confusing.\\n\\nProblems:\\n1. DEPENDENCIES.md says 'bd dep add PARENT CHILD' but this is rejected\\n2. bd show displays epic children under 'Blocks' instead of 'Children'\\n3. bd dep tree EPIC shows nothing (need --direction=up)\\n4. Inconsistent with 'bd epic status' which uses 'children'\\n\\nSee: https://github.com/steveyegge/beads/issues/440","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-01T21:01:41.63295-08:00","updated_at":"2025-12-01T21:06:17.866688-08:00","closed_at":"2025-12-01T21:06:17.866688-08:00"} {"id":"bd-93d","title":"Jira export script (jsonl2jira.py)","description":"Create a Python script to push beads issues to Jira.\n\n**Requires**: Jira import script to be complete first (need external_ref matching logic working)\n\n**Features needed**:\n- Create new Jira issues from beads issues without external_ref\n- Update existing Jira issues matched by external_ref\n- Map beads fields back to Jira fields\n- Handle Jira workflow transitions (status changes may need transitions)\n- Support custom field mapping for design/acceptance_criteria/notes\n\n**Challenges**:\n- Jira status changes often require workflow transitions, not direct updates\n- Need to discover valid transitions via API\n- Custom fields vary by Jira instance\n\n**Usage**:\n```bash\nbd export | python jsonl2jira.py --create-only # Only create, don't update\nbd export | python jsonl2jira.py # Create and update\n```\n\n**After creation**: Sets external_ref on beads issue to link back","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-30T12:56:14.266357-08:00","updated_at":"2025-11-30T15:19:40.264737-08:00","closed_at":"2025-11-30T15:19:40.264737-08:00","dependencies":[{"issue_id":"bd-93d","depends_on_id":"bd-qvj","type":"parent-child","created_at":"2025-11-30T12:56:44.652391-08:00","created_by":"stevey"},{"issue_id":"bd-93d","depends_on_id":"bd-tjn","type":"blocks","created_at":"2025-11-30T12:56:54.941116-08:00","created_by":"stevey"}]} {"id":"bd-9e23","title":"Optimize Memory backend GetIssueByExternalRef with index","description":"Currently GetIssueByExternalRef in Memory storage uses O(n) linear search through all issues.\n\nCurrent code (memory.go:282-308):\nfor _, issue := range m.issues {\n if issue.ExternalRef != nil \u0026\u0026 *issue.ExternalRef == externalRef {\n return \u0026issueCopy, nil\n }\n}\n\nProposed optimization:\n- Add externalRefToID map[string]string to MemoryStorage\n- Maintain it in CreateIssue, UpdateIssue, DeleteIssue\n- Achieve O(1) lookup like SQLite's index\n\nImpact: Low (--no-db mode typically has smaller datasets)\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:30.242357-08:00","updated_at":"2025-11-26T11:14:49.172418-08:00","closed_at":"2025-11-26T11:14:49.172418-08:00"} diff --git a/README.md b/README.md index 88542871..8d5558e2 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,12 @@ go build -o bd ./cmd/bd npm install -g @beads/bd ``` +**Claude Code web fallback** (if npm postinstall fails due to network restrictions): +```bash +go install github.com/steveyegge/beads/cmd/bd@latest +export PATH="$PATH:$HOME/go/bin" # Required each session +``` + **Quick install (macOS / Linux):** ```bash curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash diff --git a/npm-package/CLAUDE_CODE_WEB.md b/npm-package/CLAUDE_CODE_WEB.md index 2f1f8534..234867a8 100644 --- a/npm-package/CLAUDE_CODE_WEB.md +++ b/npm-package/CLAUDE_CODE_WEB.md @@ -145,6 +145,62 @@ The SessionStart hook didn't run or installation failed. Manually run: npm install -g @beads/bd ``` +### npm postinstall fails with DNS or 403 errors + +Some Claude Code web environments have network restrictions that prevent the npm postinstall script from downloading the binary. You'll see errors like: + +``` +Error installing bd: getaddrinfo EAI_AGAIN github.com +``` + +or + +``` +curl: (22) The requested URL returned error: 403 +``` + +**Workaround: Use go install** + +If Go is available (it usually is in Claude Code web), use the `go install` fallback: + +```bash +# Install via go +go install github.com/steveyegge/beads/cmd/bd@latest + +# Add to PATH (required each session) +export PATH="$PATH:$HOME/go/bin" + +# Verify installation +bd version +``` + +**SessionStart hook with go install fallback:** + +```bash +#!/bin/bash +# .claude/hooks/session-start.sh + +echo "🔗 Setting up bd (beads issue tracker)..." + +# Try npm first, fall back to go install +if ! command -v bd &> /dev/null; then + if npm install -g @beads/bd --quiet 2>/dev/null && command -v bd &> /dev/null; then + echo "✓ Installed via npm" + elif command -v go &> /dev/null; then + echo "npm install failed, trying go install..." + go install github.com/steveyegge/beads/cmd/bd@latest + export PATH="$PATH:$HOME/go/bin" + echo "✓ Installed via go install" + else + echo "✗ Installation failed - neither npm nor go available" + exit 1 + fi +fi + +# Verify and show version +bd version +``` + ### "Error installing bd: HTTP 404" The version in package.json doesn't match a GitHub release. This shouldn't happen with published npm packages, but if it does, check: