.kiwi/config.toml:
.kiwi/config.toml
501. All paths are relative to http://localhost:3333/api/kiwi. See Draft spaces for the workflow.
Create a draft
Branches from the currentHEAD and returns the new draft.
POST /drafts
string
Who owns the draft. Falls back to
X-Actor, then api.string
Eight-character hex ID used in every other draft route.
string
Git branch,
draft/{id}.string
Owner.
string
Creation time (RFC 3339).
201 Created
409 when max_active drafts already exist or the repository has no commits yet.
List drafts
Returns all active drafts as an array of the same objects.GET /drafts
Response
Get a draft
Returns one draft.GET /drafts/:id
string
required
Draft ID.
404 if the ID is unknown.
Read a file in a draft
Returns a file’s content as it is in the draft, with anETag header.
GET /drafts/:id/file
string
required
Draft ID.
string
required
File path.
text/markdown. Returns 404 if the draft or file does not exist.
Write a file in a draft
Creates or replaces a file on the draft branch. The body is the full file content.PUT /drafts/:id/file
string
required
Draft ID.
string
required
File path.
string
default:"draft-api"
Commit author on the draft branch.
Response
Draft writes do not check
If-Match. The merge is a plain git fast-forward, so review the diff before you merge.Delete a file in a draft
Deletes a file on the draft branch.DELETE /drafts/:id/file
string
required
Draft ID.
string
required
File path.
string
default:"draft-api"
Commit author.
204 with no body.
Get a draft’s tree
Returns the draft’s folder hierarchy, in the same shape asGET /tree.
GET /drafts/:id/tree
string
required
Draft ID.
string
default:"/"
Folder to start from.
Diff a draft
Returns everything the draft changed since it branched from main, as a unified diff.GET /drafts/:id/diff
string
required
Draft ID.
Response
Merge a draft
Fast-forwards main to the draft branch, then removes the draft. Uncommitted files in the draft worktree are committed first.POST /drafts/:id/merge
string
required
Draft ID.
Response
409 when main has moved since the draft was created, because only fast-forward merges are allowed. Recreate the draft from the new HEAD, or apply the changes to main directly.
Discard a draft
Deletes the draft’s branch and worktree. Main is unchanged.DELETE /drafts/:id
string
required
Draft ID.
204 with no body, or 404 if the ID is unknown.
Related
Draft spaces
When to stage changes in a draft.
MCP tools
The
kiwi_draft_* tools do the same from an agent.