npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kinqs/brainrouter-cli

v0.3.6

Published

Memory-native terminal coding agent. Talks to the BrainRouter MCP cognitive engine for recall, skills, capture, persona, focus scenes, and contradiction tracking.

Readme

@kinqs/brainrouter-cli

A memory-native terminal agent. Edits files, runs shell commands, spawns child agents, and talks to a BrainRouter MCP server for long-term recall, skills, and capture.

Ships the brainrouter binary.


Install

npm install -g @kinqs/brainrouter-cli

The -g flag is critical. Without it, npm installs into the current directory's node_modules/ and the brainrouter binary ends up at ./node_modules/.bin/brainrouter — not on $PATH. Symptom: brainrouter: command not found.

Sudo caveat. Whether you need sudo depends on your Node install:

| How Node is installed | Use sudo? | |---|---| | Homebrew (brew install node) | ❌ No — global prefix is user-writable | | nvm / asdf / fnm | ❌ No — same reason | | System Node on macOS / Linux | ✅ Yes — global prefix is /usr/local/... |

Check yours:

npm config get prefix

If the path is under /Users/..., /opt/homebrew/..., or your home dir → no sudo. If it's /usr/local/... → use sudo.

Verify the install:

which brainrouter           # prints the path to the binary
brainrouter --version       # prints 0.3.5

Configure

Two configuration surfaces, both one-time:

1. The chat LLM and MCP server profile

brainrouter config          # interactive — set LLM provider, model, key, endpoint
brainrouter login           # interactive — set MCP server URL + API key

Both write to ~/.config/brainrouter/config.json.

For local-model setups (LM Studio / Ollama), point the LLM endpoint at http://localhost:1234/v1/chat/completions or http://localhost:11434/v1/chat/completions.

2. (Optional) Runtime knobs — ~/.config/brainrouter/cli.env or ./brainrouter-cli.env

Only needed if you want to tune sandbox, tool-loop limits, trace logging, or web-search backend. See the .env.example bundled with this package for the full list. LLM credentials do not go here — they live in config.json.


Run

brainrouter                 # starts the interactive REPL
brainrouter chat            # same — `chat` is the default subcommand
brainrouter run "summarize the changes in src/"   # one-shot non-interactive
brainrouter agents          # list child agent sessions in this workspace

Inside the REPL, type /help for the full slash-command list (60+ commands across session / memory / workflow / orchestration / observability surfaces).

Offline mode

If the MCP server isn't reachable, the CLI still boots — but only local tools (file edits, shell, web fetch, spawn_agent) work. Memory recall, capture, and skills are disabled until the server is back. The startup banner shows ⚠️ OFFLINE MODE when this happens. Pass --strict-mcp to make the CLI exit instead of degrading.

Stdio mode

If you'd rather have the CLI spawn the MCP server as a child process instead of running it separately, use brainrouter config → "Set Active Server Profile" → default (the bundled stdio profile). You don't need to run anything else — the CLI manages the server's lifecycle.


Workspace detection

By default, the CLI uses the nearest project root with AGENT.md, AGENTS.md, or .git. Override with:

brainrouter --workspace /absolute/path/to/project
# or
BRAINROUTER_WORKSPACE=/absolute/path/to/project brainrouter

Inside the REPL, run /workspace to confirm the active root and session key.


What you also probably want

A BrainRouter MCP server for the cognitive memory. The CLI works without it (offline mode) but you lose recall, capture, and skills:

npm install -g @kinqs/brainrouter-mcp-server
brainrouter-mcp init                              # one-time: scaffold ~/.config/brainrouter/server.env
$EDITOR ~/.config/brainrouter/server.env          # set BRAINROUTER_LLM_API_KEY, embeddings, etc.
brainrouter-mcp --http --port 3747                # in a separate terminal

Then brainrouter login and point at http://localhost:3747/mcp.


Docs


License

MIT