Skip to content

Add nerve upgrade command - #48

Merged
pufit merged 1 commit into
mainfrom
pufit/add-upgrade-command
Apr 16, 2026
Merged

pufit merged 1 commit into
mainfrom
pufit/add-upgrade-command

Conversation

@pufit

@pufit pufit commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds a new nerve upgrade CLI command that handles the three standard upgrade steps against the source checkout:

  1. git pull --ff-only — refuses non-fast-forward to avoid silent merges
  2. Reinstall Python deps — uv pip install -e . when uv is on PATH, else falls back to python -m pip install -e .
  3. Rebuild frontend — npm install && npm run build in web/

On success, prints a hint to run nerve restart.

Flags

  • --no-pull — skip git pull
  • --no-deps — skip Python dependency install
  • --no-frontend — skip npm install && npm run build

Edge cases handled

  • Docker mode — short-circuits with a message pointing at docker compose pull && docker compose up -d
  • Not a git repo — skips git pull instead of crashing (tarball installs)
  • Missing pyproject.toml — hard error (not a Nerve source checkout)
  • Missing git/npm — actionable error suggesting the corresponding --no-* flag
  • Any subprocess failure raises ClickException and aborts remaining steps

Test plan

  • pytest tests/ — 368 passed (13 new in test_cli_upgrade.py + 355 existing)
  • nerve upgrade --help renders correctly
  • nerve --help lists the new command

Generated by Nerve

Pulls latest source, reinstalls Python deps (uv or pip), and rebuilds
the frontend. Supports --no-pull, --no-deps, --no-frontend flags and
short-circuits in Docker mode with a hint to use docker compose.
@pufit
pufit merged commit 11e2851 into main Apr 16, 2026
@pufit
pufit deleted the pufit/add-upgrade-command branch April 16, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant