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

companion-cli

v2.0.10

Published

A model-agnostic AI CLI assistant for your terminal — OpenAI, Anthropic, Google, with tools, smart home, desktop automation, and more

Readme

companion-cli

A model-agnostic AI assistant that lives in your terminal. Chat with OpenAI, Anthropic, or Google models; let them read and edit files, run shell commands, control Windows desktop apps, cast audio to Google Home / Alexa, and generate images and video — all from a single companion command.

Install

npm install -g companion-cli

Requires Node.js ≥ 20. Works on Windows, macOS, and Linux (desktop-automation tools are Windows-only; smart-home features run anywhere).

Quick start

companion

On first run it walks you through picking a provider and model. After that, just type — the AI will use tools automatically when your request needs them.

(openai:gpt-4o)> what's in this folder?
(openai:gpt-4o)> read package.json and tell me the main entry
(openai:gpt-4o)> create a file called notes.md with today's plan
(openai:gpt-4o)> launch notepad
(openai:gpt-4o)> play some lofi on the living room speaker

Configuring providers

Set an API key for at least one provider:

companion config set providers.openai.apiKey sk-...
companion config set providers.anthropic.apiKey sk-ant-...
companion config set providers.google.apiKey AIza...

Or, from inside the chat:

/config set providers.openai.apiKey sk-...

Other useful config commands:

| Command | What it does | | --- | --- | | companion config list | Show all stored settings | | companion config get <key> | Read a single value | | companion config path | Print the on-disk config file path |

API-key values are masked in output. The config file lives in the OS-standard app data directory (%APPDATA%/nm-cli-nodejs/ on Windows).

Slash commands

Inside the chat, type / to see suggestions. Core commands:

| Command | Purpose | | --- | --- | | /help | List all commands | | /model | Switch provider or model interactively | | /config | Manage configuration (same keys as the CLI config subcommand) | | /devices | Discover, register, and test smart-home devices (Google Cast, Alexa) | | /agent | List, view, and run saved agents | | /clear | Wipe conversation history | | /exit (or /quit, /q) | Leave the chat |

Prefix-matching works, so /mo is enough to hit /model.

What the AI can do

When you ask for something, the model picks the right tool from this catalog. Mutating actions prompt you for confirmation before running.

FilesystemlistFiles, readFile, viewImage, searchFiles, globFiles, fileStats, writeFile, editFile, createDirectory, deleteFile

Shell & gitrunCommand, gitStatus, gitDiff, gitLog, gitCommit, gitBranch

Web & mediafetchUrl (with SSRF protection), generateImage, generateVideo

Canvas (in-memory image editing)createCanvas, drawText, drawImage, drawGradient, floodFill, brush tools (setBrush, brushStroke, brushFill, brushSmudge, brushBlur), saveCanvas

Desktop automation (Windows only)takeScreenshot, getOpenWindows, moveWindow, focusWindow, mouseClick, pressKeys, launchApp

Smart homelistSmartDevices, getDeviceStatus, controlDevice, playMedia, searchMusic, playMusic, sendNotification, askAssistant

Smart-home setup

Register devices once, then talk to them by name.

/devices

The interactive wizard scans your network for Google Cast devices (Chromecast, Google Home, Nest Hub) and walks you through linking Alexa. Once registered, the AI routes requests automatically:

  • "play some jazz in the kitchen" → YouTube search + Cast
  • "turn off the living room lights" → Google Assistant relay
  • "what's the weather?" → ask any linked Google device

Agents

Agents are reusable presets (system prompt + provider + model + temperature) stored as JSON in agents/. Run one from the command line:

companion agent list
companion agent view code-reviewer
companion agent run code-reviewer "review the diff in src/chat.ts"

Or from inside the chat:

/agent run code-reviewer review the last change I made

CLI reference

companion                       # start interactive chat (default)
companion chat [--verbose|--debug|--quiet]
companion config set <k> <v>
companion config get <k>
companion config list
companion config path
companion agent list
companion agent view <name>
companion agent run <name> <prompt>
companion --help
companion --version

Environment

  • .env in the current working directory is loaded automatically; system env vars take precedence.
  • Desktop automation uses koffi FFI to Win32 and is only enabled on process.platform === 'win32'.
  • Smart-home adapters (castv2-client, alexa-remote2, bonjour-service, google-tts-api) are optional dependencies — the CLI degrades gracefully when they aren't installed.

Development

git clone https://github.com/anmarht/companion-cli.git
cd companion-cli
npm install
npm run dev          # run from TypeScript via tsx
npm run build        # bundle to dist/ with tsup
npm run typecheck    # tsc --noEmit

The project is ESM-only — relative imports in TypeScript source must use the .js extension.

License

MIT — see LICENSE. Author: anmarht.