> For the complete documentation index, see [llms.txt](https://docs.autopilotmonitor.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autopilotmonitor.com/reference/agent-command-line.md). Agents can also search and read this documentation through its [MCP server](https://docs.autopilotmonitor.com/~gitbook/mcp).

# Agent Command-Line Parameters

The agent's command-line parameters for testing, debugging and advanced scenarios — session and lifecycle, authentication and bootstrap, and enrollment replay.

In production the agent needs no parameters — the bootstrap script installs and starts it with everything it needs, and behavior is controlled through [tenant settings](https://docs.autopilotmonitor.com/reference/settings.md). The command line exists for **testing, debugging, and advanced scenarios**, launching `AutopilotMonitor.Agent.exe` directly.

## Session & lifecycle

| Parameter               | Description                                                                                                                 |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `--new-session`         | Deletes existing session data and starts a fresh session — restart the agent on a device without carrying over stale state. |
| `--no-cleanup`          | Suppresses self-destruct after enrollment; agent files and the scheduled task remain for post-enrollment debugging.         |
| `--keep-logfile`        | Preserves the log directory during self-destruct.                                                                           |
| `--reboot-on-complete`  | Reboots the device after enrollment completes (default delay 10 s, configurable via remote configuration).                  |
| `--disable-geolocation` | Disables the IP-based geo-location lookup for this run.                                                                     |

## Authentication & bootstrap

| Parameter                              | Description                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--bootstrap-token <token>`            | Authenticate with a [Bootstrap Token](https://docs.autopilotmonitor.com/reference/bootstrap-script-and-tokens.md#bootstrap-tokens) during OOBE, before an MDM client certificate exists.                                                                                                                                                                                                   |
| `--await-enrollment`                   | Wait for the MDM client certificate to become available before monitoring starts.                                                                                                                                                                                                                                                                                                          |
| `--await-enrollment-timeout <minutes>` | Maximum wait for the MDM certificate. Default: `480` (8 hours).                                                                                                                                                                                                                                                                                                                            |
| `--tenant-id <id>`                     | Pre-seed the tenant identity at install time (persisted to the agent's bootstrap config), removing the dependency on the device's registry-based tenant resolution. Typically used together with `--bootstrap-token`.                                                                                                                                                                      |
| `--tenant-id-wait <seconds>`           | How long the agent waits at startup for the device's tenant identity to appear in the registry — relevant on [Hybrid Join devices whose Entra registration lands late](https://docs.autopilotmonitor.com/troubleshooting-and-support/hybrid-join-late-device-registration.md). Default: `600`; `0` disables the wait. Set at install time on the `--install` line of the bootstrap script. |

## Testing & replay

| Parameter                   | Description                                                                                                                                                                                                                                                                      |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--ime-log-path <path>`     | Use IME log files from a custom path — test with logs collected from other devices.                                                                                                                                                                                              |
| `--replay-log-dir <path>`   | **Replay** real IME logs from a directory, simulating a complete enrollment in fast-forward. Creates a real session in the backend: device info comes from the current machine, enrollment events from the logs. Ideal for testing rules, demos, and analyzing past enrollments. |
| `--replay-speed-factor <n>` | Time compression for replay. Default `50` — a 50-minute enrollment replays in about a minute. Delays between events are divided by the factor, capped at 5 s each.                                                                                                               |

### Example — replay a captured enrollment

```powershell
AutopilotMonitor.Agent.exe --replay-log-dir "C:\Logs\IME" --replay-speed-factor 100
```

Replays the captured enrollment at 100× speed and produces a full session on the dashboard — including [analyze rule](https://docs.autopilotmonitor.com/rules/analyze-rules.md) evaluation, which makes replay the fastest way to test a custom rule.

{% hint style="warning" %}
Replay and test parameters are for test/development environments — don't use them in production deployments.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.autopilotmonitor.com/reference/agent-command-line.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
