| Crates.io | acton-cli |
| lib.rs | acton-cli |
| version | 0.11.0 |
| created_at | 2025-11-11 05:37:54.703748+00 |
| updated_at | 2026-01-12 23:01:50.440274+00 |
| description | CLI tool for scaffolding and managing acton-service backend services |
| homepage | https://github.com/Govcraft/acton-service |
| repository | https://github.com/Govcraft/acton-service |
| max_upload_size | |
| id | 1926731 |
| size | 279,168 |
Production-ready CLI for scaffolding and managing backend services built with the acton-service framework.
✅ Fully Implemented:
acton service add endpoint - Add HTTP endpoints ✨ NEWacton service add worker - Add background workers ✨ NEWacton service generate deployment - Generate K8s manifests ✨ NEW🚧 Planned:
acton service add grpc - Add gRPC servicesacton service add middleware - Add custom middlewareacton service add version - Add API versionsacton service validate - Validate service qualityacton service generate config - Generate configurationacton service generate proto - Generate proto filesacton service dev - Development toolsBuild from source:
cargo build --release -p acton-cli
The binary will be available at target/release/acton.
acton
├── service
│ ├── new <service-name> # Create new service
│ ├── add
│ │ ├── endpoint # Add HTTP endpoint
│ │ ├── grpc # Add gRPC service
│ │ ├── worker # Add background worker
│ │ ├── middleware # Add middleware
│ │ └── version # Add API version
│ ├── generate
│ │ ├── deployment # Generate deployment configs
│ │ ├── config # Generate config file
│ │ └── proto # Generate proto file
│ ├── validate # Validate service
│ └── dev
│ ├── run # Run development server
│ ├── health # Check service health
│ └── logs # View logs
└── [future top-level commands]
acton service new my-service
This will prompt you for:
acton service new my-service \
--http \
--database postgres \
--cache redis \
--observability
acton service new my-service --yes
Creates a minimal HTTP service with defaults.
--http Enable HTTP REST API (default)
--grpc Enable gRPC service
--full Enable both HTTP and gRPC
--database <TYPE> Add database (postgres)
--cache <TYPE> Add caching (redis)
--events <TYPE> Add event streaming (nats)
--auth <TYPE> Add authentication (jwt)
--observability Enable OpenTelemetry tracing
--resilience Enable circuit breaker, retry, etc.
--rate-limit Enable rate limiting
--openapi Generate OpenAPI/Swagger
--template <NAME> Use organization template
--path <DIR> Create in specific directory
--no-git Skip git initialization
-i, --interactive Interactive mode
-y, --yes Accept all defaults
--dry-run Show what would be generated
acton service new todo-api --yes
cd todo-api
cargo run
acton service new user-service \
--http \
--grpc \
--database postgres \
--cache redis \
--events nats \
--auth jwt \
--observability \
--resilience
acton service new gateway \
--full \
--database postgres
my-service/
├── Cargo.toml # Dependencies with correct features
├── config.toml # Complete configuration
├── Dockerfile # Multi-stage build
├── .dockerignore
├── .gitignore
├── README.md # Generated documentation
├── build.rs # Proto compilation (if gRPC)
├── proto/ # Proto files (if gRPC)
└── src/
├── main.rs # Service entry point
└── handlers.rs # HTTP handlers (if HTTP)
The Acton CLI follows these principles:
The CLI is built with:
clap with derive macrosdialoguer for promptshandlebars for code generationindicatif for progress barscolored and console for outputacton-cli/
├── src/
│ ├── main.rs # Entry point
│ ├── commands/
│ │ └── service/ # Service commands
│ │ ├── new.rs # ✅ Implemented
│ │ ├── add/ # 🚧 Stubs
│ │ ├── generate/ # 🚧 Stubs
│ │ ├── validate.rs # 🚧 Stub
│ │ └── dev/ # 🚧 Stubs
│ ├── templates/ # Code generation templates
│ │ ├── service.rs # ✅ main.rs templates
│ │ ├── cargo_toml.rs # ✅ Cargo.toml generation
│ │ ├── config.rs # ✅ config.toml generation
│ │ ├── handlers.rs # ✅ Handler templates
│ │ └── deployment.rs # ✅ Dockerfile templates
│ ├── utils/ # Utilities
│ │ ├── format.rs # Name conversions
│ │ ├── git.rs # Git operations
│ │ └── cargo.rs # Cargo operations
│ └── validator/ # 🚧 Validation logic
└── Cargo.toml
# Development build
cargo build -p acton-cli
# Release build
cargo build --release -p acton-cli
# Run directly
cargo run -p acton-cli -- service new test-api --yes
# Create a test service
./target/debug/acton service new test-service --yes --path /tmp
# Verify it was created
ls -la /tmp/test-service
# Clean up
rm -rf /tmp/test-service
# Add a GET endpoint
acton service add endpoint GET /users --version v1
# Add a POST endpoint with full options
acton service add endpoint POST /users \
--handler create_user \
--model User \
--validate \
--openapi
# Preview what would be generated
acton service add endpoint GET /users/:id --dry-run
# Add a NATS worker
acton service add worker email-worker \
--source nats \
--stream emails \
--subject "emails.>"
# Add a Redis Stream worker
acton service add worker notification-worker \
--source redis-stream \
--stream notifications
# Preview worker generation
acton service add worker my-worker --source nats --stream events --dry-run
# Generate basic Kubernetes manifests
acton service generate deployment
# Generate with autoscaling and monitoring
acton service generate deployment \
--hpa \
--monitoring \
--replicas 3
# Generate complete production setup
acton service generate deployment \
--namespace production \
--hpa \
--monitoring \
--ingress \
--tls \
--registry gcr.io/myproject \
--image-tag v1.0.0
# Preview deployment manifests
acton service generate deployment --dry-run
To continue implementation:
The CLI is designed to be extended. Key extension points:
src/templates/src/commands/service/src/validator/src/utils/MIT