Skip to content

ws-cli ​

ws-cli groups the workspace's helper commands: inspect the running workspace, manage settings and secrets, drive the editor, and serve local assets. The startup scripts call most of them, and all of them work in your terminal:

sh
ws-cli info version --all

The ws Shortcut ​

In an interactive workspace terminal, ws is a shortcut for ws-cli. With no arguments, it changes to the workspace root (WS_SERVER_ROOT, /workspace by default).

ws is a zsh function that exists only in interactive terminals, so scripts, docker exec and CI must call ws-cli.

Commands ​

ws-cli clip v0.2.0 ​

Reach the browser clipboard from the terminal.

sh
# Save the browser clipboard to a file
ws-cli clip paste > out.txt

# Search within it
ws-cli clip paste | grep "pattern"

# Send command output to the browser clipboard
ls | ws-cli clip copy

ws-cli clip copy v0.5.0 ​

Read stdin and write it to the browser clipboard. Pairs with the pbcopy/xclip/xsel shims for terminal clipboard access.

ws-cli clip copy


ws-cli clip paste v0.2.0 ​

Read the browser clipboard and write it to stdout, so you can redirect it to a file or pipe it onward. Pairs with the pbcopy/xclip/xsel shims for terminal clipboard access.

ws-cli clip paste


ws-cli editor v0.5.0 ​

Query and control the running editor window: list open tabs, read diagnostics and the current selection, open, reveal, or download a file, or open a terminal. Blocked over SSH, where there is no browser editor to reach.

FlagDescriptionDefault
--rawOutput the raw JSON response without stylingfalse
sh
# List the open editor tabs
ws-cli editor list

# Open a file at a specific line and column
ws-cli editor open src/main.go --selection 12:1

# Preview a document in an overlay instead of a tab
ws-cli editor open README.md --modal

# Run the tests in a new editor terminal
ws-cli editor terminal --name tests -- go test ./...

ws-cli editor diagnostics v0.5.0 ​

Pull language-server diagnostics (errors, warnings) from the editor, across the whole workspace or a single file with --uri.

ws-cli editor diagnostics [flags]

FlagDescriptionDefault
--uriFilter to a single file (URI or absolute path)

ws-cli editor download v0.6.1 ​

Ask the running editor window to download a file of any size to your computer through the browser. The editor asks first, naming the file with its full path and size; once you click Download it returns at once and the transfer shows in the browser's download bar. A folder is zipped first, as <folder>.zip (or --name) in its own temp folder, and the zip is downloaded; --zip zips without asking, a terminal is asked, and without either the folder is refused. The zip is deleted at once when the download does not start, and soon after it does, once the editor has opened it. Fails when file downloads are disabled (WS_EDITOR_DISABLE_FILE_DOWNLOADS), when the path is neither a regular file nor a folder, or when the prompt is cancelled or times out. Blocked over SSH.

ws-cli editor download <path> [flags]

FlagDescriptionDefault
--nameFile name for a folder's zip (default <folder>.zip; .zip added when missing)
--zipZip a folder into the temp directory without asking, then download the zipfalse

ws-cli editor list v0.5.0 ​

List the editor's open tabs, with each tab's path, language, and active or dirty state.

ws-cli editor list


ws-cli editor notify v0.5.0 ​

Read a JSON payload from stdin and raise it as a notification in the running editor window. Requires a "message"; optional "detail", "actions", "modal", "timeout", and "severity" tune it. Prints the chosen action (or timeout) as JSON. Blocked over SSH.

ws-cli editor notify

sh
# A simple toast
echo '{"message": "Build finished"}' | ws-cli editor notify

# Ask a question and read the chosen action
echo '{"message": "Deploy now?", "actions": ["Yes", "No"]}' | ws-cli editor notify

ws-cli editor open v0.5.0 ​

Open a file in the running editor window: a tab in the current window by default, a preview tab with --preview, jumping to a range with --selection. Fails fast over SSH, where there is no browser editor to open into.

ws-cli editor open <file> [flags]

FlagDescriptionDefault
--modalOpen in a centered overlay instead of a tabfalse
--new-windowOpen in a new windowfalse
--previewOpen as a preview tab (reuse-window only)false
--reuse-windowOpen in the current window as a tab (default)false
--selectionSelect a range: LINE:COL[-LINE:COL] (1-based)

ws-cli editor reveal v0.6.1 ​

Show and select a workspace file or folder in the editor's Explorer sidebar without opening it, like the Reveal in Explorer View action. Blocked over SSH.

ws-cli editor reveal <path>


