Integration

Command line

The knowmind command line opens a connection to your workspace from any terminal. It handles sign-in, search and upload, and provides a local MCP bridge for MCP-capable tools such as Claude Code or Cursor.

Audience
Power users and developers who drive knowmind from scripts, pipelines or local MCP clients. Not required for browser-only use.

Prerequisites

  • Node.js 20 or newer (check: node --version)
  • knowmind account with an API token of the form kmt_… (created on the Business API plan)
  • Write permission in your home directory for the token file at ~/.knowmind/config.json

Steps

  1. 1

    Install from the npm registry

    bash
    npm install -g knowmind

    The knowmind command is then available system-wide. Current version: 0.1.9 (as of 23 May 2026).

    Note

    What does this command download?

    Only the command line itself — a small Apache 2.0 licensed binary. No customer content, no memories, no credentials. Content from knowmind workspaces is only available after the sign-in in step 2.

    Outcome: knowmind --version returns a version string.

  2. 2

    Sign in with an API token

    In the knowmind dashboard, under API Tokens, create a token with scope read for read-only access or also write to create and maintain content. Copy the token once.

    bash
    knowmind login --token kmt_…

    The token is saved to ~/.knowmind/config.json with restricted permissions (chmod 600 on Unix). Alternatively pass it through the KNOWMIND_TOKEN environment variable — useful in CI pipelines.

    Outcome: knowmind health returns the service status and a version string.

  3. 3

    Commands at a glance

    bash
    # Search
    knowmind search "When does the Müller GmbH contract expire?"
    knowmind search "GDPR training" -k 10 --hops 3
    
    # Create a memory
    echo "Short note" | knowmind upload - --title "Keyword"
    knowmind upload ./handbook.md --title "Service Handbook"
    
    # Sync content (idempotent, content-hash based)
    knowmind sync ./docs --manifest ./.knowmind.manifest
    
    # Status and maintenance
    knowmind stats        # number of memories and relations
    knowmind health       # service reachability
    knowmind config       # current token prefix and endpoint

    Outcome: On success every command returns exit code 0 and writes the result to stdout.

  4. 4

    Use as an MCP bridge

    If an AI tool supports the Model Context Protocol over stdio (Claude Code, Claude Desktop, Cursor), the CLI can serve as a local bridge. The token stays in the CLI configuration — the AI tool never sees it.

    json
    {
      "mcpServers": {
        "knowmind": {
          "command": "knowmind",
          "args": ["mcp"]
        }
      }
    }

    Tool-specific guides: Claude Code, Claude Desktop and Cursor.

Verify the result

The CLI is ready when all three conditions hold:

  • knowmind health returns status: ok.
  • knowmind stats shows the memory and relation count.
  • knowmind search "your question" returns hits from the corpus.

Troubleshooting

Error messageCauseResolution
command not found: knowmindnpm global directory not on PATH.Find the path with npm config get prefix and add it to PATH. On Windows: PowerShell profile or environment variable dialog.
EACCES on npm install -gGlobal directory needs administrator rights.Either install with elevated rights (sudo / "Run as administrator"), or point npm prefix at a user-owned directory: npm config set prefix ~/.npm-global.
knowmind login: token rejectedToken revoked in the dashboard or a copy-paste typo.Create a new token in the dashboard and retry. Watch for surrounding whitespace when copying.
knowmind sync: reports missing permissionToken scope is read only, not write.Edit the token in the dashboard and add scope "write", or create a new token with both scopes.

Related