Menu

#212 feat: apra-fleet update command — self-update with install option replay

open
nobody
None
2026-04-30
2026-04-30
Anonymous
No

Originally created by: kumaakh

Summary

Add an apra-fleet update subcommand so users can self-update from the CLI without manually downloading a new installer.

Commands

apra-fleet update             Download latest release and reinstall with saved options
apra-fleet update --check     Check if a newer version is available, print result, exit (no download)
apra-fleet update --help      Show usage for the update subcommand

apra-fleet --help should list apra-fleet update alongside install and auth.

Install option replay (critical)

apra-fleet update must reinstall with the same options the user originally chose — not hardcoded defaults. If the user installed with --llm gemini or --no-skill, the update must honour that.

Implementation:

  1. At install time, persist chosen options to ~/.apra-fleet/data/install-config.json:
    json { "llm": "gemini", "skill": "none" }
  2. apra-fleet update reads this config and passes the same flags to the downloaded installer
  3. If no saved config exists (pre-feature install), fall back to defaults with a warning: "No saved install config found — using defaults (--llm claude --skill all). Re-run with explicit flags to override."

Process handoff

The handoff is straightforward — no --force needed in the update flow:

  1. Running server downloads the new installer to a temp path (never over the running binary)
  2. Spawns the new installer detached (detached: true, stdio: 'ignore', unref()) — it is now an orphan, not a child process
  3. Running server shuts itself down cleanly (process.exit()) — on Windows the binary is immediately free to be overwritten since the old process has exited
  4. New installer wakes up, old process is already gone, runs install normally (no --force required — nothing to kill)
  5. New installer completes, new server is running

--force is only relevant when a user manually runs the installer without going through apra-fleet update.

Update flow

  1. Fetch latest release from GitHub API (reuse checkForUpdate / parseVersion logic)
  2. If already up to date, print message and exit
  3. Download platform-appropriate installer to a temp path
  4. Read install-config.json for saved options
  5. Spawn new installer detached with saved options
  6. process.exit() — old server is gone, binary is free
  7. New installer runs, installs, launches new server
  8. User told to reload MCP connection in their LLM client

Update notice

The notice currently shown in fleet_status reads:

Run `/pm deploy apra-fleet` to update.

Change to:

Run `apra-fleet update` to update.

/pm deploy is PM-skill-specific and meaningless to standalone users.

  • [#208] — CLI discoverability (update must appear in top-level --help)
  • [#211] — version parse fix (needed for --check to work correctly)

Related

Tickets: #208
Tickets: #211

Discussion


Log in to post a comment.

MongoDB Logo MongoDB