# The monixagent command

_Every terminal command: server, update, licence, doctor, export, logs, service and connecting other agents._

Everything you can do from a terminal without opening the
interface: start and stop the server, update, activate, diagnose, export, and
connect other coding agents.

## Starting

```
monixcode            # start the server if needed, then open the interface
monixcode attach     # open the interface against a server that is already running
```

`monixcode tui` does the same as plain `monixcode`.

Plain `monixcode` is the command you use every day. If no server is
running it starts one in the background, then opens the interface. When you quit
the interface the server **keeps running** on purpose, so scheduled
tasks and GitHub polling continue. Stop it yourself with
`monixagent server stop`.

Run it from your project folder. An unknown word is an error with the usage
text, never a silent start. If the running server comes from another version
than the command you typed (for example after an update), `monixcode` and
`monixcode attach` refuse with a hint to restart the server instead of
connecting to it. `monixcode attach` without a running server is an
error.

## All commands

| Command | What it does |
|---|---|---|
| `monixagent server [start|stop|restart|status|run]` | Manage
 the background server. `start` is the default. `status`
 shows whether it runs and whether it matches the installed version.
 `run` keeps it in the foreground so you can watch it; stop it
 with Ctrl + C. Any other
 word is an error. |
| `monixagent server restart` | Stop the server and start it again. |
| `monixagent <command>` | The same program under the
 product's name, installed next to `monixcode`: `monixagent server start|stop|restart|status`, and the other
 commands here work the same way except `tui`, `attach`, `chat` and `--chat`,
 which tell you to use `monixcode`. Its hints name `monixagent`. |
| `monixcode chat`, `monixcode --chat` | A chat
 instead of a work session: it answers from the web, the memory and the project,
 runs scripts and writes files in its own sandbox folder without asking, and never
 changes the project. It has no permission mode. Started inside a project it
 belongs to that project; anywhere else to its own Monixchat project.
 `/convert` makes it a work session. |
| `monixagent server stop` | Stop the server. Scheduled tasks do not
 run until it is started again. |
| `monixagent update [--check|--force]` | Install a newer
 release your licence covers, then restart the server. `--check`
 only reports. `--force` installs even if you are up to date.
 `monix-server update` and `monixagent update` do the same.
 Projects, settings and memory are untouched. See
 [Licence & updates](https://docs.nemonix.ai/monix-agent/docs/account). |
| `monixagent license activate` | Activate this machine
 without the interface. Reads three lines from standard input: email,
 password, licence code. |
| `monixagent license move` | Move your licence to this
 machine. Reads two lines: email, password. |
| `monixagent license relogin` | Sign this machine in again
 after `monixagent logout`, without a new licence code. Reads two lines:
 email, password. |
| `monixagent logout` | Release this machine's seat and
 forget the licence here. You can sign in again from the interface or with
 `license relogin`. |
| `monixagent doctor` | Check the installation: the
 programs, whether the server answers and which version, whether the chosen
 provider has credentials, where the logs are, which language servers and
 semantic search are available. |
| `monixagent export [file|-]` | Write every project's
 metadata and memory as readable JSON. Without a file, or with
 `-`, to standard output. Works without a licence — your data
 stays yours. |
| `monixagent logs [server|tui] [-f] [-n N]` | Show the end
 of the logs: the server's, the interface's, or both. `-f` follows
 them, `-n N` sets the number of lines (default 120, or 80 with
 `-f`). |
| `monixagent service [install|uninstall|status]` | Start
 the server at login and restart it if it dies, using launchd on macOS and a
 user service on Linux. `install` is the default. This is what makes
 *every morning at nine* true after a reboot. On Linux, to run while
 you are logged out, also run `loginctl enable-linger` once. Not
 available on Windows yet; start the server there with
 `monixagent server start`. |
| `monixagent integrate <agent>` | Connect Monix Agent's
 project memory to Claude Code, Codex, opencode or Claude Desktop
 (`claude`, `codex`, `opencode`,
 `claude-desktop`), or show `status` (the default
 without an argument). Access per project is never granted here, only in the
 interface. Options:
 `--curator` also adds the curator tools,
 `--dry-run` shows the change without making it,
 `--uninstall` removes only Monix Agent's entries. See
 [Other coding agents](https://docs.nemonix.ai/monix-agent/docs/external). |
| `monixagent mcp [--curator]` | The memory server those
 agents start themselves. You normally never run it by hand. |
| `monixagent hook` | The entry point the connected agents'
 hooks call. Also not meant to be typed. |
| `monixagent version` | Print the version.
 `--version` and `-v` do the same. |
| `monixagent help` | Print the usage text.
 `--help` and `-h` do the same. |
| `monixagent dev [status|checkpoint] PROJECT_ID`,
 `monixagent rollback [last]` | Only in a source checkout
 (`monixcode-dev`): show or set a Git checkpoint, and start the
 server from an earlier checkpoint. The installed product refuses
 both. |

## Why the licence commands read standard input

A password on the command line shows up in the process list, and one in an
environment variable is visible to other programs. So the licence commands take
their input from a pipe or a file, never from arguments:

```
printf '%s\n' "$EMAIL" "$PASSWORD" "$LICENCE_CODE" | monixagent license activate
```

Typed straight into a terminal they refuse and point you to plain
`monixcode`, whose interface asks for the same details.

## Environment variables

You rarely need any of these.

| Variable | What it does |
|---|---|---|
| `MONIX_PORT` | Talk to the server on this local port
 instead of the one it announced. Useful for a second, separate instance.
 Pair it with `MONIX_TOKEN` if that server requires one. |
| `MONIX_TOKEN` | The access token for the server named by
 `MONIX_PORT`. Without `MONIX_PORT` the command finds
 the running server and its token on its own. |
| `MONIX_HOME` | Keep Monix Agent's data (memory, sessions,
 logs) in this folder instead of the default under your home directory. |
| `MONIX_COMMAND_NAME` | The name Monix Agent prints in hints
 and usage text, if you installed the command under another name. |
| `MONIX_NO_AUTOSTART=1` | Never start a server from
 `monixagent mcp` or `monixagent hook`; only use one that is
 already running. See [Other coding agents](https://docs.nemonix.ai/monix-agent/docs/external). |

## Exit codes

Zero means success; anything else is a problem a script can act on.

| Command | Non-zero when |
|---|---|---|
| any | an unknown command or option, or an error such as no
 server for `export` and `attach` |
| `server status` | the server is not running |
| `stop` | the server still answers ten seconds after
 it was told to stop. "No server is running" is not a failure. Bare
 `stop` reports that case; `monixcode server stop`
 prints "Stopped" and exits zero even when the server still answers. |
| `doctor` | the installation is incomplete |
| `update --check` | the check itself failed. "Up to
 date" and "your licence does not cover a newer version" are answers, not
 failures, and exit with zero. |
| `license ...` | the activation was refused; the
 reason is printed |
