A Cobra-based CLI application for managing Kind clusters and Crossplane providers. This project enables the creation of a local development environment for Crossplane-based work such as composition creation, testing, and development.
This should not require the installation of Crossplane or Crossplane's dependencies nor kind. However, it is typical to have these installed on your local machine.
- Installation
- Getting Started
- CLI Commands
- Kind Cluster Management
- Crossplane Provider Management
- Development
- Project Structure
- Go 1.23.2 or later
- Docker (for Kind clusters)
- Make
- GoReleaser (optional, for releases)
Pre-built binaries are available for download from the releases page.
The easiest way to install Crosslab is using the install script:
curl -fsSL https://raw.githubusercontent.com/kanzifucius/crosslab-cli/main/install.sh | shTo build from source:
git clone https://github.com/kanzifucius/crosslab-cli.git
cd crosslab-cli
make buildThe binary will be available in the dist directory. MacOS and Linux users can use the crosslab binary directly, while Windows users will need to use the crosslab.exe binary.
After installation, you can initialize Crosslab with:
crosslab initThis will create the necessary configuration files in the current directory (or specify a different directory with --output-dir).
crosslab- Root commandcrosslab version- Show the CLI versioncrosslab init- Initialize configuration files--output-dir, -o- Output directory for configuration files (default: current directory)
crosslab cluster- Manage Kind clusterscreate- Create a new Kind clusterdelete- Delete a Kind clusterlist- List all Kind clusters
crosslab provider- Manage Crossplane providersinstall- Install a specific providerinstall-all- Install all required providerslist- List installed providers
crosslab cluster create --config examples/config/kind-config.yaml --name my-clustercrosslab cluster delete --name my-clustercrosslab cluster listAn example Kind cluster configuration is provided in examples/config/kind-config.yaml. This configuration creates a cluster with:
- 1 control plane node
- 2 worker nodes
- Port mappings for HTTP (80 → 8080) and HTTPS (443 → 8443)
- Custom pod and service subnets
Providers are configured in a YAML file. The default location is .crosslab/providers.yaml, but you can specify a different file with the --config flag.
The configuration structure is:
aws:
family:
name: string # Provider name
package: string # Provider package
version: string # Provider version
services:
- name: string # Service provider name
package: string # Service provider package
version: string # Service provider version
otherProviders:
- name: string # Provider name
package: string # Provider package
version: string # Provider versionAn example configuration is available at examples/config/crosslab-config.yaml.
# Install new provider
crosslab provider install \
--name provider-aws \
--package xpkg.upbound.io/upbound/provider-aws \
--version v1.0.0
# Force reinstall existing provider
crosslab provider install \
--name provider-aws \
--package xpkg.upbound.io/upbound/provider-aws \
--version v1.0.0 \
--forceThis command will install all providers defined in the configuration file:
# Install new providers using default config
crosslab provider install-all
# Install new providers using specific config
crosslab provider install-all --config path/to/providers.yaml
# Force reinstall all providers
crosslab provider install-all --forcecrosslab provider listmake build- Build the application using GoReleasermake run- Run the applicationmake dev- Build and run the applicationmake test- Run testsmake clean- Clean build artifacts
make fmt- Format codemake lint- Run linter
make mod-download- Download all dependenciesmake mod-tidy- Tidy the go.mod and go.sum filesmake mod-verify- Verify dependenciesmake mod-update- Update all dependenciesmake mod-init- Initialize a new modulemake mod-graph- Show module dependency graph
make release- Create a new release using GoReleasermake install-goreleaser- Install GoReleasermake install-binary- Install binary from GitHub releases
Using Make:
make runOr using Go directly:
go run main.goThe CLI supports the following platforms:
- Linux (amd64, arm64)
- Windows (amd64, arm64)
- macOS (amd64, arm64)
The project uses GoReleaser for automated releases with the following workflow:
- Snapshot builds for main and feature branches
- Pre-release builds for release candidates
- Full releases for version tags
Release artifacts include:
- Binary builds for all supported platforms
- Checksums for verification
- Source code archives
- Changelog generation
.
├── Makefile # Build and development commands
├── README.md # This file
├── cmd/ # CLI commands
│ └── crosslab/ # Command implementations
├── pkg/ # Core functionality
│ └── common/ # Shared utilities
├── examples/ # Example configurations
│ └── config/ # Configuration examples
├── .crosslab/ # Default configuration directory
├── go.mod # Go module definition
└── main.go # Application entry point