Skip to content
DocsAll docs
Console

Agent tools

Lists the tools of the Kloudlite agent tool set, with the arguments and the route of each.

Last updated

On this page

web_fetch

Reads the text of one web page from its URL.

No route. The tool fetches the URL itself.

ArgumentTypeRequiredMeaning
urlstringyesAn absolute http(s) URL.
max_charsnumbernoTruncate the result at this number of characters. The default is 50000.
maxCharsnumbernoThe other spelling of max_chars.

Searches the web and returns titles, URLs and snippets.

No route. The tool calls a search service.

ArgumentTypeRequiredMeaning
querystringyesWhat to search for.
countintegernoThe number of results. The default is 5. The maximum is 10.

read

Reads text files of a workspace, with line numbers.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

write

Creates or overwrites one file of a workspace.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

edit

Replaces exact text in the files of a workspace. If one edit does not apply, none is written.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

patch

Applies a unified diff to the files of a workspace.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

glob

Lists the files of a workspace that match a glob.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

grep

Searches the contents of the files of a workspace with a regular expression.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

exec

Runs a command in a workspace and returns its output and exit code, or starts it as a detached process.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

process_list

Lists the detached processes of a workspace.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

process_output

Reads the output of a detached process from a byte offset.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

process_write

Writes to the input of a detached process.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

process_kill

Stops a detached process and its children.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

watch

Starts a watch on files of a workspace, or on a command, and returns its id.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

watch_poll

Reads the events that a watch has seen since an index.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

watch_stop

Stops a watch.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

container_build

Builds a container image from the files of a workspace and pushes it to your registry.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

container_push

Copies an image that the registry holds to more names, without a build.

Route: tool server.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

workspace_list

Lists the workspaces of the session, or of one team.

Route: GET /v1/workspaces.

ArgumentTypeRequiredMeaning
teamstringnoThe team slug. Omit it for your own.

workspace_get

Reads the state of one workspace. Poll it after each lifecycle call.

Route: GET /v1/workspaces/{id}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

workspace_create

Creates a workspace in the region of the team. In a session, the workspace is created in the session and is managed by it. It returns at once.

Route: POST /v1/sessions/{id}/workspaces in a session, else POST /v1/workspaces.

ArgumentTypeRequiredMeaning
namestringyesThe name.
quota_gbnumberyesThe disk size in GB.
imagestringnoThe image.
packagesarray of stringnoPackage entries, attr or attr@version.
teamstringnoThe team slug. Omit it for your own. A session uses its own team instead.

workspace_clone

Copies the current state of a workspace into a new workspace.

Route: POST /v1/workspaces/{id}/clone.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
namestringyesThe name.
taskstringnoWhat the clone is for. Use at most 200 characters.

workspace_restore

Creates a workspace from a snapshot.

Route: POST /v1/workspaces/restore.

ArgumentTypeRequiredMeaning
namestringyesThe name.
snapshot_idstringyesA volume name, name@N or a snapshot id.
teamstringnoThe team whose volumes a name is read from. Required for the volume of a team.
imagestringnoThe image.
packagesarray of stringnoPackage entries, attr or attr@version.
quota_gbnumbernoThe disk size in GB.

workspace_start

Starts a stopped workspace.

Route: POST /v1/workspaces/{id}/start.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

workspace_stop

Stops a workspace that is up, after it makes a snapshot.

Route: POST /v1/workspaces/{id}/stop.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

workspace_delete

Deletes a workspace for good. In a session, the workspace is deleted in the session.

Route: DELETE /v1/sessions/{id}/workspaces/{workspace} in a session, else DELETE /v1/workspaces/{id}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

workspace_snapshot

Makes a snapshot of the workspace in its history.

Route: POST /v1/workspaces/{id}/snapshots.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
messagestringnoA note for the snapshot.
volumestringnoThe volume name. Required on the first push of a volume.

worktree_add

Adds a worktree to a workspace.

Route: POST /v1/workspaces/{id}/trees.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
namestringyesThe name.

worktree_drop

Removes a worktree from a workspace.

Route: DELETE /v1/workspaces/{id}/trees/{name}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
namestringyesThe name.

packages_list

Lists the packages that a workspace declares.

Route: GET /v1/workspaces/{id}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

session_current

Shows the session of this laptop and its environment.

Route: GET /v1/sessions/{id}.

No arguments.

session_connect

Connects the session to an environment of its team.

Route: PUT /v1/sessions/{id}/environment.

ArgumentTypeRequiredMeaning
environmentstringyes

