CLI Reference
The memorylayer CLI is provided by the memorylayer-server package.
Installation
pip install memorylayer-serverGlobal Options
| Option | Description | Default |
|---|---|---|
--verbose / -v | Enable debug logging | false |
Commands
memorylayer serve
Start the HTTP REST API server.
memorylayer serve [OPTIONS]Options:
| Option | Description | Default |
|---|---|---|
--port | Port to listen on | 61001 |
--host | Host to bind to | 127.0.0.1 |
Examples:
# Start on default portmemorylayer serveStarting memorylayer.ai server on 127.0.0.1:61001INFO: Started server processINFO: Waiting for application startup.INFO: Application startup complete.INFO: Uvicorn running on http://127.0.0.1:61001# Custom host and port for network accessmemorylayer serve --host 0.0.0.0 --port 8080Starting memorylayer.ai server on 0.0.0.0:8080INFO: Uvicorn running on http://0.0.0.0:8080# Debug mode with verbose loggingmemorylayer -v serveStarting memorylayer.ai server on 127.0.0.1:61001DEBUG: memorylayer_server - Loading plugins...DEBUG: memorylayer_server - Embedding service initializedINFO: Uvicorn running on http://127.0.0.1:61001memorylayer version
Show version information.
memorylayer versionmemorylayer.ai v0.1.22memorylayer info
Show system information and configuration. Displays all MEMORYLAYER_* environment variables and their current values. Secret keys are redacted by default.
memorylayer info [OPTIONS]Options:
| Option | Description | Default |
|---|---|---|
--format | Output format: text or json | text |
--reveal-secrets | Reveal secret keys in text output | false |
Examples:
# Show configuration in text format (secrets redacted)memorylayer info# ==================================================# MemoryLayer.ai Configuration# exported at 2026-01-15T10:30:00+00:00# version = v0.1.22# ==================================================MEMORYLAYER_DATA_DIR=/home/user/.config/memorylayer-serverMEMORYLAYER_EMBEDDING_PROVIDER=embed_serverMEMORYLAYER_EMBED_SERVER_URL=http://localhost:61051MEMORYLAYER_LLM_PROFILE_DEFAULT_PROVIDER=openaiMEMORYLAYER_LLM_PROFILE_DEFAULT_API_KEY=(redacted)MEMORYLAYER_LLM_PROFILE_DEFAULT_MODEL=gpt-4o-miniMEMORYLAYER_SERVER_HOST=127.0.0.1MEMORYLAYER_SERVER_PORT=61001# JSON format for scriptingmemorylayer info --format json{ "data_dir": "/home/user/.config/memorylayer-server", "embedding_provider": "embed_server", "embed_server_url": "http://localhost:61051", "llm_profile_default_provider": "openai", "llm_profile_default_api_key": "(redacted)", "llm_profile_default_model": "gpt-4o-mini", "server_host": "127.0.0.1", "server_port": "61001"}# Reveal all secrets (use with caution)memorylayer info --reveal-secretsmemorylayer export
Export workspace memories and associations to NDJSON format. Connects to a running MemoryLayer server and streams the export.
memorylayer export [OPTIONS]Options:
| Option | Description | Default |
|---|---|---|
-w, --workspace | Workspace ID to export (required) | — |
-o, --output | Output file path (default: stdout) | stdout |
--offset | Skip first N memories | 0 |
--limit | Export at most N memories (0 = unlimited) | 0 |
--include-associations / --no-associations | Include associations | true |
--server-url | MemoryLayer server URL | http://localhost:61001 |
--api-key | API key for authentication | null |
Examples:
# Export entire workspace to filememorylayer export -w my-workspace -o backup.ndjsonExported 142 memories and 38 associations to backup.ndjson# Export to stdout (pipe to other tools)memorylayer export -w my-workspace{"type": "header", "version": "1.0", "workspace_id": "my-workspace", "exported_at": "2026-01-15T10:30:00+00:00", "total_memories": 142, "total_associations": 38, "offset": 0, "limit": 0}{"type": "memory", "index": 0, "data": {"id": "mem_abc123", "content": "User prefers Python", "type": "semantic", ...}}{"type": "memory", "index": 1, "data": {"id": "mem_def456", "content": "Project uses FastAPI", "type": "semantic", ...}}{"type": "footer", "memories_exported": 142, "associations_exported": 38}# Export first 50 memories without associationsmemorylayer export -w my-workspace -o partial.ndjson --limit 50 --no-associationsExported 50 memories and 0 associations to partial.ndjson# Export from a remote server with authenticationmemorylayer export -w my-workspace -o backup.ndjson \ --server-url https://memorylayer.example.com \ --api-key sk-my-api-keyExported 142 memories and 38 associations to backup.ndjsonmemorylayer import
Import memories from a JSON or NDJSON file into a workspace. The format is auto-detected from the file content.
memorylayer import FILE [OPTIONS]Arguments:
| Argument | Description |
|---|---|
FILE | Path to the import file (JSON or NDJSON) |
Options:
| Option | Description | Default |
|---|---|---|
-w, --workspace | Target workspace ID (required) | — |
--dry-run | Show what would be imported without writing | false |
--server-url | MemoryLayer server URL | http://localhost:61001 |
--api-key | API key for authentication | null |
Examples:
# Dry run to preview importmemorylayer import backup.ndjson -w my-workspace --dry-runWould import 142 memories and 38 associations into workspace my-workspace - [semantic] mem_abc123: User prefers Python for backend development - [semantic] mem_def456: Project uses FastAPI framework - [procedural] mem_ghi789: Deploy with docker compose up -d - [episodic] mem_jkl012: Debugging session resolved auth token expiry ... and 138 more# Import NDJSON filememorylayer import backup.ndjson -w new-workspaceImport complete: Imported: 140 Skipped (duplicates): 2 Errors: 0 Imported 38 associations# Import JSON file into a remote servermemorylayer import data.json -w target-workspace \ --server-url https://memorylayer.example.com \ --api-key sk-my-api-keyImport complete: Imported: 50 Skipped (duplicates): 0 Errors: 0memorylayer —help
Show help information for all commands.
memorylayer --helpUsage: memorylayer [OPTIONS] COMMAND [ARGS]...
MemoryLayer.ai - Memory infrastructure for LLM-powered agents.
Options: -v, --verbose Enable verbose logs --help Show this message and exit.
Commands: export Export workspace memories to NDJSON (streaming). import Import memories from JSON or NDJSON file into workspace. info Show system information and configuration. mcp Manage workspace MCP server registry entries. serve Start the HTTP REST API server. skills Manage workspace skill packages (list / push / pull / sync / ...). version Show version information.You can also get help for individual commands:
memorylayer serve --helpmemorylayer export --helpmemorylayer import --helpmemorylayer skills --helpmemorylayer mcp --helpmemorylayer skills
Manage workspace skill packages stored in MemoryLayer.
memorylayer skills COMMAND [OPTIONS]| Subcommand | Description |
|---|---|
list | List skills in a workspace (optionally show shadowed variants) |
push | Upload a skill directory to the workspace |
pull | Download a skill from the workspace to a directory |
materialize | Materialize all workspace skills to a target directory |
sync | Two-way sync between a local skill directory and the workspace |
watch | Watch a directory and auto-push changes |
migrate-from-local | Bulk-import skills from ~/.claude/skills/ or a project |
Skills are stored server-side via the /v1/skills API and surfaced to MCP clients through the skills_list / skills_get / skills_get_file / skills_search tools (and skills_save in the full MCP profile).
memorylayer mcp
Manage workspace-scoped MCP server registry entries.
memorylayer mcp COMMAND [OPTIONS]| Subcommand | Description |
|---|---|
list | List MCP server entries in a workspace |
push | Upload an MCP server JSON spec |
pull | Download workspace MCP server entries (--reveal-secrets to dump env values) |
sync | Two-way sync between a local JSON file and the workspace |
materialize | Render entries to a .mcp.json / Claude Code config |
watch | Watch a JSON file and auto-push changes |
migrate-from-local | Import existing .mcp.json / Claude Code MCP config into the workspace |
Entries are stored server-side via the /v1/mcp-servers API and exposed to LLMs through the mcp_servers_* MCP tools (available in the full profile).
Usage with Claude Code
The CLI is used to run the HTTP server:
HTTP Server — Run memorylayer serve in a terminal, then connect via SDK or the separate MCP server package (@scitrera/memorylayer-mcp-server).
The MCP server is a separate TypeScript package, not part of the core server CLI.
See Claude Code Integration for detailed setup instructions.