ws-cli editor selection v0.5.0 ​

Report the active editor's current selection: file, range, and selected text. Empty when nothing is selected.

ws-cli editor selection


ws-cli editor terminal v0.6.1 ​

Open a new integrated terminal in the running editor window, in the current directory or --cwd, named with --name. Arguments after -- are joined with spaces and run in the new terminal. Blocked over SSH.

ws-cli editor terminal [-- command...] [flags]

FlagDescriptionDefault
--cwdWorking directory for the terminal.
--nameTerminal tab name

ws-cli feature v0.2.0 ​

Install and inspect optional workspace features: Ansible playbooks that add tools on top of the base image. Ships a curated set and picks up your own from ~/.ws/features.d; --root reads features from another directory instead.

FlagDescriptionDefault
--rootRoot directory of additional features
sh
# List the features you can install
ws-cli feature list

# Install one, skipping its VS Code extensions
ws-cli feature install redis --skip-extensions

ws-cli feature info v0.2.0 ​

Show a feature's description and the variables it accepts when it is installed.

ws-cli feature info <name>


ws-cli feature install v0.2.0 ​

Run a feature's playbook to install it. Pass variables with --opt KEY=VAL, and skip parts you do not want with --skip-extensions, --skip-completion, or --skip-repository.

ws-cli feature install <name> [flags]

FlagDescriptionDefault
--optOptional variables to use during installation, from the ones feature info lists[]
--skip-completionSkip configuring shell completionfalse
--skip-extensionsSkip installing VS Code extensionsfalse
--skip-repositorySkip enabling the vendor APT repositoryfalse

ws-cli feature list alias: ls v0.2.0 ​

List the features you can install, marking where each comes from: the shipped set, a workspace override, or your own ~/.ws/features.d.

ws-cli feature list


ws-cli feature new v0.2.0 ​

Print a starter feature playbook to stdout. Redirect it into ~/.ws/features.d/<name>.yaml, extend it, then install it with "ws-cli feature install <name>".

ws-cli feature new [name]

sh
# Start a custom feature in your own features folder
ws-cli feature new redis > ~/.ws/features.d/redis.yaml

ws-cli feature store v0.2.0 ​

List the artifacts published to the feature store (WS_FEATURES_STORE_URL), the offline mirror that features install from when the network is locked down.

ws-cli feature store


ws-cli info v0.2.0 ​

Report facts about the running workspace: version, effective environment, installed extensions, live resource metrics, and uptime.

sh
# Show the full version table
ws-cli info version --all

# Watch live resource usage
ws-cli info metrics

ws-cli info env v0.2.0 ​

Print every WS_* variable in effect, sorted: the resolved environment the workspace booted with.

ws-cli info env


ws-cli info extensions v0.2.0 ​

List the installed VS Code extensions with their versions.

ws-cli info extensions


ws-cli info metrics v0.2.0 ​

Show live resource usage: CPU, memory, disk, and file descriptors, plus GPU with --gpu.

ws-cli info metrics [flags]

FlagDescriptionDefault
--gpuInclude GPU metricsfalse

ws-cli info uptime v0.2.0 ​

Show when the workspace session started and how long it has been running.

ws-cli info uptime


ws-cli info version v0.2.0 ​

Print the workspace version. --all expands to the full table: workspace, ws-cli, and VS Code.

ws-cli info version [flags]

FlagDescriptionDefault
--allShow all version informationfalse

ws-cli log v0.2.0 ​

Emit styled, level-tagged log lines in the same formatting the startup scripts use. --pipe runs each line of piped input through the logger.

FlagDescriptionDefault
--pipe, -pLoop through piped outputfalse
sh
# Emit an info-level line
ws-cli log info "starting up"

# Nest a warning under it with a timestamp
ws-cli log warn "slow response" --indent 1 --stamp

ws-cli log debug v0.2.0 ​

Emit a log line at debug level in the workspace style, the same formatting the startup scripts use. --indent nests it under a preceding line, --stamp prefixes a timestamp.

ws-cli log debug message [flags]

FlagDescriptionDefault
--indent, -iDesired prefixed indentation0
--stamp, -sPrefix message with current timestampfalse

ws-cli log error v0.2.0 ​

Emit a log line at error level in the workspace style, the same formatting the startup scripts use. --indent nests it under a preceding line, --stamp prefixes a timestamp.

ws-cli log error message [flags]

FlagDescriptionDefault
--indent, -iDesired prefixed indentation0
--stamp, -sPrefix message with current timestampfalse

ws-cli log info v0.2.0 ​

