caproni-cli

command module
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 5 Imported by: 0

README

caproni

Giovanni Caproni

Caproni is a command-line tool that orchestrates local Kubernetes development environments for GitLab. It provides a simple interface for running GitLab's Cloud Native deployment locally, with first-class support for hot-reload development workflows.

Naming

Caproni is named after Giovanni Caproni: an engineer who built Cloud Native things -- aeroplanes.

Caproni is also featured as a character in Studio Ghibli's film, The Wind Rises.

The Caproni CA3

The Caproni CA3

Command Line Usage

Please review COMMAND_LINE_USAGE.md for full command line usage for the caproni CLI interface.

Design

The original design document describing this initiative is available at docs/design/initial-design.md.

Configuration Overview

Caproni uses a v2 configuration format that separates three key concerns:

Repositories

Git repositories containing source code. Caproni clones and manages these repositories when needed by deployers or reloaders with edit_mode: true.

Deployers

Deploy applications to the Kubernetes cluster. Supported types:

  • Helm - Deploy Helm charts (from local repositories or remote chart repositories)
Reloaders

Run local development processes with hot-reload capabilities:

  • Mirror - Use mirrord for fast hot-reload without rebuilding containers. Provides direct execution of local code against remote Kubernetes resources. Recommended for most development workflows.
  • Skaffold - Use for cases where mirrord doesn't work, such as applications using mmap (like Gitaly's git processes)

See example configurations:

For migration from v1 configuration format, use caproni config migrate.

Hacking on caproni

Development Tasks

The following tasks are available and configured through mise to help with the development process.

$ mise tasks
Name                      Description
build                     Build the caproni binary
clean                     Clean build artifacts
docs                      Generate COMMAND_LINE_USAGE.md documentation
lint                      Run pre-commit hooks (linters)
run                       Build and run caproni
test                      Run all tests
test:short                Run unit tests only (excludes integration tests)
test:integration          Run all integration tests (requires both colima and k3d)
test:integration:colima   Run Colima integration tests (requires colima)
test:integration:k3d      Run k3d integration tests (requires k3d)
test:coverage             Run tests with coverage
test:verbose              Run tests with verbose output
Running Tests

Unit tests (fast, no external dependencies):

mise run test:short
# or
go test -short ./...

Colima integration tests (requires colima to be installed):

mise run test:integration:colima
# or
go test -tags=colima_integration_test ./cmd/...

k3d integration tests (requires k3d to be installed):

mise run test:integration:k3d
# or
go test -tags=k3d_integration_test ./cmd/...

All integration tests (requires both colima and k3d to be installed):

mise run test:integration
# or
go test -tags='colima_integration_test k3d_integration_test' ./cmd/...

All tests (unit + integration):

