Skip to main content

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, kubectl, kind, helm automatically)
  • A container runtime (Podman or Docker) — needed for Kind-based integration tests

Step 1: Clone the repository

cd openCenter-cli

Step 2: Install tools via mise

mise reads .mise.toml and installs the required tool versions:

mise install

This installs Go (latest), kubectl, kind, and helm.

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 (internal packages)
mise run test

# BDD tests (Gherkin scenarios via godog)
mise run godog

# Property-based tests
mise run test-properties

# Security-specific tests
mise run test-security

BDD feature files live in tests/features/. Scenarios tagged @wip are skipped by default. To run only WIP scenarios during development:

mise run godog-wip

Step 5: Format and lint

# Format all Go files
mise run fmt

# Tidy module dependencies
mise run tidy

Running gofmt must produce no diff before committing.

Step 6: Install locally (optional)

To install the binary to ~/.local/bin/ for use outside the repo:

mise run local-install

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