name: update description: > Restart the Vellum assistant and gateway services. Smart branch handling: pulls from main by default, restarts in-place on feature branches, or switches to a specified branch. Pass --pull to force-pull on the current branch.
Update - Restart Vellum (with Smart Branch Handling)
Restart the Vellum assistant and gateway services with branch-aware git behavior.
Arguments
The user may pass $ARGUMENTS to control branch behavior:
| Invocation | Behavior |
|---|---|
/update (no args, on main) |
Pull latest from origin/main (default) |
/update (no args, on a feature branch) |
Skip git ops - restart with the current checkout |
/update <branch> |
Check out that branch, pull if it has a remote |
/update --pull |
Force pull on whatever branch you're currently on |
Steps
Ensure Bun is on PATH:
export PATH="$HOME/.bun/bin:$PATH"Preflight snapshot - capture current state before making changes:
vellum psQuiesce with
vellum sleep- stop assistant and gateway processes. This is directory-agnostic and stops processes globally regardless of CWD:vellum sleep || trueVerify stopped - run
vellum psand confirm no running processes. Ifvellum psshows processes still running, run fallback cleanup to force-kill them:vellum psFallback cleanup if
vellum psconfirms processes are still running:pkill -x "vellum-assistant" || true pkill -f "gateway/src/index" || true lsof -ti :7830 | xargs kill -9 2>/dev/null || true lsof -ti :7821 | xargs kill -9 2>/dev/null || trueAfter fallback cleanup, run
vellum psagain to confirm all processes are stopped.Smart branch handling - determine what git operations (if any) to perform:
CURRENT=$(git branch --show-current) GIT_OPS_RAN=falseCase A -
--pullflag: Force pull on the current branch.if [[ "$ARGUMENTS" == "--pull" ]]; then git pull GIT_OPS_RAN=true fiCase B - Explicit branch name provided: Check out the requested branch, pulling if possible. Before checking out, verify the working tree is clean - if there are uncommitted changes, stop and warn the user rather than silently losing work. Do NOT stash automatically.
if [[ -n "$ARGUMENTS" && "$ARGUMENTS" != "--pull" ]]; then if ! git diff --quiet || ! git diff --cached --quiet; then echo "ERROR: Uncommitted changes detected. Commit or stash them before switching branches." # Stop and report the error to the user. Do not proceed. fi git checkout "$ARGUMENTS" git pull origin "$ARGUMENTS" 2>/dev/null || true GIT_OPS_RAN=true fiCase C - No args, on
main: Pull latest from origin (preserves current default behavior).if [[ -z "$ARGUMENTS" && "$CURRENT" == "main" ]]; then git pull origin main GIT_OPS_RAN=true fiCase D - No args, on a feature branch: Skip git ops entirely - just restart with the current checkout.
if [[ -z "$ARGUMENTS" && "$CURRENT" != "main" ]]; then echo "On branch '$CURRENT' - skipping git pull, restarting with current checkout" fiInstall dependencies - only if git operations ran (dependencies are unlikely to have changed for a local-only restart):
if [[ "$GIT_OPS_RAN" == "true" ]]; then cd assistant && bun install && cd .. cd gateway && bun install && cd .. fiRestart with
vellum wake- start assistant and gateway from the current checkout.vellum wakemust be run from the checkout directory that should supply the new assistant code:vellum wakeVerify fresh state - run
vellum psto confirm processes are running:sleep 5 echo "" echo "=== Startup Summary ===" vellum ps echo "======================="
Report
Tailor the report to what actually happened:
- If git pulled (Cases A, B, C): Report what was pulled (new commits), the branch, and whether dependencies were updated.
- If restarted in-place (Case D): Report that services were restarted on the current branch with no git changes.
- Always include: The startup summary block output (assistant health, gateway health).