-
Notifications
You must be signed in to change notification settings - Fork 1
Git Workflow
vibe-coder exposes git read access plus commit/push. Destructive operations
(reset --hard, force push, branch -D) are intentionally not exposed in
the browser — when really needed, ask Claude in the console.
| Endpoint | Returns |
|---|---|
GET /api/projects/{id}/git/status |
branch + short porcelain entries |
GET /api/projects/{id}/git/diff |
unified diff (working tree) |
GET /api/projects/{id}/git/log |
last N commits (sha + message) |
SSR view: /projects/{id}/git shows status / diff / log in three cards.
curl -X POST http://localhost:17880/api/projects/my-app/git/commit \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "feat: add settings screen",
"push": true,
"onlyTracked": false
}'{
"committed": true,
"pushed": true,
"branch": "main",
"sha": "a1b2c3d4...",
"log": "$ git add -A\n... $ git commit -m '...'\n[main a1b2c3d] feat: add settings screen\n $ git push origin main\nTo github.com:user/repo.git\n..."
}Body fields:
| Field | Default | Description |
|---|---|---|
message |
(required) | 3–4000 chars |
push |
true |
after commit, run git push origin <current-branch>
|
onlyTracked |
false |
use git add -u (skip new files) |
log is a transcript of every git command run + their output, suitable
for showing the user verbatim if the push fails.
- Resolves current branch via
git rev-parse --abbrev-ref HEAD. -
git add -A(or-uwhenonlyTracked=true). - If
git status --porcelainis empty → returnscommitted=falseearly. -
git commit -m <message>withGIT_AUTHOR_NAME/GIT_AUTHOR_EMAILdefaulted tovibe-coder/vibe-coder@localhost(override via envVIBECODER_GIT_AUTHOR_NAME/_EMAIL). - If
push=true:git push origin <branch>withGIT_TERMINAL_PROMPT=0andGIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new -o BatchMode=yes". - Returns the result. A push failure does not roll back the commit —
the user can retry by hitting the form again with
push=trueon acommitted=falsePOST (which won't double-commit).
git push itself does not handle credentials — it inherits from:
| Remote URL | Credential source |
|---|---|
https://github.com/.../.git |
~/.git-credentials populated by /settings/git-integrations (PAT) |
git@github.com:.../.git |
~/.ssh/id_ed25519 (generated by the same page) |
So before push works, the operator must have registered either a PAT or an
SSH key for the target host — exactly as for git clone of private repos.
The git page (/projects/{id}/git) has a Commit / Push card:
- Textarea: commit message (required, 3–4000 chars).
- Checkbox: "Only tracked files" — maps to
onlyTracked. - Checkbox: "Run git push origin " — maps to
push(default checked). - Submit button → POST → redirect back to
/projects/{id}/git?flash=....
The flash banner contains the same log transcript so the user can copy
the exact error after a push rejection.
-
git push --force/--force-with-lease git reset --hard <sha>-
git checkout -- <file>(= discard working tree changes) git clean -fdgit branch -D <name>-
git rebase(interactive or otherwise) git stash-
git tag/git tag -d - Anything that rewrites already-pushed history
If you genuinely need any of these, ask Claude in the project console:
"Reset this project to commit a1b2c3d and force-push to origin." — Claude can run shell commands inside the project workspace and explain the consequences before doing it.
The justification is the same as the no-raw-shell policy: a one-click "reset --hard" in a browser would be devastating when accidentally clicked.
Every commit/push attempt records an audit_log entry with action
git.commit, plus detail={"push": true|false} and result OK/FAIL. View at
/audit?action=git.commit to see the full history of commits/pushes.