Workspaces
Workspace contexts — create, list, restore and remove them, read their status and event feed, and warp a session from one workspace into another.
Send these requests to your own running server. Values stay in this browser.
How this works
Start a server with nikcli serve --hostname 127.0.0.1 --port 4096. Requests go
straight from this page to that address — the browser allows it because loopback counts as a
secure origin, and the server allows it because nikcli-ai.dev is in its CORS
allowlist.
To try things without touching your real sessions or config, start the server with
NIKCLI_TEST_HOME pointed at a throwaway directory — see
the guided tour.
Operations
11 endpoints, generated from the
server's own OpenAPI document. Every path also accepts the
directory and workspace query parameters that select which instance
handles the request.
| get | /experimental/workspace/adaptor | experimental.workspace.adaptor.list |
| post | /experimental/workspace/sync-list | experimental.workspace.syncList |
| get | /experimental/workspace/status | experimental.workspace.status |
| post | /experimental/workspace/{id} | experimental.workspace.create |
| delete | /experimental/workspace/{id} | experimental.workspace.remove |
| get | /experimental/workspace | experimental.workspace.list |
| post | /experimental/workspace/{id}/restore | experimental.workspace.restore |
| post | /experimental/workspace/{id}/session/{sessionID}/restore | experimental.workspace.session.restore |
| post | /experimental/workspace/warp | experimental.workspace.warp |
| get | /experimental/workspace/{id}/events | experimental.workspace.events |
| post | /experimental/workspace/session/{sessionID}/warp | experimental.workspace.session.warp |
experimental.workspace.adaptor.list | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
({ type: string name: string description: string available?: boolean | null })[]
Example response from schema
[
{
"type": "",
"name": "",
"description": "",
"available": false
}
] Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.adaptor.list({
...
}) Try it
experimental.workspace.syncList | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.syncList({
...
}) Try it
experimental.workspace.status | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
({ workspaceID: string status: | "connected" | "connecting" | "disconnected" | "error" })[]
Example response from schema
[
{
"workspaceID": "",
"status": "connected"
}
] Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.status({
...
}) Try it
experimental.workspace.create | Name | In | Type | Required |
|---|---|---|---|
| id | path | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
{ branch: string | null config: WorkspaceConfig }
{ id: string name: string timeUsed: | number | "Infinity" | "-Infinity" | "NaN" branch: string | null projectID: string config: WorkspaceConfig }
Example response from schema
{
"id": "",
"name": "",
"timeUsed": 0,
"branch": "",
"projectID": "",
"config": {
"type": "worktree",
"directory": "",
"strategy": "git",
"eventLimit": 0
}
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.create({
...
}) Try it
experimental.workspace.remove | Name | In | Type | Required |
|---|---|---|---|
| id | path | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
Workspace_1 | null
Example response from schema
{
"id": "",
"name": "",
"timeUsed": 0,
"branch": "",
"projectID": "",
"config": {
"type": "worktree",
"directory": "",
"strategy": "git",
"eventLimit": 0
}
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.remove({
...
}) Try it
This changes or removes server state, against whatever base URL is set above.
experimental.workspace.list | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
({ id: string name: string timeUsed: | number | "Infinity" | "-Infinity" | "NaN" branch: string | null projectID: string config: WorkspaceConfig })[]
Example response captured
[] SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.list({
...
}) Try it
experimental.workspace.restore | Name | In | Type | Required |
|---|---|---|---|
| id | path | string | required |
| timeoutMs | query | string | null | optional |
| directory | query | string | optional |
| workspace | query | string | optional |
{ workspaceID: string sessions: string[] events: unknown[] }
Example response from schema
{
"workspaceID": "",
"sessions": [
""
],
"events": []
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.restore({
...
}) Try it
experimental.workspace.session.restore | Name | In | Type | Required |
|---|---|---|---|
| id | path | string | required |
| sessionID | path | string | required |
| timeoutMs | query | string | null | optional |
| directory | query | string | optional |
| workspace | query | string | optional |
{ workspaceID: string sessionID: string sessions: string[] events: unknown[] }
Example response from schema
{
"workspaceID": "",
"sessionID": "",
"sessions": [
""
],
"events": []
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.session.restore({
...
}) Try it
experimental.workspace.warp | Name | In | Type | Required |
|---|---|---|---|
| directory | query | string | optional |
| workspace | query | string | optional |
{ id: string | null sessionID: string copyChanges?: boolean | null timeoutMs?: | | number | "Infinity" | "-Infinity" | "NaN" | null }
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.warp({
...
}) Try it
experimental.workspace.events | Name | In | Type | Required |
|---|---|---|---|
| id | path | string | required |
| from | query | string | null | optional |
| directory | query | string | optional |
| workspace | query | string | optional |
unknown[]
Example response from schema
[]
Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.events({
...
}) Try it
experimental.workspace.session.warp | Name | In | Type | Required |
|---|---|---|---|
| sessionID | path | string | required |
| directory | query | string | optional |
| workspace | query | string | optional |
{ workspaceID: string | null copyChanges?: boolean | null timeoutMs?: | | number | "Infinity" | "-Infinity" | "NaN" | null }
{ sessionID: string workspaceID: string | null }
Example response from schema
{
"sessionID": "",
"workspaceID": ""
} Generated from the response schema — field values are placeholders, the shape is real.
SDK example
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"
const client = createNikcliClient()
await client.experimental.workspace.session.warp({
...
}) Try it
Schemas
The 12 schemas reachable from these endpoints. Each is shown one level
deep; nested types link to their own entry below.
Names ending in _2, _3 and so on are the OpenAPI emitter
disambiguating same-named schemas declared by different HttpApi groups — they are distinct
shapes, not duplicates.
Workspace_1 | null
{ id: string name: string timeUsed: | number | "Infinity" | "-Infinity" | "NaN" branch: string | null projectID: string config: WorkspaceConfig }
{ type: string name: string description: string available?: boolean | null }
| { type: "worktree" directory: string strategy?: "git" | "cow" | null eventLimit?: | | number | "Infinity" | "-Infinity" | "NaN" | null } | { type: "container" directory: string runtime: "docker" | "podman" image: string containerName: string port: | number | "Infinity" | "-Infinity" | "NaN" serverUrl: string eventLimit?: | | number | "Infinity" | "-Infinity" | "NaN" | null } | { type: "branch" directory: string branch?: string | null eventLimit?: | | number | "Infinity" | "-Infinity" | "NaN" | null }
{ workspaceID: string status: | "connected" | "connecting" | "disconnected" | "error" }
{ branch: string | null config: WorkspaceConfig }
unknown { workspaceID: string sessions: string[] events: unknown[] }
{ workspaceID: string sessionID: string sessions: string[] events: unknown[] }
{ workspaceID: string | null copyChanges?: boolean | null timeoutMs?: | | number | "Infinity" | "-Infinity" | "NaN" | null }
{ sessionID: string workspaceID: string | null }
{ id: string | null sessionID: string copyChanges?: boolean | null timeoutMs?: | | number | "Infinity" | "-Infinity" | "NaN" | null }