MemoryKit

CLI

Command-line interface for MemoryKit. Full setup, memory management, and search from the terminal. Agent-friendly.

botAgent-first

--json output, env vars, auto-confirm — built for AI agents and CI/CD.

Full setup

Register, verify, create company, project, and API key — in one command.

terminalInteractive

Guided prompts when you run without flags. Skip them with --json.

Installation

npm install -g @memorykitio/cli

Requires Node.js 18+.

Quick start

Set up everything in one command

memorykit init

The wizard walks you through: account registration → email verification → company creation → project creation → API key generation.

All credentials are saved to ~/.memorykit/ automatically.

Store a memory

memorykit memories create \
  --content "Our refund policy is 30 days for all products."
memorykit memories search --query "refund policy"

Two ways to authenticate

Option 1: Run memorykit init

The setup wizard handles everything and stores credentials in ~/.memorykit/credentials.json.

Option 2: Environment variables

Set MEMORYKIT_API_KEY and skip init entirely — useful for CI/CD and agents.

export MEMORYKIT_API_KEY="ctx_..."
export MEMORYKIT_BASE_URL="https://api.memorykit.io"  # optional, this is the default
 
memorykit memories search --query "refund policy"

Environment variables take priority over stored credentials. This means you can override the stored API key per-command without modifying your config.

Global flags

Every command accepts these flags:

FlagDescription
--jsonMachine-readable JSON output. Also auto-confirms destructive actions.
--profile <name>Named credential profile (default: "default").

JSON output

With --json, every command outputs a consistent envelope:

{
  "ok": true,
  "data": { ... }
}

On error:

{
  "ok": false,
  "error": {
    "name": "MissingFlagError",
    "message": "Missing required flag: --email",
    "code": "MISSING_FLAG",
    "missingFlag": "email"
  }
}

Profiles

Like AWS CLI, you can store multiple credential sets and switch between them:

# Login to a staging account
memorykit auth login --email dev@example.com --password ... --profile staging
 
# Use it
memorykit memories list --profile staging
 
# Set as default
memorykit config set defaultProfile staging

Setup wizard

memorykit init

Full setup: register → verify → login → company → project → API key.

# Interactive — prompts for everything
memorykit init
 
# Non-interactive — all flags provided
memorykit init \
  --email user@example.com \
  --password secretpassword \
  --gdpr-consent \
  --verification-code 123456 \
  --company-name "My Startup" \
  --project-name "Main App" \
  --json
 
# Existing account — skip registration
memorykit init --skip-register \
  --email user@example.com \
  --password secretpassword \
  --company-name "My Startup" \
  --project-name "Main App" \
  --json
FlagDescription
--emailAccount email
--passwordAccount password
--verification-code6-digit email verification code
--company-nameCompany name
--company-slugURL slug (auto-generated from name)
--project-nameProject name
--project-slugURL slug (auto-generated from name)
--apikey-nameAPI key name (default: "CLI Default")
--gdpr-consentAccept GDPR data processing consent
--skip-registerSkip registration, login to existing account
--base-urlAPI base URL override

Email verification is optional during init. You can verify later with memorykit auth verify and then run memorykit init --skip-register to continue the setup.

Authentication

memorykit auth register

Create a new account.

memorykit auth register --email user@example.com --password secret123 --gdpr-consent

memorykit auth verify

Verify your email with the 6-digit code.

memorykit auth verify --email user@example.com --code 123456

memorykit auth login

Login and store JWT tokens.

memorykit auth login --email user@example.com --password secret123

memorykit auth logout

Clear stored credentials for the active profile.

memorykit auth logout

Companies

memorykit company create

memorykit company create --name "My Startup"
memorykit company create --name "My Startup" --slug my-startup --json

memorykit company list

memorykit company list

Projects

memorykit project create

memorykit project create --name "Main App"
memorykit project create --name "Main App" --company-id COMPANY_ID --json

memorykit project list

