Complete reference for all Rohas CLI commands and options.
Install Rohas CLI using the recommended installation script:
curl -fsSL https://raw.githubusercontent.com/rohas-dev/rohas/main/scripts/build.sh | bash
This will automatically install all dependencies and build Rohas CLI.
Verify installation:
rohas version
rohas initInitialize a new Rohas project with a complete project structure.
Usage:
rohas init <name> [--lang <lang>] [--example <name>]
Arguments:
name (required) - Project name and directoryOptions:
--lang, -l - Runtime language: typescript or python (default: typescript)--example, -e - Initialize with example code (optional)Examples:
# Create TypeScript project rohas init my-app --lang typescript # Create Python project rohas init my-app --lang python # Create with example rohas init my-app --lang python --example hello-world
What it creates:
config/rohas.toml)Next step: After running rohas init, you should run rohas codegen to generate type-safe code from the example schemas.
rohas codegenGenerate type-safe code from schema definitions.
Usage:
rohas codegen [--schema <path>] [--output <path>] [--lang <lang>]
Options:
--schema, -s - Schema directory path (default: schema)--output, -o - Output directory for generated code (default: src)--lang, -l - Target language: typescript or python (optional, uses config if not specified)Examples:
# Generate from default schema directory rohas codegen # Generate from custom schema path rohas codegen --schema ./schemas --output ./generated # Generate for specific language rohas codegen --lang python
What it generates:
Note: Always run rohas codegen after modifying schema files.
rohas validateValidate schema files for syntax and semantic errors.
Usage:
rohas validate [<schema-path>]
Arguments:
schema-path - Path to schema file or directory (default: schema)Examples:
# Validate default schema directory rohas validate # Validate specific file rohas validate schema/api/user.ro # Validate custom directory rohas validate ./my-schemas
What it checks:
.ro filesExit codes:
0 - Validation successful1 - Validation failed with errorsrohas devStart the development server with hot reload and file watching.
Usage:
rohas dev [--schema <path>] [--port <port>] [--watch] [--workbench] [--workbench-dev]
Options:
--schema, -s - Schema directory path (default: schema)--port, -p - Server port number (default: 3000)--watch - Enable file watching for hot reload (default: true)--workbench - Enable workbench dashboard UI--workbench-dev - Enable workbench in development modeExamples:
# Start on default port rohas dev # Start on custom port rohas dev --port 4000 # Start with workbench rohas dev --workbench # Disable file watching rohas dev --watch false
Features:
Server endpoints:
http://localhost:3000 - API serverhttp://localhost:3000/workbench - Workbench UI (if enabled)ws://localhost:3000/ws - WebSocket connectionsrohas list-handlersList all handlers (APIs, events, crons) defined in schemas.
Usage:
rohas list-handlers [<schema-path>]
Arguments:
schema-path - Path to schema file or directory (default: schema)Examples:
# List all handlers rohas list-handlers # List from specific directory rohas list-handlers ./schemas
Output format:
API Handlers: - CreateUser (POST /users) - GetUser (GET /users/:id) - Health (GET /health) Event Handlers: - UserCreated (handlers: ["send_welcome_email", "update_analytics"]) - OrderPlaced (handlers: ["process_payment"]) Cron Jobs: - DailyCleanup (0 0 * * *) - WeeklyReport (0 0 * * 0)
rohas list-eventsList all events with their payloads and handlers.
Usage:
rohas list-events [<schema-path>]
Arguments:
schema-path - Path to schema file or directory (default: schema)Examples:
# List all events rohas list-events # List from specific file rohas list-events schema/events/user_events.ro
Output format:
Events: UserCreated Payload: User Handlers: ["send_welcome_email", "update_analytics"] Triggers: [] OrderPlaced Payload: Order Handlers: ["process_payment", "send_confirmation"] Triggers: ["OrderProcessed"]
rohas versionDisplay version information.
Usage:
rohas version
Output:
rohas 0.1.0
All commands support these global options:
--help, -h - Show help message--verbose - Enable verbose logging--quiet - Suppress non-error outputROHAS_LOG_LEVEL - Set log level: trace, debug, info, warn, errorROHAS_CONFIG_PATH - Override config file pathROHAS_SCHEMA_PATH - Override default schema pathrohas validaterohas codegenrohas dev --workbenchrohas list-handlers