# Agent Configuration
The agent reads configuration from `/etc/moniqo/agent.conf` and environment variables.
## Config file format
```
api_endpoint=https://api.moniqo.dev
api_token=YOUR_TOKEN_HERE
node_id=auto-assigned-after-registration
state_file=/var/lib/moniqo/state
```
## Environment variables
Environment variables override config file values:
| Variable | Description |
|----------|-------------|
| `MONIQO_API_ENDPOINT` | API server URL |
| `MONIQO_API_TOKEN` | Authentication token |
| `MONIQO_NODE_ID` | Node identifier |
## Agent modes
The agent operates in three modes:
- **discovery_pending** — Initial state. Collects system context and sends discovery payload.
- **active** — Monitors configured metrics and sends runtime payloads.
- **relearn_requested** — Re-collects full discovery when requested from the UI.
## Command line flags
| Flag | Description |
|------|-------------|
| `--config` | Path to config file (default: `/etc/moniqo/agent.conf`) |
| `--once` | Run one cycle and exit (useful for cron) |
| `--version` | Print version and exit |