| Crates.io | revoke-cli |
| lib.rs | revoke-cli |
| version | 0.3.0 |
| created_at | 2025-07-13 06:28:17.319166+00 |
| updated_at | 2025-07-13 06:28:17.319166+00 |
| description | Command-line interface for managing Revoke microservices infrastructure |
| homepage | |
| repository | https://github.com/revoke/revoke |
| max_upload_size | |
| id | 1750041 |
| size | 181,484 |
Command-line tool for managing Revoke microservices infrastructure.
cargo install --path .
# List all services
revoke service list
# Register a new service
revoke service register my-service -a 127.0.0.1 -p 8080 -t api -t v1
# Deregister a service
revoke service deregister service-id
# Get service details
revoke service info my-service
# Check service health
revoke service check my-service
# Get configuration value
revoke config get database.url
# Set configuration value
revoke config set database.url "postgres://localhost/mydb"
# Delete configuration
revoke config delete database.url
# List configurations
revoke config list --prefix database
# Watch configuration changes
revoke config watch database.url
# Export configuration
revoke config export -o config.yaml -f yaml
# Import configuration
revoke config import config.yaml
# List routes
revoke gateway routes
# Add a route
revoke gateway add-route /api/users user-service -m GET -m POST
# Remove a route
revoke gateway remove-route route-id
# View statistics
revoke gateway stats
# Test configuration
revoke gateway test -c gateway.yaml
# List recent traces
revoke trace list -r 1h -l 100
# Get trace details
revoke trace get trace-id
# Search traces
revoke trace search "error" -r 24h
# Export traces
revoke trace export traces.json -f json -r 1h
# Check system health
revoke health check --detailed
# Check specific service
revoke health service my-service
# Monitor health status
revoke health monitor -i 5 -s user-service -s order-service
# Initialize a new project
revoke init my-project --template microservice
# Start development environment
revoke dev --all
# Start specific services
revoke dev -s user-service -s order-service
The CLI tool can be configured through:
--configREVOKE_CONFIG~/.config/revoke/config.tomlExample configuration file:
consul_address = "http://localhost:8500"
config_namespace = "revoke"
trace_endpoint = "http://localhost:4317"
default_timeout = 30
-c, --config <FILE>: Specify config file-v, --verbose: Increase verbosity (can be used multiple times)Many commands support different output formats:
table: Table format (default)json: JSON formatyaml: YAML formatExample:
revoke service list --format json
REVOKE_CONFIG: Config file pathCONSUL_ADDR: Consul addressRUST_LOG: Log level# 1. Initialize project
revoke init my-service --template microservice
# 2. Change to project directory
cd my-service
# 3. Start development environment
revoke dev --all
# 4. Check service status
revoke service list
revoke health check
# 5. Configure service
revoke config set my-service.database.url "postgres://localhost/mydb"
revoke config set my-service.cache.ttl "300"
# 6. View service traces
revoke trace list -s my-service
# Real-time health monitoring
revoke health monitor --all
# View gateway statistics
revoke gateway stats
# Search error traces
revoke trace search "status_code:500" -r 1h
# Export configuration backup
revoke config export -o backup.yaml
The init command supports several templates:
basic: Minimal Rust projectmicroservice: Service with HTTP APIgateway: API gateway projectfull-stack: Complete microservices setupCreate custom commands by extending the CLI:
use clap::Parser;
use revoke_cli::commands::CustomCommand;
#[derive(Parser)]
struct MyCommand {
#[arg(short, long)]
name: String,
}
impl CustomCommand for MyCommand {
async fn execute(&self) -> Result<()> {
println!("Hello, {}!", self.name);
Ok(())
}
}
The CLI is designed to be scriptable:
#!/bin/bash
# Deploy script
services=$(revoke service list --format json | jq -r '.[] | .name')
for service in $services; do
echo "Checking $service..."
revoke service check $service
if [ $? -ne 0 ]; then
echo "Service $service is unhealthy!"
exit 1
fi
done
echo "All services are healthy!"
~/.cargo/bin is in PATHEnable debug logging:
RUST_LOG=debug revoke service list
# General help
revoke --help
# Command-specific help
revoke service --help
revoke service list --help