Docs · Projects
Projects
A project is a local repository registered with Zero. Work items are created inside projects. Each project tracks its own git state, file tree, and memory.
Overview
Projects sit between workspaces and Work items in Zero's hierarchy:
Workspace → Project → Work item → SessionA project maps to a local path on disk — typically a git repository root. Zero reads its branch, dirty state, and file tree at registration time and keeps them updated as sessions run.
Create a project
Before creating, validate the path. Zero checks that the directory is readable, has a recognised project structure, and does not contain path traversal.
POST /projects/validate-root
Body: { "path": "/Users/you/repos/myapp" }
Response:
{
"path": "/Users/you/repos/myapp",
"status": "ok",
"suggested_name": "myapp",
"markers": ["package.json", ".git"],
"warnings": [],
"hard_errors": [],
"git": {
"branch": "main",
"remote_url": "https://github.com/you/myapp",
"is_dirty": false
}
}Once validated, create the project:
POST /projects
Body: {
"name": "myapp",
"local_path": "/Users/you/repos/myapp"
}
Response: { "id": "proj_abc", "name": "myapp", ... }Git status
Retrieve the current git state for a project — branch, dirty flag, recent commit:
GET /projects/:id/git
Response:
{
"branch": "main",
"last_commit_hash": "a1b2c3",
"last_commit_message": "fix: auth token expiry",
"is_dirty": true,
"remote_url": "https://github.com/you/myapp"
}Staged/unstaged status is available at GET /projects/:id/git/status. Per-file diffs are at GET /projects/:id/git/diff.
You can stage, unstage, and commit from the same surface:
| Action | Endpoint |
|---|---|
| Stage files | POST /projects/:id/git/stage |
| Unstage files | POST /projects/:id/git/unstage |
| Stage all | POST /projects/:id/git/stage-all |
| Unstage all | POST /projects/:id/git/unstage-all |
| Discard file changes | POST /projects/:id/git/discard |
| Commit | POST /projects/:id/git/commit |
| List branches | GET /projects/:id/branches |
| Switch branch | POST /projects/:id/git/switch-branch |
| Create branch | POST /projects/:id/git/create-branch |
Files
Browse and edit project files directly:
GET /projects/:id/files?path=src/auth
Response: [
{ "name": "jwt.rs", "path": "src/auth/jwt.rs", "is_dir": false, "size": 4200 },
{ "name": "middleware", "path": "src/auth/middleware", "is_dir": true, "size": 0 }
]Read, write, rename, create, and delete files:
| Action | Endpoint |
|---|---|
| Read file | GET /projects/:id/files/:path |
| Write file | PUT /projects/:id/files/:path |
| Create file | POST /projects/:id/files/create |
| Rename file | POST /projects/:id/files/rename |
| Delete file | POST /projects/:id/files/delete |
| Format file | POST /projects/:id/format |
Stats
Aggregate statistics for a project — total Work items, session count, proof rate, recent activity:
GET /projects/:id/stats
Response:
{
"case_count": 14,
"session_count": 47,
"proof_rate": 0.71,
"last_activity_at": "2026-04-30T18:22:00Z"
}API reference
| Method | Path | Description |
|---|---|---|
GET | /projects | List projects |
POST | /projects | Create project |
POST | /projects/validate-root | Validate local path |
GET | /projects/recent | Recent workspaces |
GET | /projects/:id | Get project |
GET | /projects/:id/stats | Project statistics |
GET | /projects/:id/git | Git info |
GET | /projects/:id/git/status | Staged/unstaged status |
GET | /projects/:id/git/diff | Full diff |
POST | /projects/:id/git/stage | Stage files |
POST | /projects/:id/git/unstage | Unstage files |
POST | /projects/:id/git/stage-all | Stage all |
POST | /projects/:id/git/unstage-all | Unstage all |
POST | /projects/:id/git/discard | Discard file changes |
POST | /projects/:id/git/commit | Commit staged changes |
GET | /projects/:id/branches | List branches |
POST | /projects/:id/git/switch-branch | Switch branch |
POST | /projects/:id/git/create-branch | Create branch |
GET | /projects/:id/files | List files |
GET | /projects/:id/files/:path | Read file |
PUT | /projects/:id/files/:path | Write file |
POST | /projects/:id/files/create | Create file |
POST | /projects/:id/files/rename | Rename file |
POST | /projects/:id/files/delete | Delete file |
POST | /projects/:id/format | Format file |