Skip to content

Features ​

Features add optional tools to the workspace when you need them, so the base image stays lean. Each feature is an Ansible playbook that ws-cli runs to install and configure the tool.

Install a Feature ​

Install a feature when a container first starts, or by hand in a running workspace.

Install at Boot ​

When a container first starts, Kloud Workspace installs the features listed in:

  • WS_FEATURES_ADDITIONAL_FEATURES: Installs additional features when a new container starts.
sh
docker run \
  -e WS_FEATURES_ADDITIONAL_FEATURES="dotnet jupyter" \
  ghcr.io/kloudkit/workspace:v0.6.2

Manual Installation ​

To install a feature by hand, run ws-cli feature install:

sh
ws-cli feature install php

A feature installs into the container, not into a persistent volume, so a recreated container no longer has it. List the features you always need in WS_FEATURES_ADDITIONAL_FEATURES to install them on every new container.

Find a Feature ​

ws-cli lists the features you can install and the options each one takes:

sh
ws-cli feature list
ws-cli feature info dotnet
  • feature list: every feature by name, marking your own and overridden playbooks.
  • feature info <name>: the feature's description and the variables it accepts.
  • feature store: the artifacts in the configured feature store.

The built-in playbooks are in the /usr/share/workspace/features.d directory.

Optional Variables ​

Some playbooks accept variables for customization, the ones ws-cli feature info lists. Pass them with the --opt flag (equivalent to Ansible's --extra-vars), zero or more times:

sh
ws-cli feature install dotnet --opt version=9.0

Skipping Sections ​

Beyond the core tool, a playbook may also install VS Code extensions, configure shell completion, or enable a vendor APT repository. Skip any of these with the matching flag; the tool itself still installs:

sh
ws-cli feature install bun --skip-extensions --skip-completion
FlagSkips
--skip-extensionsVS Code extension installs
--skip-completionShell completion setup
--skip-repositoryVendor APT repository enablement

⚠️ WARNING

--skip-repository skips enabling the vendor APT repository the package install then reads from.

Use it only when the package is already present or mirrored through a feature store.

Options at Boot ​

At boot, pass options through the per-feature WS_FEATURES_<NAME>_OPTS variable. <NAME> is the feature name in upper case, with - replaced by _ (image-extras reads WS_FEATURES_IMAGE_EXTRAS_OPTS). It holds one or more key=value pairs joined with ;, and each pair becomes one --opt. A skip flag becomes skip_<section>=true:

sh
docker run \
  -e WS_FEATURES_DOTNET_OPTS="version=9.0" \
  -e WS_FEATURES_BUN_OPTS="skip_extensions=true;skip_completion=true" \
  -e WS_FEATURES_ADDITIONAL_FEATURES="dotnet bun" \
  ghcr.io/kloudkit/workspace:v0.6.2

Custom Features ​

Save your own playbooks under ~/.ws/features.d/ and install them by name, exactly like the built-in features, with no --root needed.

The directory is searched alongside the built-in features; if a name exists in both, your copy wins, so you can override a shipped feature by dropping a same-named playbook there.

Scaffold a starting playbook with ws-cli feature new and redirect it into place. Keep hosts: workspace and gather_facts: false unchanged, then extend the tasks: block.

sh
ws-cli feature new redis > ~/.ws/features.d/redis.yaml
yaml
---
- name: Install redis
  gather_facts: false
  hosts: workspace

  tasks:
    - name: Say hello
      ansible.builtin.debug:
        msg: Hello world! 👋
sh
ws-cli feature install redis

To install a playbook from a different directory instead, point --root at it. Any directory you have access to works, and only that directory is searched. This command looks for a playbook at /alternate/php.yaml:

sh
ws-cli feature install php --root /alternate

Features Directory ​

ws-cli reads the built-in playbooks from the directory in this variable, alongside ~/.ws/features.d:

  • WS_FEATURES_DIR: Directory path where additional features are located.

Point it at a directory of your own playbooks to replace the shipped set for every ws-cli feature command.

Available Features ​

ℹ️ INFO

To suggest a feature or contribute one, see the contribution guide.

A ✅ in the Store column marks a feature the feature store carries.

FeatureDescriptionSinceStore
additional-apt →Extra APT packages by namev0.4.0
bunBun JavaScript runtime and package managerv0.2.0✅
cloudflared →Cloudflare tunnel CLI✅
codexcodex CLIv0.0.20
conanConan CLI and related tools
continuecn CLI and continue extensionv0.0.21
cpp →C++ and related tools✅
daggerdagger.io CLI and SDK
doctlDigitalOcean CLIv0.2.0
dotnet →.NET SDK, runtime, and ASP.NET Core✅
gcloudGoogle Cloud CLI for GCP✅
gh →GitHub CLI✅
glabGitLab CLIv0.2.0✅
helm-extrasHelm plugins and related extensionsv0.2.0✅
image-extras →syft, grype, dive, osv-scannerv0.3.0
jfJFrog CLI✅
jupyterJupyter packages and related extensions
ocOpenShift CLIv0.2.0✅
opencodeOpenCode CLI and related extensionv0.1.1
phpPHP and related extensions✅
rclonerclone CLI✅
resticRestic CLI✅
rust →Rust and Cargo
snykSnyk CLI and related extensionv0.0.20
sopsSOPS CLIv0.0.21✅
talosTalos CLI✅
terraformTerraform packages and related extensions✅
tsharkWireshark terminal CLIv0.3.0✅

Feature Store ​

To install features from a mirror on your own network instead of from each vendor, run a feature store and point the workspace at it.

Released under the MIT License