> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirurobotics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

The Miru Agent does not (currently) provide a command line interface. However, the agent can be managed using standard `systemd` commands and other standard Linux tools.

The [Miru CLI](/developers/cli/overview) is only for managing Miru resources from your development machine's terminal. Please do not attempt to use the `miru` command to manage the agent.

## Version

To check the version of the agent, run the following command on the device:

```bash theme={null}
miru-agent --version
```

## Logs

The Miru Agent logs are accessible via [`journalctl`](https://www.freedesktop.org/software/systemd/man/journalctl.html), the standard tool for viewing `systemd` service logs.

### View all

By default, `journalctl` truncates each line's output to the size of the terminal window. We recommend using the `--no-pager` flag to view the full log output for each line.

```bash theme={null}
journalctl -u miru --no-pager
```

### Tail in real-time

Tail the logs and watch new entries as they appear.

```bash theme={null}
journalctl -u miru -f --no-pager
```

### Recent logs

View only the most recent log entries (e.g., the last 100 lines).

```bash theme={null}
journalctl -u miru -n 100 --no-pager
```

### Filter by time

View logs from a specific time period.

```bash theme={null}
# Logs from the last hour
journalctl -u miru --since "1 hour ago" --no-pager

# Logs from today
journalctl -u miru --since today --no-pager

# Logs from a specific date/time range
journalctl -u miru --since "2024-01-15 09:00:00" --until "2024-01-15 12:00:00" --no-pager
```

### Filter by priority

View only logs of a specific priority level (e.g., errors).

```bash theme={null}
# Show only errors and above
journalctl -u miru -p err --no-pager

# Show warnings and above
journalctl -u miru -p warning --no-pager
```

<Tip>
  Combine flags for more targeted output. For example, `journalctl -u miru -f -n 50 --no-pager` will tail the last 50 lines and then follow new entries in real-time.
</Tip>

## Systemd

The Miru Agent runs as a [`systemd`](https://en.wikipedia.org/wiki/Systemd) service named `miru`, allowing you to manage the service using standard `systemctl` commands.

You can find the agent's `systemd` service files on your file system at the following paths:

* `/lib/systemd/system/miru.service`
* `/lib/systemd/system/miru.socket`

### Status

To check the status of the agent, use the `status` command.

```bash theme={null}
systemctl status miru
```

Depending on the state of the agent, you will see outputs similar to the following:

<Tabs>
  <Tab title="Active">
    The agent is running as expected.

    <Frame>
      ![Systemd Status Running](https://assets.mirurobotics.com/docs/v04/images/agent/commands/systemctl-status:running.png)
    </Frame>
  </Tab>

  <Tab title="Inactive">
    The agent is not running. Unless you've manually stopped the agent, this should not happen.

    <Frame>
      ![Systemd Status Inactive](https://assets.mirurobotics.com/docs/v04/images/agent/commands/systemctl-status:dead.png)
    </Frame>
  </Tab>
</Tabs>

### Restart

Restarting the agent stops and starts the agent, giving it a fresh start. If you're experiencing unexpected behavior, restarting the agent is a good place to begin.

```bash theme={null}
systemctl restart miru
```

<Info>
  If the agent is not running, restarting it will start it.
</Info>

### Stop

`stop` stops the agent while leaving its state intact. Stopping the agent does not [disable](/developers/agent/commands#disable) the agent—it will still automatically start on next system boot.

Note that stopping the agent will prevent any new deployments from reaching the device until the agent is started again.

```bash theme={null}
systemctl stop miru
```

<Info>
  If the agent is not running, stopping it does nothing.
</Info>

### Start

`start` starts the agent if it has been stopped.

```bash theme={null}
systemctl start miru
```

<Info>
  If the agent is already running, starting it does nothing.
</Info>

### Disable

Disabling the agent prevents it from starting automatically on boot.

This does not immediately [stop](/developers/agent/commands#stop) the agent—it will still run if it is currently running. However, it will not be able to start on next system boot.

```bash theme={null}
systemctl disable miru
```

### Enable

Enabling the agent allows it to start automatically on boot. This is the default behavior after installation and only needs to be done if the agent has been [disabled](/developers/agent/commands#disable).

Enabling the agent will not immediately start it—it will still need to be [started](/developers/agent/commands#start) manually.

```bash theme={null}
systemctl enable miru
```
