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:
| Variable | Description | Default |
|---|---|---|
MX_API_KEY | API authentication key | — |
MX_API_URL | API base URL | https://api.memnexus.ai |
MX_OUTPUT_FORMAT | Default output format | table |
MX_DEFAULT_PAGE_SIZE | Default pagination size | 20 |
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
- Authentication — API key management
- Managing Memories — Create, update, and organize memories
- Search — Find memories by meaning or keywords