Rapt

Rapt (from pronunciation of "wrapped") is a CLI utility written in Go that orchestrates running predefined jobs (commands or tools) in a Kubernetes environment.
Overview
Rapt enables you to define, manage, and execute jobs in Kubernetes clusters using a simple command-line interface. It is designed to streamline workflows by providing a consistent and extensible way to run and manage containerized tasks.
Features
- Kubernetes Integration: Native support for Kubernetes clusters
- Custom Resource Definitions: Uses CRDs to define and manage tools
- Simple CLI Interface: Easy-to-use command-line interface
- Extensible: Define custom tools with flexible configuration
- Namespace Support: Work with specific Kubernetes namespaces
Installation
From Source
git clone https://codeberg.org/lig/rapt.git
cd rapt
go build -o rapt main.go
sudo mv rapt /usr/local/bin/
Using Go Install
go install codeberg.org/lig/rapt@latest
Quick Start
-
Initialize Rapt in your cluster:
rapt init
-
Add a tool definition:
rapt add my-tool --image alpine:latest --command "echo hello world"
-
Run a tool:
rapt run my-tool
-
Clean up:
rapt purge
Commands
rapt init
Install the Rapt CRD in your Kubernetes cluster. This command sets up the necessary CustomResourceDefinition so that Rapt can manage and orchestrate predefined jobs in your cluster.
rapt init [--namespace <namespace>]
rapt add
Add a new tool definition to your cluster. Tools are defined using Kubernetes Custom Resources.
rapt add <tool-name> [flags]
Flags:
--image: Container image to run
--command: Command to execute (overrides ENTRYPOINT)
--env: Environment variables (format: KEY=VALUE)
--help-text: Help message for the tool
--arg: Tool arguments (format: name:description:required:default)
rapt purge
Remove the Rapt CRD and all associated resources from your Kubernetes cluster.
rapt purge [--namespace <namespace>]
⚠️ Warning: This operation is destructive and cannot be undone.
Tools are defined using Kubernetes Custom Resources with the following schema:
apiVersion: rapt.dev/v1alpha1
kind: Tool
metadata:
name: my-tool
spec:
help: "Description of what this tool does"
arguments:
- name: "input"
description: "Input file path"
required: true
- name: "output"
description: "Output file path"
required: false
default: "output.txt"
jobTemplate:
image: "alpine:latest"
command: ["sh", "-c", "echo 'Hello from my-tool'"]
env:
- name: "ENV_VAR"
value: "example-value"
Examples
rapt add echo-tool \
--image alpine:latest \
--command "echo" \
--arg "message:Message to echo:true:" \
--help-text "Echo a message"
rapt add db-migrate \
--image postgres:15 \
--command "psql" \
--env "PGHOST=db-service" \
--env "PGUSER=migrator" \
--arg "database:Database name:true:" \
--arg "script:Migration script path:true:" \
--help-text "Run database migrations"
Development
Prerequisites
- Go 1.24 or later
- Kubernetes cluster (minikube, kind, or cloud provider)
- kubectl configured to access your cluster
Building from Source
git clone https://codeberg.org/lig/rapt.git
cd rapt
go mod download
go build -o rapt main.go
Running Tests
go test ./...
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
Support
Roadmap
For detailed development plans and future features, see our ROADMAP.md.
Recent Achievements:
- ✅ Complete MVP functionality with all essential commands
- ✅ Real-time log streaming in
rapt run
- ✅ Comprehensive job log management with
rapt logs
- ✅ Enhanced job naming with readable timestamps
Author: Serge Matveenko lig@countzero.co