Skip to content

Windows: codev doctor fails on fresh install (jq missing, core.longpaths unset, script-shell unset) #2012

Backlog

Description

@OdyAsh

Missing Dependencies & Config Defaults on Windows

Context

When you install codev on Windows and run codev doctor to check your setup, it fails with multiple errors about missing dependencies and unset configuration. These aren't bugs in codev itself — they're missing prerequisites that codev doesn't set up automatically on Windows.

A new Windows user installs codev, runs codev doctor, and sees a wall of errors. They don't know what jq is, what core.longpaths means, or why script-shell matters. The UX issues (#8, #11) make it even harder — commands that should "just work" require extra flags or arguments.

Environment

  • OS: Windows 11 (build 22631)
  • Node: v22.23.3
  • npm: 10.9.9
  • pnpm: 10.33.0
  • codev: 3.3.8

Steps to Reproduce

Finding #2: jq missing

  1. Install codev: npm install -g @cluesmith/codev
  2. Run doctor: codev doctor
  3. Observe:
    ✗ jq not found
    Doctor exiting with code 1
    
  4. Run forge-jira tests: pnpm --filter @cluesmith/codev test -- forge-jira
  5. Observe 12 tests fail with exit code 127 (command not found)

Finding #3: core.longpaths unset

  1. Run doctor: codev doctor
  2. Observe warning:
    ⚠ core.longpaths is not set
    

Finding #4: script-shell unset (#1945)

  1. Open a fresh terminal (no script-shell configured)
  2. Run build: npm run build
  3. Observe:
    'scripts' is not recognized as an internal or external command
    
  4. Run tests: pnpm exec vitest
  5. Observe:
    'vitest' is not recognized as an internal or external command
    

Finding #8: porch status needs explicit project ID

  1. Create multiple codev projects (or have 364+ from other work)
  2. Run: porch status
  3. Observe it fails or picks the wrong project
  4. Must run: porch status 1488 (explicit ID)

Finding #11: codev init --yes requires project name

  1. Run: codev init --yes
  2. Observe:
    Project name is required
    

Expected Behavior

  • codev doctor should pass (or clearly explain what to install)
  • npm run build should work out of the box
  • porch status should auto-detect the current project
  • codev init --yes should work with a default name

Actual Behavior

Finding #2: jq missing

codev doctor uses jq (a CLI JSON processor) to parse JSON. Without it, doctor exits 1 and 12 forge-jira tests fail. jq isn't installed by default on Windows.

Finding #3: core.longpaths unset

Git has a 260-character path limit on Windows by default. core.longpaths allows longer paths. Without it, deep worktree paths (.builders/spir-1488/codev/specs/...) can fail.

Finding #4: script-shell unset (#1945)

Git uses script-shell config to determine which shell to use for npm run scripts. Without it, Windows uses cmd.exe instead of bash, causing 'scripts' is not recognized errors.

Finding #8: porch status needs explicit ID

With 364+ projects in the state database, porch can't auto-detect which project you mean. You must provide an explicit ID.

Finding #11: codev init --yes needs project name

The --yes flag skips prompts but still requires a project name argument.

Root Cause

These are all missing prerequisites and defaults that codev doesn't set up on Windows:

Issue What's missing Why it matters
#2 jq CLI JSON processor codev doctor and forge-jira tests need it
#3 core.longpaths Git config for long paths Deep worktree paths fail without it
#4 script-shell Git config for shell npm run build fails without it
#8 porch status Auto-detection UX issue with many projects
#11 codev init Default project name UX issue with --yes flag

On Linux/Mac, some of these are pre-installed (jq) or configured differently (longpaths). On Windows, none are set up by default.

Possible Fix

Finding #2: Auto-install jq or use Node-based JSON parsing

Replace jq calls in doctor with Node.js JSON parsing:

// Instead of: jq -r '.field' file.json
// Use: node -e "console.log(require('./file.json').field)"

Or auto-install jq on first run:

# In codev doctor or init
winget install jqlang.jq

Finding #3: Set core.longpaths during codev init

git config --global core.longpaths true

Finding #4: Set script-shell during codev init (#1945)

git config --global core.script-shell "C:\\Program Files\\Git\\bin\\bash.exe"

Or detect Git Bash and set it automatically.

Finding #8: Auto-detect project from cwd

If porch status is run from a directory that matches a project, use that project.

Finding #11: Default project name from directory

If --yes is passed without a name, use the current directory name.

Evidence

Doctor output

$ codev doctor
✗ jq not found
⚠ core.longpaths is not set
⚠ script-shell is not set
Doctor exiting with code 1

Build failure

$ npm run build
'scripts' is not recognized as an internal or external command

Test failures

$ pnpm --filter @cluesmith/codev test -- forge-jira
12 tests failed (exit code 127)

Impact

  • New Windows users can't use codev — doctor fails, build fails
  • 12 tests fail — forge-jira tests need jq
  • Poor first impression — errors without explanation
  • Workarounds exist but aren't documented

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions