docs/sgai-skills/workspace-management/SKILL.md
Create, fork, delete, and rename sgai workspaces via the HTTP API. Use when you need to set up new project workspaces, create parallel forks for concurrent development, clean up finished forks, or rename existing fork workspaces.
npx skillsauth add sandgardenhq/sgai workspace-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Workspaces are directories managed by sgai. There are three kinds:
Endpoint: POST /api/v1/workspaces
curl -X POST $BASE_URL/api/v1/workspaces \
-H "Content-Type: application/json" \
-d '{"name": "my-project"}'
Request:
{"name": "my-project"}
Response (201 Created):
{
"name": "my-project",
"dir": "/path/to/workspaces/my-project"
}
Errors:
400 — invalid name (must be lowercase letters, numbers, dashes)409 — directory already existsCreate a jj workspace fork for parallel development.
Endpoint: POST /api/v1/workspaces/{name}/fork
curl -X POST $BASE_URL/api/v1/workspaces/my-project/fork \
-H "Content-Type: application/json" \
-d '{"name": "feature-branch"}'
Request:
{"name": "feature-branch"}
Response (201 Created):
{
"name": "feature-branch",
"dir": "/path/to/workspaces/feature-branch",
"parent": "my-project",
"createdAt": ""
}
Notes:
jj workspace addEndpoint: POST /api/v1/workspaces/{name}/delete-fork
Where {name} is the root workspace name.
curl -X POST $BASE_URL/api/v1/workspaces/my-project/delete-fork \
-H "Content-Type: application/json" \
-d '{"forkDir": "/full/path/to/fork", "confirm": true}'
Request:
{
"forkDir": "/full/path/to/workspaces/feature-branch",
"confirm": true
}
Response:
{
"deleted": true,
"message": "fork deleted successfully"
}
Notes:
confirm: true is required (safety guard)jj workspace forget then removes the directoryOnly fork workspaces can be renamed (not standalone or root).
Endpoint: POST /api/v1/workspaces/{name}/rename
curl -X POST $BASE_URL/api/v1/workspaces/feature-branch/rename \
-H "Content-Type: application/json" \
-d '{"name": "new-feature-name"}'
Request:
{"name": "new-feature-name"}
Response:
{
"name": "new-feature-name",
"oldName": "feature-branch",
"dir": "/path/to/workspaces/new-feature-name"
}
Errors:
400 — workspace is not a fork409 — session is running (stop first) or name conflictPin workspaces to keep them prioritized at the top of the list.
Endpoint: POST /api/v1/workspaces/{name}/pin
curl -X POST $BASE_URL/api/v1/workspaces/my-project/pin
Response:
{
"pinned": true,
"message": "pin toggled"
}
Set a human-readable summary for a workspace (shown in the UI).
Endpoint: PUT /api/v1/workspaces/{name}/summary
curl -X PUT $BASE_URL/api/v1/workspaces/my-project/summary \
-H "Content-Type: application/json" \
-d '{"summary": "Implementing authentication module"}'
Response:
{
"updated": true,
"summary": "Implementing authentication module",
"workspace": "my-project"
}
Update the jj commit description for the current working copy.
Endpoint: POST /api/v1/workspaces/{name}/description
curl -X POST $BASE_URL/api/v1/workspaces/my-project/description \
-H "Content-Type: application/json" \
-d '{"description": "feat: add authentication endpoints"}'
Response:
{
"updated": true,
"description": "feat: add authentication endpoints"
}
Endpoint: GET /api/v1/workspaces/{name}/goal
curl -s $BASE_URL/api/v1/workspaces/my-project/goal
Response:
{
"content": "---\nflow: ...\n---\n\n- [ ] Task 1\n"
}
Endpoint: PUT /api/v1/workspaces/{name}/goal
curl -X PUT $BASE_URL/api/v1/workspaces/my-project/goal \
-H "Content-Type: application/json" \
-d '{"content": "- [ ] Build the auth system\n- [ ] Write tests\n"}'
Response:
{
"updated": true,
"workspace": "my-project"
}
Get the current jj diff for a workspace.
Endpoint: GET /api/v1/workspaces/{name}/diff
curl -s $BASE_URL/api/v1/workspaces/my-project/diff
Response:
{
"diff": "diff --git a/file.go b/file.go\n..."
}
documentation
Start, stop, and steer agentic sessions in sgai workspaces. Use when you need to launch AI agent sessions, halt running sessions, or inject steering instructions to guide the agent mid-execution without stopping it.
development
Monitor sgai workspace status, events, progress, diffs, and workflow diagrams. Use when you need to observe what agents are doing, track progress, get the current state of all workspaces, subscribe to real-time updates via SSE, or inspect code changes.
development
Access agents, skills, and code snippets available in sgai workspaces. Use when you need to discover what agents are defined in a workspace, browse available skills, get skill instructions, find code snippets by language, or retrieve snippet content for a specific task.
data-ai
Handle agent questions and work gates in sgai workspaces. Use when an agent is blocked waiting for human input, when you need to respond to multi-choice questions, approve work gates, or provide free-text answers to agent queries.