MemNexus
GuidesUsing the CLI

CLI Installation

Install and configure the mx command-line interface.

The mx CLI is a full-featured command-line interface for managing memories, facts, conversations, and more.

Requirements

  • Node.js 18 or later
  • npm, yarn, or pnpm

Install

npm install -g @memnexus-ai/cli

Verify the installation:

mx --version

Configure

Authenticate

mx auth login

This prompts for your API key with masked input — the key stays out of your shell history.

For CI/CD or automation, you can pass the key directly via environment variable:

export MX_API_KEY="cmk_live_xxx.yyy"

Connect your AI tools

After authenticating, connect MemNexus to your AI coding tools:

cd ~/your-project
mx setup

This configures MCP for your installed tools (Claude Code, Cursor, Copilot, etc.) and installs the CommitContext hook.

Verify authentication

mx auth status

You should see:

┌──────────────────┬────────────────────────────┐
│ Property         │ Value                      │
├──────────────────┼────────────────────────────┤
│ Authentication   │ ✓ Configured (via config)  │
│ API URL          │ https://api.memnexus.ai    │
│ Output Format    │ table                      │
└──────────────────┴────────────────────────────┘

Configure the API URL

By default, the CLI points to https://api.memnexus.ai. To change it:

mx config set apiUrl https://your-custom-url.example.com

Set a default output format

mx config set format json

Options: table (default), json, yaml.

Environment variables

You can also configure the CLI via environment variables:

VariableDescriptionDefault
MX_API_KEYAPI authentication key
MX_API_URLAPI base URLhttps://api.memnexus.ai
MX_OUTPUT_FORMATDefault output formattable
MX_DEFAULT_PAGE_SIZEDefault pagination size20
export MX_API_KEY="cmk_live_xxx.yyy"
export MX_OUTPUT_FORMAT="json"

Environment variables override config file values.

Update

npm update -g @memnexus-ai/cli

Uninstall

npm uninstall -g @memnexus-ai/cli

Getting help

Every command has built-in help:

mx --help
mx memories --help
mx memories create --help

Next steps