Skip to main content
The 3ngram CLI is a thin command-line client over @3ngram/sdk and the REST /api/v1 surface. Install it with npm install -g 3ngram (or run one-off commands via npx 3ngram); local source runs can use node apps/cli/dist/index.js after building the package.
The CLI uses API keys, not MCP OAuth. Pass --api-key or set THREENGRAM_API_KEY; the key is sent as X-API-Key and is never printed in error output.

Configuration

Flags override environment variables. --base-url expects the REST origin without /api/v1.

Commands

remember

Append a typed memory through the REST-backed SDK client. Usage: 3ngram remember --type <t> --topic <t> --content <c> [--scope --project --tags]
SDK call: client.remember(input)

Options

Examples

Input payload schema

Output schema

Search memories with optional filters before result fusion. Usage: 3ngram search <query> [--limit --type --scope --project --status]
SDK call: client.search(query, options)

Options

Examples

Input payload schema

Output schema

facts

Read currently-valid facts, optionally with bi-temporal filters. Usage: 3ngram facts [--subject --predicate --valid-at --as-known-at --limit]
SDK call: client.getFacts(filters)

Options

Examples

Input payload schema

Output schema

Exit behavior

  • 0: command completed successfully.
  • 1: no command was supplied, the server rejected the request, or the transport failed.
  • 2: CLI usage or configuration error, including missing required flags.