# CLI Reference

This page lists how to launch go-web-monitor and every command and key binding available in the Command input.

## Launch

| Command | Description |
|---------|-------------|
| `go run ./cmd/tui` | Run directly from source |
| `./go-web-monitor` | Run the built binary |

The program takes no flags or arguments, and its data file is always `.webMonitor.json` in the current working directory.

## Main Commands

| Command | Syntax | Description |
|---------|--------|-------------|
| `add` | `add <url>` | Adds a site and checks it once; an existing URL is not added twice |
| `delete` / `del` / `remove` / `rm` | `del <url>` | Removes a site; the URL must match the list entry exactly |
| `smtp` / `smtp show` | `smtp` | Switches to the SMTP view |
| `smtp` | `smtp <key> <value>` | Sets an SMTP field or manages recipients |
| `test` | `test` | Sends a test email in the background |
| `refresh` | `refresh` | Re-checks every site in the background now |
| `back` | `back` | Returns from the SMTP view to the main view |
| `quit` / `exit` / `bye` | `quit` | Exits the program |

Unlisted commands are ignored without an error.

## SMTP Keys

| Key | Value | Description |
|-----|-------|-------------|
| `host` | Hostname | SMTP host |
| `port` | Integer | Rejected when not an integer |
| `username` | String | Auth username |
| `password` | String | Auth password |
| `from` | Email | Sender address |
| `enabled` | `true` / `1` / other | `true` or `1` enables; anything else disables |
| `add` | Email | Adds a recipient (duplicates and blanks ignored) |
| `delete` / `del` / `remove` / `rm` | Email | Removes a recipient |

## Key Bindings

| Key | Description |
|-----|-------------|
| <kbd>Enter</kbd> | Submits the command in the Command input |
| <kbd>Esc</kbd> | Returns from the SMTP view to the main view |
| <kbd>Ctrl+C</kbd> | Exits the program |

## Error Feedback

When `add` / `del` / `smtp` fail (duplicate URL, URL not found, unknown key, non-integer port), the error goes to stdout through `fmt.Printf`; `test` failures go to stderr. Neither appears in the System panel.