memorykit project list

API keys

memorykit apikey create

memorykit apikey create --name "Production"
memorykit apikey create --name "CI" --scopes read,write --json

The API key (ctx_...) is displayed once and stored in your profile.

memorykit apikey list

memorykit apikey list

memorykit apikey revoke

memorykit apikey revoke KEY_ID
memorykit apikey revoke KEY_ID --force  # skip confirmation

Memories

Create

memorykit memories create --content "Meeting notes from Q4 planning session"
memorykit memories create \
  --content "User prefers dark mode" \
  --title "User Preferences" \
  --tags preferences,settings \
  --user-id user_123 \
  --json
FlagDescription
--contentMemory text content
--titleMemory title
--typetext, document, conversation, code (default: text)
--tagsComma-separated tags
--user-idScope to a user
--languageContent language (e.g., en, ru)
--formatplain, markdown, html

List

memorykit memories list
memorykit memories list --limit 50 --status completed --json
FlagDescription
--limitMax results (default: 20)
--cursorPagination cursor
--statusFilter: pending, processing, completed, failed
--typeFilter by type
--user-idFilter by user

Get

memorykit memories get MEMORY_ID

Update

memorykit memories update MEMORY_ID --title "New Title" --tags updated,important

Delete

memorykit memories delete MEMORY_ID
memorykit memories delete MEMORY_ID --force  # skip confirmation

Upload

Upload PDF, DOCX, TXT, Markdown, and other file types as memories.

memorykit memories upload ./report.pdf
memorykit memories upload ./notes.md --title "Meeting Notes" --tags meetings --json

Search

memorykit memories search --query "What is the refund policy?"
memorykit memories search -q "quarterly revenue" --limit 5 --json
FlagDescription
--query, -qSearch query
--limitMax results 1–100 (default: 10)
--score-thresholdMinimum relevance score (0–1)
--include-graphInclude knowledge graph data
--user-idScope to a user

Human-readable output:

Found 3 result(s):

  [0.955] mem_abc123
         Title: Refund Policy
         Our refund policy is 30 days for all products...

  [0.821] mem_def456
         Full return within 14 days, partial refund after...

Status

Check project usage and billing:

memorykit status
Project: proj_abc123
Plan:    Pro

Usage:
  Memories: 1,247 / 50,000 (12 today)
  Queries:  8,392 / 100,000
  Storage:  156 MB / 10,000 MB

Billing period:
  2026-03-01 — 2026-03-31

Configuration

# Set a value
memorykit config set baseUrl https://api.staging.memorykit.io
 
# Get a value
memorykit config get baseUrl
 
# List all settings
memorykit config list
KeyDescription
baseUrlAPI base URL
defaultProfileDefault credential profile name

Environment variables

VariableDescription
MEMORYKIT_API_KEYAPI key for memory operations (overrides stored key)
MEMORYKIT_BASE_URLAPI base URL (overrides config)
MEMORYKIT_CONFIG_DIRConfig directory path (default: ~/.memorykit)

Agent and CI/CD usage

The CLI is designed to be used by AI agents and in automation pipelines.

Non-interactive setup

# Full setup without any prompts
memorykit init \
  --email agent@example.com \
  --password agentpassword \
  --gdpr-consent \
  --verification-code 123456 \
  --company-name "Agent Corp" \
  --project-name "Production" \
  --json

Using env vars (skip init)

export MEMORYKIT_API_KEY="ctx_..."
memorykit memories create --content "fact" --json
memorykit memories search --query "fact" --json

Structured errors

When a required flag is missing in non-interactive mode, the CLI returns a structured error with the flag name:

{
  "ok": false,
  "error": {
    "name": "MissingFlagError",
    "message": "Missing required flag: --email",
    "code": "MISSING_FLAG",
    "missingFlag": "email"
  }
}

Auto-confirm

--json automatically confirms destructive actions (delete, revoke) — no need to also pass --force.

Edit on GitHub