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

# argent gateway

> Commands for managing the ArgentOS gateway service.

## Overview

The `argent gateway` commands control the always-on gateway process that manages agents, channels, and sessions.

## Commands

### `argent gateway start`

Start the gateway in the foreground:

```bash theme={null}
argent gateway start
```

The gateway runs in the current terminal session. Use `Ctrl+C` to stop. For production use, install as a system service instead.

### `argent gateway stop`

Stop the running gateway:

```bash theme={null}
argent gateway stop
```

Sends a graceful shutdown signal. Active sessions are saved before exit.

### `argent gateway restart`

Restart the gateway:

```bash theme={null}
argent gateway restart
```

Equivalent to `stop` followed by `start`. Active channel connections are re-established automatically.

### `argent gateway status`

Show the current gateway status:

```bash theme={null}
argent gateway status
```

Output:

```
Gateway Status:
  Process:   running (PID 12345)
  RPC Probe: ok
  Listening:  *:18789
  Uptime:    3d 14h 22m
  Channels:  telegram (connected), discord (connected)
  Sessions:  4 active
```

<Tip>
  A healthy gateway shows "RPC probe: ok" and "Listening: \*:18789".
</Tip>

### `argent gateway install`

Install the gateway as a system service:

```bash theme={null}
argent gateway install
```

* **macOS**: Creates a LaunchAgent at `~/Library/LaunchAgents/ai.argent.gateway.plist`
* **Linux**: Creates a systemd user service

The service starts automatically on login/boot.

<Warning>
  The plist uses the current `node` binary in PATH. If Homebrew's node is first, the gateway will use it instead of nvm's node, causing ABI mismatches with native modules. Verify the plist node path matches your nvm installation.
</Warning>

### `argent gateway uninstall`

Remove the system service:

```bash theme={null}
argent gateway uninstall
```

### `argent gateway logs`

View gateway logs:

```bash theme={null}
# Show recent logs
argent gateway logs

# Follow logs in real-time
argent gateway logs --follow
argent gateway logs -f

# Filter by level
argent gateway logs --level error
```

## Service Management

<Tabs>
  <Tab title="macOS Reload">
    If you manually edit the plist:

    ```bash theme={null}
    launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist
    launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.argent.gateway.plist
    ```
  </Tab>

  <Tab title="Linux Service">
    ```bash theme={null}
    systemctl --user status argent-gateway
    systemctl --user restart argent-gateway
    journalctl --user -u argent-gateway -f
    ```
  </Tab>
</Tabs>
