# Context CLI Reference Binary: `context` Package: `@neuledge/context` --- ## `context add ` Build and install a documentation package from any source. **Arguments:** - `` — Package source. Auto-detected type: - Local `.db` file path → copies directly - HTTP(S) URL ending in `.db` → downloads - GitHub URL or git repo URL → clones and builds - Local directory path → builds from local docs - Website URL → fetches `llms.txt` and builds **Options:** | Flag | Description | |------|-------------| | `--tag ` | Git tag to checkout (for git repos) | | `--pkg-version ` | Custom version label for the built package | | `--path ` | Path to docs folder within the repo or directory | | `--name ` | Custom package name (overrides auto-detected name) | | `--save ` | Save a copy of the built `.db` file to this location | | `--lang ` | Language filter: `all` for all languages, or ISO code (`en`, `de`, etc.) | **Examples:** ```bash context add https://github.com/prisma/prisma context add ./my-local-docs --name mylib --pkg-version 2.0 context add https://mysite.com/docs --lang en context add /tmp/react-19.0.db ``` --- ## `context install [version]` Download and install a pre-built package from the registry. **Arguments:** - `` — Package identifier, e.g. `npm/next` or `next` - `[version]` — Specific version (latest used if omitted) **Options:** | Flag | Description | |------|-------------| | `--server ` | Named server from config (default: `neuledge`) | **Examples:** ```bash context install npm/next context install npm/react 18.0.0 context install prisma --server myserver ``` --- ## `context browse ` Search for packages available on the registry. **Arguments:** - `` — Package name or `registry/name`, e.g. `npm/next` or just `react` **Options:** | Flag | Description | |------|-------------| | `--server ` | Named server from config | **Examples:** ```bash context browse react context browse npm/next ``` --- ## `context list` Display all installed packages with sizes and section counts. ```bash context list ``` --- ## `context remove ` Remove an installed documentation package. **Arguments:** - `` — Package name or name with version, e.g. `next` or `next@v16.2.0` **Examples:** ```bash context remove next context remove next@v16.2.0 ``` --- ## `context serve` Start the MCP server. **Options:** | Flag | Description | |------|-------------| | `--http [port]` | Run as HTTP server (default port: 8080) instead of stdio | | `--host ` | Binding address for HTTP mode (default: `127.0.0.1`) | | `--libs ` | Restrict session to specific libraries; hides search/download tools | **Examples:** ```bash context serve # stdio mode (for Claude Code, Cursor, etc.) context serve --http # HTTP on port 8080 context serve --http 3000 # HTTP on port 3000 context serve --http --host 0.0.0.0 # HTTP accessible on all interfaces context serve --libs react next # locked to react and next only ``` --- ## `context query ` Query documentation from an installed package via CLI (no MCP needed). **Arguments:** - `` — Installed package in `name@version` format, e.g. `nextjs@15.0` - `` — Documentation topic, e.g. `createServer`, `cors middleware` **Examples:** ```bash context query nextjs@15.0 "app router" context query react@18.0 useState ``` --- ## `context auth` Manage per-domain authentication for subscriber-only or private content. ### `context auth add ` Add or update authentication for a domain. **Arguments:** - `` — Domain to authenticate against **Options:** | Flag | Description | |------|-------------| | `--cookies ` | Cookie header value | | `--header
` | Custom HTTP header (e.g. `Authorization: Bearer token`) | **Example:** ```bash context auth add docs.example.com --header "Authorization: Bearer mytoken" context auth add private.site.com --cookies "session=abc123" ``` ### `context auth list` Display all configured authentication entries. ### `context auth remove ` Delete authentication for a domain. --- ## Config File Location: `~/.context/config.json` Format: JSON ```json { "servers": [ { "name": "neuledge", "url": "https://api.context.neuledge.com", "default": true } ] } ``` **Config keys:** | Key | Type | Default | Description | |-----|------|---------|-------------| | `servers` | array | single Neuledge entry | Registry server configurations | | `servers[].name` | string | `"neuledge"` | Identifier used with `--server` flag | | `servers[].url` | string | `"https://api.context.neuledge.com"` | Server endpoint | | `servers[].default` | boolean | `true` | Primary server used when `--server` is omitted | To add a self-hosted registry server: ```json { "servers": [ { "name": "neuledge", "url": "https://api.context.neuledge.com", "default": true }, { "name": "myorg", "url": "https://context.myorg.internal" } ] } ``` --- ## Environment Variables None documented. Config is file-based (`~/.context/config.json`). --- ## MCP Tool Reference (server-side) When running `context serve`, these MCP tools are registered: ### `get_docs` Primary documentation lookup. Use before web searches when the library is installed. - `library` — `name@version`, e.g. `react@18.0` - `topic` — Short API name or keyword, e.g. `useState`, `cors middleware` ### `search_packages` Find available packages in a registry. - `registry` — `npm`, `pip`, `cargo`, `go` - `name` — Package name - `version` (optional) — Specific version - `server` (optional) — Named server from config ### `download_package` Download and install a package from the registry. - `registry` — Registry identifier - `name` — Package name - `version` — Version string - `server` (optional) — Named server from config