Installation¶
This guide covers how to install the dk CLI on your machine.
Quick Install¶
From Source (Recommended)¶
Build the latest version from source:
# Clone the repository
git clone https://github.com/Infoblox-CTO/platform.data.kit.git
cd datakit
# Build and install the CLI (installs to ~/go/bin by default)
make build-cli && make install
# Verify dk is on your PATH
which dk
dk version
Add to PATH¶
By default make install places the binary in ~/go/bin. Ensure that directory is on your PATH:
To install elsewhere, override DESTDIR:
Verify Installation¶
Confirm the CLI is installed correctly:
Expected output:
Shell Completion¶
Enable tab completion for your shell:
Configuration¶
Default Settings¶
The CLI uses sensible defaults, but you can customize behavior with environment variables:
# Set default output format
export DK_OUTPUT_FORMAT=json
# Set log level
export DK_LOG_LEVEL=debug
# Set default registry
export DK_REGISTRY=ghcr.io/my-org
Configuration File (Optional)¶
Create a configuration file at ~/.dk/config.yaml:
Troubleshooting¶
Command Not Found¶
If you get command not found: dk:
- Re-run the install:
make install - Verify it was installed:
ls ~/go/bin/dk - Check your PATH includes
~/go/bin:echo $PATH - Or install to a directory already on your PATH:
make install DESTDIR=/usr/local/bin
Build Errors¶
If make build fails:
- Verify Go version:
go version(requires 1.22+) - Update dependencies:
go mod download - Check for Go environment issues:
go env
Permission Denied¶
If you get permission errors:
# Install to a user-writable location (default)
make install
# Or fix permissions on the installed binary
chmod +x ~/go/bin/dk
Upgrading¶
To upgrade to the latest version:
cd datakit
# Pull latest changes
git pull origin main
# Rebuild and reinstall
make build && make install
# Verify new version
dk version
Uninstalling¶
To remove the DK CLI:
Next Steps¶
Now that the CLI is installed, run through the quickstart: