CLI Development Setup
Purpose: For contributors, shows how to set up the CLI development environment.
What you'll have at the end
A working Go development environment where you can build the opencenter binary, run unit tests, BDD tests, and property-based tests.
Prerequisites
- Git
- Mise (installs Go 1.26.3, kubectl, kind, helm automatically)
- A container runtime (Podman or Docker) — needed for Kind-based integration tests
Step 1: Clone the repository
git clone https://github.com/opencenter-cloud/openCenter-cli.git
cd openCenter-cli
Step 2: Install tools via Mise
Mise reads .mise.toml and installs the required tool versions:
mise install
This installs Go 1.26.3, kubectl, kind, helm, and other development tools.
Step 3: Build the binary
mise run build
The binary is written to bin/opencenter. Verify it works:
./bin/opencenter version
Step 4: Run the tests
# Unit tests
mise run test
# BDD tests (Gherkin scenarios via godog)
mise run godog
# Property-based tests
mise run test-properties
BDD feature files live in tests/features/. Scenarios tagged @wip are skipped by default. Tags: @wip, @priority1, @priority2.
Step 5: Format and lint
# Format all Go files
mise run fmt
# Lint
mise run lint
Running gofmt must produce no diff before committing.
Step 6: Generate JSON schemas
mise run schema
Regenerates JSON Schema definitions from Go structs.
Step 7: Local Gitea for testing (optional)
For testing Git operations without GitHub:
mise run gitea-up # Start local Gitea instance
mise run gitea-down # Stop it
Check your work
After completing setup, confirm:
./bin/opencenter version # Binary runs
mise run test # Unit tests pass
mise run fmt # No formatting diff
Next steps
- Read CLI Code Structure to understand the package layout
- Read Template Rendering to understand how config becomes infrastructure
- Read Validation System to understand input validation
- Check
tests/features/for BDD scenarios that document expected behavior