Commands Reference¶
This page provides a complete reference for all Go Overlay CLI commands. Commands are organized by category for easy navigation.
Management Commands¶
Commands for controlling and managing services.
restart¶
Restart one or more services managed by the supervisor.
Syntax:
Description:
The restart command stops and then starts the specified service(s). This is useful when you need to reload service configuration or recover from a failed state. The command will:
- Send a stop signal to the service
- Wait for the service to terminate (respecting timeout settings)
- Start the service again
Arguments:
<service-name>: Name of the service to restart (as defined in your configuration file)- You can specify multiple service names separated by spaces
Examples:
Restart a single service:
Restart multiple services:
Expected Output:
Service Dependencies
When restarting a service that other services depend on, those dependent services may also be affected. Consider the dependency chain before restarting critical services.
Information Commands¶
Commands for querying service status and information.
list¶
List all services managed by the supervisor.
Syntax:
Description:
The list command displays all services defined in your configuration file, along with their current status. This provides a quick overview of your entire service stack.
Examples:
Expected Output:
The output shows each service name followed by its current state in parentheses.
Possible States:
PENDING: Service is waiting to startSTARTING: Service is in the process of startingRUNNING: Service is running normallySTOPPING: Service is in the process of stoppingSTOPPED: Service has stoppedFAILED: Service has failed and is not running
status¶
Get detailed status information for one or more services.
Syntax:
Description:
The status command provides detailed information about the specified service(s), including their current state, process ID (if running), and other relevant details. If no service name is provided, it shows status for all services.
Arguments:
[service-name...]: Optional. Name(s) of specific service(s) to check. If omitted, shows status for all services.
Examples:
Check status of a specific service:
Check status of multiple services:
Check status of all services:
Expected Output:
Service: nginx
Status: RUNNING
PID: 1234
Uptime: 2h 15m
Command: /usr/sbin/nginx -g "daemon off;"
Service: mariadb
Status: RUNNING
PID: 1235
Uptime: 2h 15m
Command: /usr/bin/mysqld
Daemon Commands¶
Commands for running the supervisor daemon.
daemon¶
Start the supervisor in daemon mode to manage services.
Syntax:
Description:
The daemon command starts Go Overlay in daemon mode, which is the main process that manages and monitors all configured services. This is typically the command you use as the entrypoint in a Docker container or as a system service.
When started, the daemon will:
- Load the configuration file
- Validate service definitions
- Start services according to their dependencies
- Monitor service health
- Handle graceful shutdown on termination signals
Flags:
--config <path>: Path to configuration file (default:/services.toml)--log-level <level>: Set logging level (debug, info, warn, error)
Examples:
Start daemon with default configuration:
Start daemon with custom configuration:
Start daemon with debug logging:
Expected Output:
[INFO] Starting Go Overlay daemon
[INFO] Loading configuration from /services.toml
[INFO] Starting service: redis
[INFO] Starting service: mariadb
[INFO] Starting service: nginx
[INFO] All services started successfully
[INFO] Daemon running, press Ctrl+C to stop
Running as Entrypoint
In Docker containers, the daemon command is typically used as the ENTRYPOINT or CMD instruction.
Installation Commands¶
Commands for installing the Go Overlay binary.
install¶
Install the Go Overlay binary to the system.
Syntax:
Description:
The install command copies the Go Overlay binary to a system location (typically /usr/local/bin/) and makes it executable. This allows you to run Go Overlay commands from anywhere in your system without specifying the full path.
Flags:
--path <path>: Custom installation path (default:/go-overlay)--force: Overwrite existing installation
Examples:
Install to default location:
Install to custom location:
Force reinstall:
Expected Output:
Installing Go Overlay to /go-overlay
Installation successful
You can now run 'go-overlay' from anywhere
Permissions
You may need to run this command with sudo or as root to install to system directories:
Command Categories Summary¶
| Category | Commands | Purpose |
|---|---|---|
| Management | restart | Control and manage running services |
| Information | list, status | Query service status and information |
| Daemon | daemon | Run the supervisor daemon process |
| Installation | install | Install the binary to the system |
Common Usage Patterns¶
Starting the Supervisor¶
# Start daemon with default config
go-overlay daemon
# Start with custom config
go-overlay daemon --config /path/to/services.toml
Monitoring Services¶
# List all services
go-overlay list
# Check detailed status
go-overlay status
# Check specific service
go-overlay status nginx
Managing Services¶
# Restart a service
go-overlay restart nginx
# Restart multiple services
go-overlay restart nginx mariadb redis
Exit Codes¶
All CLI commands return standard exit codes:
0: Success1: General error2: Command usage error3: Service not found4: Daemon not running
You can use these exit codes in scripts to handle errors:
if go-overlay status nginx; then
echo "nginx is running"
else
echo "nginx is not running or failed"
fi
Troubleshooting¶
Command Not Found¶
If you get a "command not found" error:
- Ensure Go Overlay is installed:
go-overlay install - Check if the binary is in your PATH
- Try using the full path to the binary
Cannot Connect to Daemon¶
If CLI commands fail with connection errors:
- Verify the daemon is running:
ps aux | grep go-overlay - Check IPC socket permissions
- Ensure you're running commands as the correct user
Permission Denied¶
If you get permission errors:
- Check file permissions on the binary
- Verify IPC socket permissions
- Run with appropriate user privileges
See Also¶
- CLI Overview - Understanding the CLI architecture
- Configuration Reference - Configure services
- Service Lifecycle - Understanding service states