CLI tool for managing Qluster platform resources.
qctl is a command-line interface for managing Qluster deployments, datasets, ingestion pipelines, and related resources. It supports multiple deployment contexts, allowing you to manage different Qluster environments from a single CLI.
# Build the binary
make build
# Install to GOPATH/bin
make installThe binary will be created as qctl in the current directory (or installed to $GOPATH/bin with make install).
If you are running our atlas backend locally, then:
cp .envrc.example .envrc
You can tell your Go CLI to trust your mkcert root specifically for development without changing the code. Go respects the standard SSL_CERT_FILE environment variable
# Create a context for your local development environment
qctl config set-context dev \
--server http://localhost:8000 \
--user dev@example.com \
--output table
# Create a context for production
qctl config set-context prod \
--server https://api.qluster.example \
--user admin@company.com
# List all contexts
qctl config list-contexts
# Switch to a different context
qctl config use-context prod
# View current context
qctl config current-context--server <url>- Override the current context's server URL--user <email>- Override the current context's user email--output <format>- Output format:table,json,yaml, orname--allow-insecure-http- Allow non-localhost HTTP endpoints (use with caution)--config <path>- Custom config file location (default:~/.qctl/config)
- Go 1.25.4 or later
- Make
Run the complete test suite with race detection and coverage:
make testThis will:
- Run all unit tests with the
-raceflag to detect race conditions - Generate a coverage report in
coverage.out - Display verbose test output
After running tests, you can view detailed coverage:
# View coverage in terminal
go tool cover -func=coverage.out
# Generate HTML coverage report
go tool cover -html=coverage.out# Test a specific package
go test -v ./internal/config
# Test with coverage for a specific package
go test -v -coverprofile=coverage.out ./internal/config
# Run a specific test
go test -v -run TestValidateServer ./internal/configgo test -v ./...After a failing run, you can re-run just the failures (similar to pytest --lf):
make test TEST_ARGS=--lfBecause make treats leading dashes as its own flags, pass test flags via TEST_ARGS. Use --last-failed interchangeably with --lf.
The project uses oapi-codegen to generate a Go client from the backend's OpenAPI specification.
# Generate client (downloads spec from localhost:8000 by default)
make generate-client
# Generate from a custom API URL
make generate-client API_URL=https://api.example.com/api/docs/openapi.json
# Force re-download of the OpenAPI spec
make clean-openapi && make generate-clientThe generation process:
- Downloads the OpenAPI spec from the API server
- Converts from OpenAPI 3.1 to 3.0.3 format (for compatibility)
- Generates Go types and client code using oapi-codegen
WARNING: The generated file
internal/api/client.gen.gomust NEVER be manually modified. All changes must go through the code generator by updating the OpenAPI spec or the generator configuration (internal/api/oapi-codegen.yaml). If you need custom behavior, create wrapper types or helper functions in separate files.
# Format code
make fmt
# Tidy go modules
make tidy
# Run linter (requires golangci-lint)
make lint
# Clean build artifacts
make clean
# Show all available targets
make helpConfiguration is stored in ~/.qctl/config (YAML format).
apiVersion: qctl/v1
currentContext: dev
contexts:
dev:
server: http://localhost:8000
user: dev@example.com
output: table
prod:
server: https://api.qluster.example
user: admin@company.com
output: json
organization: "550e8400-e29b-41d4-a716-446655440000"
organizationName: "Acme Corp"QCTL_SERVER- Override server URLQCTL_USER- Override user emailQCTL_ORG- Override organization (ID or name)QCTL_INSECURE_HTTP- Allow insecure HTTP endpoints (set to1ortrue)
Enable tab-completion for commands, flags, and arguments.
qctl completion installThis auto-detects your shell and installs the completion script to the appropriate location.
If automatic installation doesn't work, see shell-specific instructions:
qctl completion bash --help
qctl completion zsh --help
qctl completion fish --help
qctl completion powershell --helpqctl uses a kubectl-style command structure where verbs are top-level commands:
qctl <verb> <resource> [flags]
# List resources
qctl get tables
qctl get ingestion-jobs
qctl get files
qctl get destinations
# Show resource details
qctl describe table <id>
qctl describe ingestion-job <id>
qctl describe file <id># Run ingestion jobs
qctl run ingestion-job <id>
qctl run ingestion-job --filter table-id=5
# Kill running jobs
qctl kill ingestion-job <id>
qctl kill ingestion-job --filter state=running
# File operations
qctl upload file data.csv --table-id 123
qctl download file <id> --output /path/to/file
qctl delete file <id>
qctl undelete file <id>
# Apply configurations from files
qctl apply destination -f config.yaml
qctl apply rules -f rules.pyqctl/
cmd/qctl/ # Main entry point
internal/
config/ # Configuration management
commands/ # Command implementations
root/ # Root command
get/ # List resources
describe/ # Show resource details
run/ # Run operations
kill/ # Kill operations
upload/ # Upload operations
download/ # Download operations
delete/ # Delete operations
undelete/ # Restore operations
apply/ # Apply configurations
config/ # Config subcommands
auth/ # Authentication
completion/ # Shell completions
version/ # Version command
version/ # Version info
Makefile # Build targets
go.mod # Go dependencies
See CONTRIBUTING.md for contribution guidelines.