Emit a log line at info level in the workspace style, the same formatting the startup scripts use. --indent nests it under a preceding line, --stamp prefixes a timestamp.

ws-cli log info message [flags]

FlagDescriptionDefault
--indent, -iDesired prefixed indentation0
--stamp, -sPrefix message with current timestampfalse

ws-cli log stamp v0.2.0 ​

Print just the current timestamp in the workspace log style, to mark phases in a startup log.

ws-cli log stamp


ws-cli log warn v0.2.0 ​

Emit a log line at warn level in the workspace style, the same formatting the startup scripts use. --indent nests it under a preceding line, --stamp prefixes a timestamp.

ws-cli log warn message [flags]

FlagDescriptionDefault
--indent, -iDesired prefixed indentation0
--stamp, -sPrefix message with current timestampfalse

ws-cli logs v0.2.0 ​

Read a workspace daemon's log: the main log by default, or --target metrics|docker|cloudflared. Filter by --level and limit with --tail.

ws-cli logs [flags]

FlagDescriptionDefault
--follow, -fFollow log output in real-timefalse
--level, -lFilter by log level (debug|info|warn|error)
--tail, -tNumber of lines to show from the end (0 for all)0
--targetLog target to read (main|metrics|docker|cloudflared)main
sh
# Stream errors live, starting from the last 100 lines
ws-cli logs --level=error --tail=100 --follow

# Read a specific target instead of the main log
ws-cli logs --target metrics

ws-cli secrets v0.2.0 ​

Encrypt and decrypt values under a master key, and generate the keys themselves. Encrypted values are what the seed engine's secrets: map stores and decrypts at boot.

FlagDescriptionDefault
--forceOverwrite existing filesfalse
--masterMaster key or path to key file
--modeFile permissions (e.g., 0o600, 384), only when --output is used
--outputWrite output to file instead of stdout
--rawOutput without stylingfalse
sh
# Generate a master key
ws-cli secrets generate master

# Encrypt a value under it
ws-cli secrets encrypt "s3cr3t" --master ~/.ws/master.key

ws-cli secrets decrypt v0.2.0 ​

Decrypt a value produced by encrypt, under the master key. Reads from the argument or stdin (-); writes the plaintext to stdout, or a file with --output.

ws-cli secrets decrypt <encrypted|->


ws-cli secrets encrypt v0.2.0 ​

Encrypt a value under the master key. Reads the plaintext from the argument or stdin (-); writes the ciphertext to stdout, or a file with --output.

ws-cli secrets encrypt <plaintext|->


ws-cli secrets generate v0.2.0 ​

Generate the credentials the workspace needs: a master key for secrets, or a login password hash for the server.


ws-cli secrets generate login v0.2.0 ​

Prompt for a password and print its hash for the workspace server login (WS_AUTH_PASSWORD_HASHED). Store the hash, never the password.

ws-cli secrets generate login


ws-cli secrets generate master v0.2.0 ​

Generate a random master key, printed base64-encoded, for encrypt, decrypt, and the seed engine. --length sets the byte size (default 32).

ws-cli secrets generate master [flags]

FlagDescriptionDefault
--lengthKey length in bytes32

ws-cli secrets materialize v0.5.0 ​

Persist WS_SECRETS_MASTER_KEY to /run/secrets/workspace/secrets/master_key so the key outlives the editor's environment scrub. A no-op when the key is unset or the path already holds one.

ws-cli secrets materialize


ws-cli seed v0.5.0 ​

Copy files and apply small edits from a seed source onto the filesystem at boot. Bare files mirror verbatim; a .seed.yaml manifest overlays behavior (copy, merge, append) and decrypts secrets under the master key. Point --source at a mounted volume to seed a container from durable storage.

FlagDescriptionDefault
--sourceSeed source directory
sh
# Preview what apply would write
ws-cli seed ls --source /mnt/seed

# Apply it, overwriting existing destinations
ws-cli seed apply --source /mnt/seed --force

ws-cli seed apply v0.5.0 ​

Apply the seed source to the filesystem: mirror bare files and run the .seed.yaml operations. Writes only where the destination is missing unless --force; pass destinations to limit the run to those paths.

ws-cli seed apply [dest...] [flags]

FlagDescriptionDefault
--forceOverwrite existing destinationsfalse
--masterMaster key or path to key file

ws-cli seed ls v0.5.0 ​

List what apply would write, without touching the filesystem: each destination with its operation and whether it carries a secret or a template.

ws-cli seed ls


ws-cli seed rotate v0.5.0 ​

Re-encrypt every managed secret from the old master key (--master) to a new one (--new-master), in place. All-or-nothing: it verifies every secret decrypts before writing anything.

ws-cli seed rotate [flags]

FlagDescriptionDefault
--masterCurrent master key or path to key file
--new-masterNew master key or path to key file

ws-cli serve v0.2.0 ​

Run a small local server: the current directory as a static site, the Prometheus metrics, or the workspace tools for AI agents over MCP.

sh
# Serve the current directory
ws-cli serve current

# Serve on a custom port
ws-cli serve current --port 38081

# Serve it and make it public on its proxy-domain host until Ctrl+C
ws-cli serve current --share

# Serve the workspace tools to an AI agent over stdio
ws-cli serve mcp

ws-cli serve current v0.2.0 ​

Serve the current directory over HTTP as a static site, a quick way to preview built files. With --share the site is also public on its proxy-domain host until you stop it.

ws-cli serve current [flags]

FlagDescriptionDefault
--bindBind address0.0.0.0
--port, -pPort to serve assets on38080
--shareAlso make the site public on its proxy-domain host until you stop; dotfiles, directory listings and links leaving the folder answer 404false

ws-cli serve metrics v0.2.0 ​

Serve workspace and container metrics in the Prometheus exposition format, from the collectors chosen with --collectors.

ws-cli serve metrics [flags]

FlagDescriptionDefault
--bindBind address0.0.0.0
--collectorsComma-separated list of collectors to enable (e.g., workspace,container.cpu,gpu)[*]
--port, -pPort to serve metrics on9100

ws-cli show v0.2.0 ​

Resolve and print facts about this workspace instance: settings, IP addresses, and paths. --raw drops the styling for use in scripts.

FlagDescriptionDefault
--rawOutput raw value without stylingfalse
sh
# Resolve a setting by its dotted key
ws-cli show env server.port

# Reverse-tunnel a local port to the workspace node
ws_node_ip=$(ws-cli show ip node --raw); ssh -N -R "3001:${ws_node_ip}:3001" "${ws_node_ip}"

ws-cli show env v0.2.0 ​

Resolve a setting by its dotted key (server.port) and print it with its source and description. The value of a secret setting is shown redacted.

ws-cli show env <KEY> [flags]

FlagDescriptionDefault
--asValidate the shape and emit as one of: bool, int, list (mutex with --value)
--checkCheck whether the variable (or its --deprecated alias) is set, so a startup script can guard on itfalse
--delimiterOverride delimiter for --as=list (defaults to YAML delimiter or space)
--deprecatedDeprecated alias paired with --check
--or-skipExit 1 (not error) on the natural absence of the chosen projectionfalse
--validateAnchored regex each --as=list token must full-match; rejects fail-closed
--valueEmit just the raw resolved value as a single line, for scriptsfalse

ws-cli show ip v0.2.0 ​

Print the workspace's IP addresses: the internal container address or the node it runs on.


ws-cli show ip internal v0.2.0 ​

Print the workspace container's internal IP address.

ws-cli show ip internal


ws-cli show ip node v0.2.0 ​

Print the IP address of the node hosting the workspace.

ws-cli show ip node


ws-cli show path v0.2.0 ​

Print well-known workspace paths: the home root or the VS Code settings file.


ws-cli show path home v0.2.0 ​

Print the workspace home (server root) path.

ws-cli show path home


ws-cli show path vscode-settings v0.2.0 ​

Print the path to the VS Code settings file: the user file by default, or the folder's with --workspace.

ws-cli show path vscode-settings [flags]

FlagDescriptionDefault
--workspaceGet the workspace settingsfalse

ws-cli template v0.2.0 ​

Copy shared configuration files (linters, formatters) from their global locations into a project, and inspect what they hold.

sh
# List available templates
ws-cli template list

# Apply the ruff config to the current project
ws-cli template apply ruff

ws-cli template apply v0.2.0 ​

Copy a template, a shared config like ruff or markdownlint, into the project at --path (the current directory by default). Fails when the file is already there.

ws-cli template apply <template> [flags]

FlagDescriptionDefault
--force, -fOverwrite existing filesfalse
--pathTarget directory path.

ws-cli template list alias: ls v0.2.0 ​

List the templates you can apply, with their source paths and whether one is already applied here.

ws-cli template list


ws-cli template show v0.2.0 ​

Display the contents of a configuration template. Available templates: ansible, markdownlint, ruff, yamllint.

ws-cli template show <template> [flags]

FlagDescriptionDefault
--localShow the local version of the template (if applied)false

Released under the MIT License