koco CLI
The Kodosumi CLI (koco) provides various commands for managing and running Kodosumi services.
Overview
koco --version # Shows version
koco --help # Shows help for all commandsCommands
spool
Manages the Spooler service, which is responsible for processing flows.
koco spool [OPTIONS]Options:
--ray-server TEXT- Ray Server URL--log-file TEXT- Spooler log file path--log-file-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]- Spooler log file level--level [DEBUG|INFO|WARNING|ERROR|CRITICAL]- Screen log level--exec-dir TEXT- Execution directory--interval FLOAT- Spooler polling interval (min: 0)--batch-size INTEGER- Batch size for spooling (min: 1)--timeout FLOAT- Batch retrieval timeout (min: 0)--start/--stop- Start/stop spooler (default: start)--block- Run spooler in foreground (blocking mode)--status- Check if spooler is connected and running
Examples:
# Start spooler
koco spool
# Check spooler status
koco spool --status
# Run spooler in foreground with custom configuration
koco spool --block --interval 5.0 --batch-size 10serve
Starts the Kodosumi panel API and application.
koco serve [OPTIONS]Options:
--address TEXT- App server URL--log-file TEXT- App server log file path--log-file-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]- App server log file level--level [DEBUG|INFO|WARNING|ERROR|CRITICAL]- Screen log level--uvicorn-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]- Uvicorn log level--exec-dir TEXT- Execution directory--reload- Reload app server on file changes--register TEXT- Register endpoints (can be used multiple times)
Examples:
# Start server
koco serve
# Start server with reload and custom address
koco serve --reload --address 0.0.0.0:8000
# Start server with flow registration
koco serve --register flow1 --register flow2start
Starts both the spooler and app server in a single execution.
koco start [OPTIONS]Options:
--exec-dir TEXT- Execution directory--register TEXT- Register endpoints (can be used multiple times)
Examples:
# Start complete service
koco start
# With custom execution directory
koco start --exec-dir /path/to/flowsdeploy
Manages deployments of Kodosumi configurations.
koco deploy [OPTIONS]Options:
-f, --file TEXT- Configuration YAML file-r, --run- Execute deployment-d, --dry-run- Test deployment configuration-x, --shutdown, --stop- Shutdown service-s, --status- Show service status-j, --json- Format output as JSON
Examples:
# Check deployment status
koco deploy --status
# Test deployment configuration
koco deploy --dry-run -f config.yaml
# Execute deployment
koco deploy --run -f config.yaml
# Shutdown service
koco deploy --shutdown
# Output status as JSON
koco deploy --status --jsonConfiguration
The CLI commands use the same configuration options as the Kodosumi application. These can be set via environment variables or command line parameters.
Important environment variables:
RAY_SERVER- Ray Server URLEXEC_DIR- Execution directorySPOOLER_INTERVAL- Spooler polling intervalSPOOLER_BATCH_SIZE- Batch sizeAPP_SERVER- App server addressAPP_RELOAD- Enable reload mode
Logging
All commands support configurable logging levels:
DEBUG- Detailed debug informationINFO- General informationWARNING- WarningsERROR- ErrorsCRITICAL- Critical errors
Logs can be output both to screen and to files.

