Menu

#231 feat(install): per-instance data dir isolation via --data-dir / --instance (#193)

open
nobody
None
2026-05-03
2026-05-03
Anonymous
No

Originally created by: yashrajsapra
Originally owned by: yashrajsapra

Summary

  • Adds --data-dir and --instance flags to install so multiple Claude Code instances running on the same machine use isolated config/log directories instead of fighting over a shared one
  • Shell injection in --data-dir is eliminated by switching to execFileSync argv array (security fix surfaced in review)
  • Multi-instance usage guide added to docs

Changes

  • feat(install): per-instance data dir isolation via --data-dir / --instance + workspace CLI
  • docs: multi-instance usage guide
  • fix(install): eliminate shell injection in --data-dir via execFileSync argv array
  • chore: cleanup fleet control files (PLAN.md, progress.json, feedback.md, CLAUDE.md, AGENTS.md)

Test plan

  • [ ] node dist/index.js install --data-dir /tmp/inst-a and --data-dir /tmp/inst-b produce fully isolated runtime dirs
  • [ ] node dist/index.js install --instance myproject resolves to a deterministic subdirectory
  • [ ] Passing a path with spaces / special chars in --data-dir does not cause shell injection
  • [ ] Existing installs without --data-dir continue to use the default data directory unchanged
  • [ ] Multi-instance usage guide renders correctly in docs

🤖 Generated with Claude Code

Discussion

  • Anonymous

    Anonymous - 2026-05-03
     
  • Anonymous

    Anonymous - 2026-05-03

    Originally posted by: kumaakh

    Design suggestion for the install-config.json fix

    Rather than a per-workspace file, install-config.json should be a singleton accumulator at ~/.apra-fleet/install-config.json (outside any data dir) that tracks every install invocation:

    {
      "installs": [
        { "llm": "claude", "skill": "all" },
        { "llm": "claude", "skill": "fleet", "instance": "work" },
        { "llm": "gemini", "skill": "fleet", "dataDir": "/custom/path" }
      ]
    }
    

    Each entry maps 1:1 to a CLI invocation. apra-fleet update reads this one file and replays every entry in order — no need to discover workspaces via workspaces.json first.

    Upsert rule: key on { instance, dataDir } (both optional/undefined for the default workspace). On re-install, replace the matching entry rather than append — so running apra-fleet install --instance work --llm gemini a second time updates that entry in place.

    Changes needed:

    • src/cli/install.ts — after MCP registration, upsert into ~/.apra-fleet/install-config.json (not ${dataDir}/install-config.json)
    • src/cli/update.ts — read config.installs[], replay each entry with ['install', '--llm', e.llm, '--skill', e.skill, ...(e.instance ? ['--instance', e.instance] : []), ...(e.dataDir ? ['--data-dir', e.dataDir] : [])]
    • Tests: add a case that installs twice with different --instance values and verifies update would replay both
     

Log in to post a comment.

MongoDB Logo MongoDB