Aleph
Gateway RPCMethods Reference

workspace.*

Workspace management RPC methods

Workspace methods manage project workspaces — isolated environments that contain files, configurations, and context for specific tasks or projects.

Methods

workspace.list

List all workspaces.

Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "workspace.list",
  "params": {}
}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "workspaces": [
      {
        "id": "ws-1",
        "name": "My Project",
        "path": "/home/user/projects/my-project",
        "created_at": "2024-01-15T10:30:00Z",
        "active": true
      }
    ]
  }
}

workspace.create

Create a new workspace.

Request:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "workspace.create",
  "params": {
    "name": "New Project",
    "path": "/home/user/projects/new-project"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "workspace": {
      "id": "ws-2",
      "name": "New Project",
      "path": "/home/user/projects/new-project",
      "created_at": "2024-01-15T10:30:00Z",
      "active": false
    }
  }
}

Parameters:

ParameterTypeRequiredDescription
namestringYesWorkspace display name
pathstringYesDirectory path for the workspace

workspace.get

Get details of a specific workspace.

Request:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "workspace.get",
  "params": {
    "workspace_id": "ws-1"
  }
}

workspace.activate

Activate a workspace (sets it as the current active workspace).

Request:

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "workspace.activate",
  "params": {
    "workspace_id": "ws-1"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "activated": true
  }
}

workspace.delete

Delete a workspace.

Request:

{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "workspace.delete",
  "params": {
    "workspace_id": "ws-2"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 5,
  "result": {
    "deleted": true
  }
}

:::warning Deleting a workspace removes only the workspace metadata. The underlying directory is not deleted. :::

workspace.files

List files in the workspace.

Request:

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "workspace.files",
  "params": {
    "workspace_id": "ws-1",
    "path": "/"
  }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 6,
  "result": {
    "files": [
      {
        "name": "src",
        "type": "directory",
        "path": "/src"
      },
      {
        "name": "README.md",
        "type": "file",
        "path": "/README.md",
        "size": 1024
      }
    ]
  }
}

See Also

On this page