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
Common tasks
Initialize a default config
dk initGenerate a full default config and detect package manager/platform automatically.
Apply the workstation setup
dk applyInstall runtimes, shell tooling, editors, cloud tools, and AI tools from your config.
Diagnose your machine
dk doctorCheck system, tools, runtimes, editors, Docker, and shell state.
Refresh managed tools
dk updateUpdate 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.
No arguments creates a default config (source: default) with full tooling defaults.
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.
Create from an existing YAML file. Validates the file, then uses it as your configuration (with source: custom).
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.
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 doctor
Run comprehensive diagnostics on your system. Checks every category that dk apply configures.
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.
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 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.
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
dk update
Update managed developer tools to their latest versions. Supports updating all tools at once or targeting a specific tool.
Update all tools — Homebrew packages, Node.js LTS via fnm, Python via uv, and global npm packages.
Update a specific tool:
List available updatable tools:
Dry-run to preview updates:
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.