Global Flags
These flags work with all commands:| Flag | Short | Description |
|---|---|---|
--config | -c | Path to configuration file |
--help | -h | Show help for any command |
Commands
cw-agent init
Initialize a new configuration file using an interactive wizard.
| Flag | Short | Default | Description |
|---|---|---|---|
--output | -o | ./certwatch.yaml | Output file path |
--non-interactive | false | Use environment variables instead of prompts |
cw-agent start
Start the monitoring agent.
| Flag | Short | Default | Description |
|---|---|---|---|
--config | -c | ./certwatch.yaml | Path to config file |
--reset-agent | false | Reset agent state and re-register | |
--yes | -y | false | Skip confirmation prompts |
.certwatch-state.json alongside your config file. This enables:
- Restart resilience - Agent ID survives restarts
- Name change detection - Warns if you change
agent.namein config - Certificate migration - When resetting, certificates transfer to new agent
cw-agent validate
Validate configuration without starting the agent.
| Flag | Short | Default | Description |
|---|---|---|---|
--config | -c | ./certwatch.yaml | Path to config file |
cw-agent version
Display version information.
Exit Codes
| Code | Description |
|---|---|
0 | Success |
1 | General error (config invalid, connection failed, etc.) |
130 | Interrupted (Ctrl+C) |
Signals
The agent handles the following signals gracefully:| Signal | Behavior |
|---|---|
SIGINT (Ctrl+C) | Graceful shutdown |
SIGTERM | Graceful shutdown |
SIGHUP | Reload configuration (planned) |

