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

Set your API key

The quickest way to authenticate:

mx auth login --interactive

This prompts for your API key with masked input and stores it securely in your local config.

Alternatively, pass the key directly:

mx auth login --api-key cmk_live_xxx.yyy

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