Skip to content

Install

ask-openrouter is a command-line tool. It needs Node.js 22 or newer and nothing else. Check what you have:

Terminal window
node --version

If the answer is v22 or higher, you are ready. If it is lower, install a current Node first, from nodejs.org or with a version manager such as nvm or fnm. The package manager warns you when the version is too old, and a tool that runs on an unsupported Node can fail in odd ways, so take the warning seriously.

npx downloads the package the first time and runs it. It keeps the download in its cache, so the next run starts quickly.

Terminal window
npx ask-openrouter --help

That prints everything the tool can do, and it asks nothing of you: no key, no model, no network after the download. It is the quickest way to see whether the tool suits you. To pin a version, name it: npx ask-openrouter@1 --help runs the newest 1.x release.

pnpm dlx ask-openrouter --help does the same for pnpm users.

If you will use the tool often, install it once. The command then lives on your path and starts at once.

With npm:

Terminal window
npm install --global ask-openrouter

With pnpm:

Terminal window
pnpm add --global ask-openrouter

Then check it:

Terminal window
ask-openrouter --version

The tool prints its version number on a line of its own, for example 1.0.0.

Two things sometimes get in the way:

  • The command is not found after a global install with pnpm. pnpm keeps global commands in a folder of its own, and your shell may not know about it yet. Run pnpm setup, then open a new terminal.
  • pnpm reports an ignored build script for @openrouter/sdk. You can leave it ignored. The tool does not need that script.

To move to the newest release:

Terminal window
npm install --global ask-openrouter@latest
pnpm add --global ask-openrouter@latest

Use the line that matches the tool you installed with. To remove it:

Terminal window
npm uninstall --global ask-openrouter
pnpm remove --global ask-openrouter

Versions follow SemVer. The overview says what that promises.

Cloning the repository and running it from source is a different job, for people who want to change the tool. CONTRIBUTING.md explains how to set that up.

The tool needs a key and a model before it can answer. Set up takes a few minutes.