mise run test
# or
go test ./...
Preparing your Environment
  1. Follow the developer setup guide at https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/developer-setup.md.
  2. Clone this project
  3. Run scripts/prepare-dev-env.sh

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package cmd implements the root command and command factory for the caproni CLI.
Package cmd implements the root command and command factory for the caproni CLI.
config
Package config implements configuration management commands.
Package config implements configuration management commands.
destroy
Package destroy implements the destroy command for destroying the Caproni cluster.
Package destroy implements the destroy command for destroying the Caproni cluster.
gendocs command
Package main provides a tool for generating documentation for the caproni CLI.
Package main provides a tool for generating documentation for the caproni CLI.
run
Package run implements the run command for running reloaders in edit mode.
Package run implements the run command for running reloaders in edit mode.
start
Package start implements the start command for starting the Caproni cluster.
Package start implements the start command for starting the Caproni cluster.
status
Package status implements the status command for displaying service status.
Package status implements the status command for displaying service status.
stop
Package stop implements the stop command for stopping the Caproni cluster.
Package stop implements the stop command for stopping the Caproni cluster.
update
Package update implements the update command for updating repository source code.
Package update implements the update command for updating repository source code.
updateetchosts
Package updateetchosts implements the update-etc-hosts command for managing /etc/hosts entries.
Package updateetchosts implements the update-etc-hosts command for managing /etc/hosts entries.
version
Package version implements the version command for displaying build information.
Package version implements the version command for displaying build information.
internal
backends/git
Package git provides git repository operations.
Package git provides git repository operations.
backends/git/mocks
Package git provides auto-generated mocks for the git.Backend interface.
Package git provides auto-generated mocks for the git.Backend interface.
backends/helm
Package helm provides helm operations.
Package helm provides helm operations.
backends/helm/mocks
Package helm provides auto-generated mocks for the helm.Backend interface.
Package helm provides auto-generated mocks for the helm.Backend interface.
backends/hosts
Package hosts provides a backend interface for /etc/hosts file management.
Package hosts provides a backend interface for /etc/hosts file management.
backends/hosts/mocks
Package hosts provides auto-generated mocks for the hosts.Backend interface.
Package hosts provides auto-generated mocks for the hosts.Backend interface.
backends/kubectl
Package kubectl provides kubectl operations.
Package kubectl provides kubectl operations.
backends/kubectl/mocks
Package kubectl provides auto-generated mocks for the kubectl.Backend interface.
Package kubectl provides auto-generated mocks for the kubectl.Backend interface.
backends/skaffold
Package skaffold provides skaffold operations.
Package skaffold provides skaffold operations.
backends/skaffold/mocks
Package skaffold provides auto-generated mocks for the skaffold.Backend interface.
Package skaffold provides auto-generated mocks for the skaffold.Backend interface.
buildinfo
Package buildinfo provides build-time information injected via ldflags.
Package buildinfo provides build-time information injected via ldflags.
cluster
Package cluster provides interfaces and implementations for managing local Kubernetes clusters.
Package cluster provides interfaces and implementations for managing local Kubernetes clusters.
cluster/colima
Package colima provides a cluster.Manager implementation using Colima.
Package colima provides a cluster.Manager implementation using Colima.
cluster/k3d
Package k3d provides a cluster.Manager implementation using k3d.
Package k3d provides a cluster.Manager implementation using k3d.
cluster/mock
Package mock provides a mock cluster driver implementation for testing.
Package mock provides a mock cluster driver implementation for testing.
config
Package config provides global configuration management via context propagation.
Package config provides global configuration management via context propagation.
config/types
Package types contains shared configuration types used across config versions.
Package types contains shared configuration types used across config versions.
config/v1
Package v1 provides configuration structures for Caproni v1 format.
Package v1 provides configuration structures for Caproni v1 format.
config/v2
Package v2 provides configuration structures for Caproni v2 format.
Package v2 provides configuration structures for Caproni v2 format.
deployer
Package deployer provides interfaces and implementations for deploying applications to the Caproni cluster.
Package deployer provides interfaces and implementations for deploying applications to the Caproni cluster.
deployer/helm
Package helm provides a Helm chart deployer implementation.
Package helm provides a Helm chart deployer implementation.
docgen
Package docgen provides utilities for generating documentation from CLI applications.
Package docgen provides utilities for generating documentation from CLI applications.
executil
Package executil provides utilities for executing external processes with logging.
Package executil provides utilities for executing external processes with logging.
logging
Package logging provides structured logging using log/slog with configurable output format, color support, and output destinations.
Package logging provides structured logging using log/slog with configurable output format, color support, and output destinations.
logging/cliflags
Package cliflags provides urfave/cli/v3 flag definitions for the logging package.
Package cliflags provides urfave/cli/v3 flag definitions for the logging package.
mirrord
Package mirrord provides functionality for generating mirrord configuration files.
Package mirrord provides functionality for generating mirrord configuration files.
orderedmap
Package orderedmap provides a generic ordered map that preserves insertion order and supports YAML and JSON marshaling/unmarshaling.
Package orderedmap provides a generic ordered map that preserves insertion order and supports YAML and JSON marshaling/unmarshaling.
reloader
Package reloader provides interfaces and implementations for running local development processes with hot-reload capabilities.
Package reloader provides interfaces and implementations for running local development processes with hot-reload capabilities.
reloader/mirror
Package mirror implements the reloader manager for mirror reloaders.
Package mirror implements the reloader manager for mirror reloaders.
reloader/skaffold
Package skaffold implements the reloader manager for skaffold reloaders.
Package skaffold implements the reloader manager for skaffold reloaders.
repository
Package repository provides interfaces and implementations for managing repository deployments in the Caproni cluster.
Package repository provides interfaces and implementations for managing repository deployments in the Caproni cluster.
repository/git
Package git provides a repository manager for basic git operations.
Package git provides a repository manager for basic git operations.
update
Package update provides repository update orchestration and output formatting.
Package update provides repository update orchestration and output formatting.
Package schema provides embedded access to JSON schema files.
Package schema provides embedded access to JSON schema files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL