dk CLI

Bootstrap, configure, and diagnose your developer workstation

Quick summary

Datakraften is a YAML-driven CLI that bootstraps and maintains developer workstations across WSL, Linux, and macOS.

Supported platforms

WSLLinuxmacOS (partial support)

Common tasks

Initialize a default config

dk init

Generate a full default config and detect package manager/platform automatically.

Apply the workstation setup

dk apply

Install runtimes, shell tooling, editors, cloud tools, and AI tools from your config.

Diagnose your machine

dk doctor

Check system, tools, runtimes, editors, Docker, and shell state.

Refresh managed tools

dk update

Update Homebrew, fnm, uv, and global npm packages through one command.

dk init

Generate your Datakraften configuration file. Detects your operating system, package manager, and writes ~/.config/datakraften/config.yaml.

$dk init

No arguments creates a default config (source: default) with full tooling defaults.

$dk init --custom

Create a custom config (source: custom) — you own this file. You'll be asked whether to start from an empty skeleton or a pre-filled template. You must edit the file to customize.

$dk init --custom ./my-config.yaml

Create from an existing YAML file. Validates the file, then uses it as your configuration (with source: custom).

$dk init --team https://example.com/team.yaml

Create a thin team config (source: team) pointing to a remote YAML. The remote URL is required.

What it does:

  • Detects platform (WSL, Linux, macOS)
  • Identifies native package manager (apt, dnf, yum, pacman, brew)
  • Generates a YAML config based on the chosen source
  • source: default can overwrite existing; source: custom never overwrites without confirmation

dk apply

Install everything defined in your configuration. Idempotent -- safe to run repeatedly.

$dk apply
$dk apply --dry-run
~ Preview without installing

What it installs:

  • System packages -- via apt, dnf, yum, pacman, or brew
  • Homebrew -- installs brew if missing, then brew packages
  • Runtimes -- Node.js via fnm, Python via uv, Go, .NET SDK
  • Shell -- Fish shell config with managed blocks
  • AI tools -- CLI tools + desktop apps
  • Skips already-installed tools. Uses sudo only for system packages.

Team source: If your config has source: team, dk apply fetches the remote YAML fresh before installing. The remote file is the single source of truth — your local config only stores source: team and url. If the remote YAML is invalid or unreachable, dk apply aborts.

Dry-run mode: Use --dry-run to see what would be installed without making changes:

$dk apply --dry-run
[dry-run] would install system packages: git curl build-essential ...
[dry-run] would install brew packages: fish starship atuin fzf ...
[dry-run] would install Node.js via fnm (LTS)

dk doctor

Run comprehensive diagnostics on your system. Checks every category that dk apply configures.

$dk doctor
$dk doctor --json
~ Machine-readable output

Check categories:

  • System -- distribution, kernel, WSL version, systemd
  • Tools -- git, curl, build tools, Homebrew
  • Runtimes -- Node.js, Python, Go, .NET SDK
  • Editors -- VS Code, Zed, Cursor detection
  • Docker -- daemon status, socket access, WSL integration
  • Shell -- Fish config, Starship prompt, Atuin, FZF

dk status

Quick overview of installed tools and their versions.

$dk status
System: Fedora 40 (WSL2)
Shell: fish 3.7.1
Node: 22.x
Python: 3.12.x
Go: 1.24.x
.NET: 8.0.x
Git: 2.45.x
Brew: 4.x
Docker: running

Config sources

Datakraften supports three config sources. The source determines where your configuration comes from.

**default** — The built-in config embedded in the dk binary. Full tooling defaults for a developer workstation. Run dk init (no args) to recreate it.

**custom** — A local config file you own. Run dk init --custom to create one (empty skeleton or pre-filled template). Edit it freely — dk init --custom never overwrites without asking.

**team** — A thin config pointing to a remote YAML URL. The remote file defines everything. Run dk init --team <url> to set it up. Every dk apply fetches the remote YAML fresh.

$dk init
source: default — full default config
$dk init --custom
? Create config as: Empty skeleton / Pre-filled with defaults
source: custom — you must edit the file to customize
$dk init --team https://example.com/team.yaml
Fetching remote config from https://example.com/team.yaml...
✓ Remote config validated
source: team — thin config, remote is single source of truth
~ The remote URL is required for team config — there is no fallback to a local config. If the remote YAML is invalid or unreachable, dk apply aborts with an error.

dk upgrade

Upgrade the Datakraften CLI to the latest release. Downloads the correct binary for your platform from GitHub, verifies the SHA256 checksum, and performs an atomic replacement.

$dk upgrade
Current version: v0.1.0
Latest version: v0.2.0
Downloading dk-linux-amd64...
Checksum verified ✓
Updated to v0.2.0

How it works:

  • Fetches the latest release from api.github.com
  • Detects your OS and architecture to download the matching binary
  • Verifies the binary against its SHA256 checksum
  • Replaces the current binary atomically
Run dk upgrade periodically to get the latest version of Datakraften.

dk update

Update managed developer tools to their latest versions. Supports updating all tools at once or targeting a specific tool.

$dk update

Update all tools — Homebrew packages, Node.js LTS via fnm, Python via uv, and global npm packages.

Update a specific tool:

$dk update brew
$dk update fnm
$dk update uv
$dk update npm

List available updatable tools:

$dk update --list

Dry-run to preview updates:

$dk update --dry-run

Troubleshooting

Why does `dk apply` stop on a team config?

If the remote YAML is invalid or unreachable, team configs abort by design. Validate the remote file and confirm the URL is accessible before rerunning `dk apply`.

Why does `dk update` fail on npm permissions?

Global npm packages installed into system-owned paths can fail with EACCES. Reinstall them under your user-owned Node/fnm setup or fix ownership before running `dk update` again.

FAQ

Does Datakraften replace apt, brew, fnm, or uv?

No. Datakraften orchestrates existing package managers and runtime tools instead of replacing them.

Is `dk apply` safe to run repeatedly?

Yes. The apply flow is designed to be idempotent and should only install or configure what is missing.

Can I share one config across a team?

Yes. Use a team source that points to a remote YAML URL so every developer gets the same workstation definition.