Skip to content

Latest commit

Β 

History

History
96 lines (63 loc) Β· 1.97 KB

File metadata and controls

96 lines (63 loc) Β· 1.97 KB

Contributing

Prerequisites

  • Go 1.25+
  • Git
  • Task (or GNU Make, which wraps Task transparently)

Enable Remote Taskfiles:

export TASK_X_REMOTE_TASKFILES=1

Building

Build the CLI binary:

task cli

The binary is placed at dist/unikraft.

To generate documentation (Markdown docs and man pages):

# Generate all docs
task docs

# Generate man pages only
task docs:man

# Generate markdown docs only
task docs:mdx

Output is placed in dist/docs/ and dist/man/.

Running tests

Run unit tests:

task test

Run offline golden (snapshot) tests:

task golden

If golden test expectations change, update them:

task golden-update

Never edit files in testdata/ manually β€” always use task golden-update to regenerate them.

Run integration tests (requires cloud credentials):

task integration

Run the linter:

task lint

Run tests and linting locally before pushing; CI also runs them.

Releasing

Releases are performed by merging into the prod-stable branch and pushing it. CI automatically determines the git tag β€” no manual tagging is needed.

Architecture

The CLI follows a resource-oriented architecture:

  • Commands (internal/cmd/) β€” Kong-based command definitions with subcommand routing
  • Resources (internal/resource/) β€” Unified interface for API objects with field introspection
  • Multi-Metro (internal/multimetro/) β€” Client abstraction for global infrastructure operations
  • Configuration (internal/config/) β€” Profile and credential management
  • Telemetry (internal/telemetry/) β€” Anonymous usage analytics (opt-out via --no-telemetry)

Key Dependencies