GibilGibil

Remote PR Workflow

Create branches, commit, push, and open PRs from ephemeral VMs

Everything happens on the VM — branch creation, file edits, tests, commits, push, PR. Your local machine stays clean.

Setup

You need a GitHub token with repo scope for push access and PR creation:

export GITHUB_TOKEN=$(gh auth token)

The full workflow

# 1. Forge a server
gibil create --name pr-task \
  --repo https://github.com/you/project \
  --ttl 30

# 2. Configure git credentials on the VM
gibil run pr-task "
  cd /root/project &&
  git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/you/project.git &&
  echo ${GITHUB_TOKEN} | gh auth login --with-token
"

# 3. Create a branch
gibil run pr-task "cd /root/project && git checkout -b feat/my-feature"

# 4. Make changes
gibil run pr-task "
  cd /root/project &&
  echo 'export const hello = \"world\";' > src/new-file.ts
"

# 5. Run tests
gibil run pr-task "cd /root/project && pnpm test"

# 6. Commit and push
gibil run pr-task "
  cd /root/project &&
  git add -A &&
  git commit -m 'feat: add new feature' &&
  git push -u origin feat/my-feature
"

# 7. Open a PR
gibil run pr-task "
  cd /root/project &&
  gh pr create \
    --title 'feat: add new feature' \
    --body 'Adds the new feature. Tests passing.'
"

# 8. Burn it
gibil destroy pr-task

Never hardcode tokens in .gibil.yml. Pass GITHUB_TOKEN at runtime via gibil run or export it before gibil create.

Parallel PRs

Run multiple independent tasks on separate VMs, each opening its own PR:

Task 1: feat/add-logging     → VM task-1 → PR #12
Task 2: feat/add-rate-limit  → VM task-2 → PR #13
Task 3: fix/db-timeout       → VM task-3 → PR #14

Each VM works on its own branch. No conflicts. No local state.

With MCP (for Claude Code)

In MCP mode, Claude calls vm_write to edit files directly — no shell escaping needed:

Claude → vm_write({ path: "src/app.ts", content: "..." })
Claude → vm_bash({ command: "pnpm test" })
Claude → vm_bash({ command: "git add -A && git commit -m '...' && git push" })
Claude → vm_bash({ command: "gh pr create --title '...' --body '...'" })

See Use with Claude Code for full MCP setup.

Next steps

On this page