session_disconnect

Disconnects the session from its environment.

Route: PUT /v1/sessions/{id}/environment.

No arguments.

env_list

Lists the environments, or those of one team.

Route: GET /v1/environments.

ArgumentTypeRequiredMeaning
teamstringnoThe team slug. Omit it for your own.

env_get

Reads the services, the state and the intercepts of an environment.

Route: GET /v1/environments/{id}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).

env_wait

Waits until an environment settles after a change, then returns its state.

Route: GET /v1/environments/{id}, repeated.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
timeoutnumbernoSeconds.
timeout_msnumbernoMilliseconds (the other spelling of timeout).

service_logs

Reads the recent logs of one service of an environment.

Route: GET /logs/{env}/{service} on the builder gate.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
servicestringyesThe service.
tailnumberno
sincenumberno
previousbooleanno

env_delete

Deletes an environment for good.

Route: DELETE /v1/environments/{id}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).

env_start

Starts a stopped environment.

Route: POST /v1/environments/{id}/start.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).

env_stop

Stops an environment that is up.

Route: POST /v1/environments/{id}/stop.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).

env_create

Creates an environment of services, or one that grows from a snapshot.

Route: POST /v1/environments.

ArgumentTypeRequiredMeaning
namestringyesThe name.
snapshot_idstringnoThe id of a snapshot.
servicesarray of objectno
teamstringnoThe team slug. Omit it for your own.
quota_gbnumbernoThe disk size in GB.

env_clone

Creates a new environment from the live state of an environment, or from one of its snapshots.

Route: POST /v1/environments/{id}/clone.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
namestringyesThe name.
snapshot_idstringnoThe id of a snapshot.
teamstringnoThe team slug. Omit it for your own.
servicesarray of objectno
regionstringno
quota_gbnumbernoThe disk size in GB.

env_snapshot

Makes a snapshot of an environment in its history.

Route: POST /v1/environments/{id}/snapshots.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
messagestringnoA note for the snapshot.
volumestringnoThe volume name. Required on the first push of a volume.

env_restore

Puts an environment back to one of its own snapshots. Data written since is lost.

Route: POST /v1/environments/{id}/restore.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
snapshot_idstringyesThe id of a snapshot.
discardarray of stringnoNames of the services from the 409 lost list whose data you accept losing.

service_add

Adds one service to an environment. It fails if the name exists.

Route: GET /v1/environments/{id}, then PATCH /v1/environments/{id}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
serviceobjectyesThe command, env and mounts fields default to empty.

service_update

Replaces one existing service of an environment, matched by name.

Route: GET /v1/environments/{id}, then PATCH /v1/environments/{id}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
serviceobjectyesThe command, env and mounts fields default to empty.

service_remove

Removes one service from an environment.

Route: GET /v1/environments/{id}, then PATCH /v1/environments/{id}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
namestringyesThe name.

volume_list

Lists the volumes, with an optional kind and owner.

Route: GET /v1/volumes.

ArgumentTypeRequiredMeaning
kindstringnoThe kind.
ownerstringnoThe owner: a person handle or a team slug.

volume_history

Lists the snapshots of a volume.

Route: GET /v1/volumes/{name}/history.

ArgumentTypeRequiredMeaning
volumestringyesThe volume name.

volume_refs

Reads the branch tips of a volume.

Route: GET /v1/volumes/{name}/refs.

ArgumentTypeRequiredMeaning
volumestringyesThe volume name.

volume_delete

Deletes a detached volume for good.

Route: DELETE /v1/volumes/{name}.

ArgumentTypeRequiredMeaning
volumestringyesThe volume name.

snapshot_delete

Deletes one snapshot of a volume.

Route: DELETE /v1/volumes/{name}/snapshots/{id}.

ArgumentTypeRequiredMeaning
volumestringyesThe volume name.
snapshotstringyes

builder_status

Shows the state of the image builder of a team.

Route: GET /v1/builders/me.

ArgumentTypeRequiredMeaning
teamstringnoThe team slug. Omit it for your own.

quota

Shows the ceilings and the current use of an owner.

Route: GET /v1/quota.

ArgumentTypeRequiredMeaning
ownerstringnoThe owner: a person handle or a team slug.

requests_list

Lists the requests of the person and of their teams.

Route: GET /v1/requests.

ArgumentTypeRequiredMeaning
ownerstringnoThe owner: a person handle or a team slug.

request_get

Shows one request and its decision.

Route: GET /v1/requests/{id}.

ArgumentTypeRequiredMeaning
idstringyes

