Skip to main content

Install

Install with npm. You need Node.js 20 or later.
To install without Node.js, use the standalone binary:
npx -y @stophy/cli@latest init --all --browser installs the CLI, adds Stophy’s agent skills to your project, and logs in, in one command.

Authenticate

Log in with your browser:
The CLI prints a code and opens stophy.dev. Check that the page shows the same code, then approve it. On a server with no browser, open the printed link on any other device: the CLI logs in once you approve there. To use an API key instead, pass it to login or set it as an environment variable:
Each computer gets its own key. Web search, YouTube search and YouTube transcripts work without logging in. Log out and revoke this computer’s key:

Make a call

Name the source, then the command:
Run stophy <source> --help to see what a source can do, and stophy <source> <command> --help for every option on one command. If you give a value an option does not accept, the CLI stops before it calls Stophy and lists which values work.

Get markdown

Markdown is the default. Add --json to get the data as JSON instead, with the credits used printed to stderr:

Page through results

When there are more results, the output ends with a cursor. Pass it back to get the next page:

Save the output

-o <path> writes the output to a file instead of stdout:

Handle errors and retries

A failed call exits non-zero and writes its message to stderr. When the API says to wait, the message ends with Retry after Ns. and the CLI does not retry for you:
To retry on a rate limit from a script, parse the wait time out of that message, or call stophy status first to check your account is live before a batch of calls.

Check your account

status shows your login and balance. usage shows your balance and all-time usage. logs shows your recent requests.

Commands