SwarmOps
ReferenceCommandsswarmops ws delete

Page kind: Reference

swarmops ws delete#

Describes v0.11.0Last changed View as Markdown

Remove a workspace's directory, then its entry.

Edits or commits not landed are E_WS_DIRTY without --force (delete anyway) or --rescue (commit the edits as a rescue changeset first).

Metadata
Group
workspaces
Since
0.3.0
Mutates
yes
Identity required
no
MCP tool
none
Envelope op
ws_delete
Exit codes
01

Syntax#

Syntax
swarmops ws delete [OPTIONS] <NAME>

Required arguments#

Syntax: <NAME>.

The workspace, by name.

Optional arguments#

The command also takes the global options.

Syntax: --force.

Delete it even with edits or unlanded commits.

Syntax: --rescue.

Commit its edits as a rescue changeset first.

Examples#

Shell
swarmops --repo [tmp]/store --as agent/worker-17 ws delete w1
Output, an error
{ "ok": false, "op": "ws_delete", "api": 1, "error": { "code": "E_WS_DIRTY", "message": "the workspace holds edits this would overwrite: [\"src/lib.rs\"]", "retryable": false,
Show 17 more lines "exit": 1, "details": { "paths": [ "src/lib.rs" ] }, "hint": "swarmops ws commit -m <message>, or swarmops ws delete w1 --rescue" }, "meta": { "repo": "[tmp]/store", "elapsed_ms": "[elapsed_ms]", "resolved": { "[c1]": "[c1]" }, "auth": "trust" } }

Exit code 1. Recorded by the CLI tests. A name in square brackets, such as [tmp] or [c1], stands for what differs from run to run: the test's temporary directory, an id, a time.

Return information#

result is a WsDeleteResp (swarmops schema WsDeleteResp prints its JSON Schema).

FieldTypeRequiredDescription
deletedstringyesThe workspace's name.
headstringyesIts head when it was deleted.
rescuedstring or nullnoThe rescue changeset of its edits, when there were some.

Envelope op: ws_delete.

Exit codes:

  • 0: Success.
  • 1: The operation failed.

Errors#

  • E_WS_DIRTY (exit 1): The workspace holds edits the operation would overwrite or lose (details.paths, the first 20); the hint names the command that commits or discards them.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page