request_create

Asks an administrator for quota, access, a region or anything else. The decision comes later.

Route: POST /v1/requests.

ArgumentTypeRequiredMeaning
ownerstringnoThe team slug. Omit it for the person's own.
kindstring, one of quota, access, region, otheryesThe kind.
reasonstringyesWhy the person asks.
quotaobjectnoThe new ceilings that you want. Give only the dimensions that change.
accessobjectno
regionstringnoThe region the team moves to (only while the team has nothing).
titlestringnoThe title.
bodystringnoThe text.

regions

Lists the regions in which a team can live.

Route: GET /v1/regions.

No arguments.

packages_add

Declares packages on a workspace. An entry with the same attribute replaces the old entry.

Route: GET /v1/workspaces/{id}, then PATCH /v1/workspaces/{id}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
packagesarray of stringyesPackage entries, attr or attr@version.

packages_remove

Removes declared packages from a workspace.

Route: GET /v1/workspaces/{id}, then PATCH /v1/workspaces/{id}.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
packagesarray of stringyesPackage entries, attr or attr@version.

packages_update

Resolves the package pins of a workspace again, to the newest matching versions.

Route: POST /v1/workspaces/{id}/packages/update.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).

intercept

Sends the traffic of an environment service to a workspace.

Route: POST /v1/environments/{id}/intercepts.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
servicestringyesThe service.
workspacestringyesThe workspace id (ws-…).
portsarray of objectnoPort remaps: service is the port callers dial on the environment service, workspace the port the workspace listens on. Omit to forward each port to the same number.

release

Gives an intercepted service back to its own program.

Route: DELETE /v1/environments/{id}/intercepts/{service}.

ArgumentTypeRequiredMeaning
envstringyesThe environment id (env-…).
servicestringyesThe service.

workspace_ask

Gives a goal to the session of a workspace. The answer arrives later as a message.

No route. The tool sends a message to the session of the workspace.

ArgumentTypeRequiredMeaning
workspacestringyesThe workspace id (ws-…).
requeststringyes
forstringnoThe id of your own board task this ask serves.

task_add

Adds a task to the board of the agent.

No route. The tool writes the board of the agent.

ArgumentTypeRequiredMeaning
titlestringyesThe title.
priorityintegernoLower runs first.
depends_onarray of stringno
notestringno

task_update

Changes a task on the board of the agent.

No route. The tool writes the board of the agent.

ArgumentTypeRequiredMeaning
idstringyes
titlestringnoThe title.
priorityintegernoLower runs first.
depends_onarray of stringno
statestring, one of queued, running, blocked, done, failednoThe state to list.
notestringno
summarystringno
verifiedstringno

task_list

Lists the tasks on the board of the agent.

No route. The tool reads the board of the agent.

No arguments.

workspace_tasks

Lists the tasks on the board of one workspace.

No route. The tool reads the board of the workspace.

ArgumentTypeRequiredMeaning
workspacestringnoThe workspace id (ws-…). Leave it out to get every workspace board.

scratch_bash

Runs a command in the scratch folder of the session, not in a workspace.

No route. The tool runs in the session.

ArgumentTypeRequiredMeaning
commandstringyes
timeoutnumbernoIn seconds. The default is 120. The maximum is 600.
timeout_msnumbernoThe same limit in milliseconds (the other spelling of timeout); give one of them.

scratch_read

Reads a file of the scratch folder of the session, not of a workspace.

No route. The tool runs in the session.

ArgumentTypeRequiredMeaning
pathstringyes
offsetintegerno
limitintegernoThe most items to return.

scratch_write

Writes a file of the scratch folder of the session, not of a workspace.

No route. The tool runs in the session.

ArgumentTypeRequiredMeaning
pathstringyes
contentstringyes

session_use

Picks the session of this laptop. It can connect the session to an environment, and create the session or the environment.

Route: GET /v1/sessions, PUT /v1/sessions/{id}/environment, and POST /v1/sessions or POST /v1/environments when it creates.

ArgumentTypeRequiredMeaning
teamstringnoThe team slug. Omit it for your own.
namestringnoAn existing session of yours, by name or id. It picks the session and never creates one.
environmentstringnoAn existing environment, by id or name, to connect the session to.
new_environmentstringnoThe name of an environment to create and connect. Not with environment.

session_pick

Picks the session that the tools drive. It is the only tool until you pick a session.

No route. The tool runs in kloudlite.

ArgumentTypeRequiredMeaning
idstringyesThe session name or id.