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

askoai

v0.1.0

Published

Prompt OpenAI (and OpenAI-compatible APIs) straight from your terminal, with profiles, JSON pretty-printing and clipboard copy.

Readme

askoai

Prompt OpenAI — or any OpenAI-compatible API — straight from your terminal, the way you'd chat on the web. Text only, one question per call, answer printed and copied to your clipboard.

$ askoai What is the capital of France?
Paris.
(copied to clipboard)

Install

npm install -g askoai

Requires Node.js ≥ 22.12. askoai is installed.

Quick start

askoai profile new          # asks API_KEY, SYSTEM_PROMPT, BASE_URL, then "more? (y/N)"
askoai Explain monads in one sentence

The first profile you create becomes the default. Every later call uses the default profile unless you pass -p <name>.

Prompting

askoai What is the capital of France?
askoai 'Return {"city": "...", "country": "..."} for Paris'   # JSON answers are pretty-printed
git diff | askoai write a commit message                      # stdin is appended to the prompt
askoai -p work --no-copy "Summarise this"                     # pick a profile, skip the clipboard
askoai -m gpt-4.1 -s "Answer like a pirate" ahoy              # per-call model / system prompt
askoai --stream tell me a story                               # stream tokens (no JSON formatting)
askoai --raw 'give me json'                                   # never pretty-print
askoai ask profile of Ada Lovelace                            # explicit form, see Notes

| Flag | Meaning | |------|---------| | -p, --profile <name> | Use this profile instead of the default | | -m, --model <model> | Override the model for this call | | -s, --system <prompt> | Override the system prompt for this call | | -t, --temperature <n> | Override the temperature (0–2) | | --copy / --no-copy | Force clipboard copy on/off | | --stream / --no-stream | Stream the answer / wait for it | | --raw | Print exactly what the model returned |

When the answer is a JSON object or array (optionally inside a ```json fence) it is re-indented and colourised; the clipboard gets the plain, indented JSON.

Profiles

A profile bundles an API key, system prompt, base URL and a handful of model settings.

askoai profile                      # show the default profile
askoai profile ls                   # list profiles (* marks the default)
askoai profile new [name]           # create interactively (aliases: mk, create, add)
askoai profile show <name>
askoai profile default <name>       # set the default
askoai profile set --default <name> # same thing
askoai profile configure <name>     # edit every field interactively (aliases: config, edit)
askoai profile configure --system-prompt 'You are terse.'   # edit the default profile via flags
askoai profile configure work --model gpt-4.1 --temperature 0.2 --no-copy
askoai profile rm <name>            # aliases: remove, delete
askoai profile path                 # where the config lives

profile can be shortened to p (askoai p ls).

Fields

| Field | Flag | Notes | |-------|------|-------| | API_KEY | --api-key | Empty → uses $OPENAI_API_KEY at run time | | SYSTEM_PROMPT | --system-prompt | Optional | | BASE_URL | --base-url | Empty → https://api.openai.com/v1 (or $OPENAI_BASE_URL). Point it at Ollama, OpenRouter, Azure, … | | MODEL | --model | Default gpt-4o-mini | | TEMPERATURE | --temperature | 0–2 | | MAX_TOKENS | --max-tokens | Integer | | TOP_P | --top-p | 0–1 | | COPY_TO_CLIPBOARD | --copy / --no-copy | Default yes | | STREAM | --stream / --no-stream | Default no |

The last six are the "more? (y/N)" questions in profile new. Any flag you pass to profile new skips that question; profile new <name> -y --api-key … creates a profile with no questions at all (handy for scripts). Passing an empty string (--system-prompt '') clears a field.

Where it's stored

~/.config/askoai/config.json (respects $XDG_CONFIG_HOME; %APPDATA%\askoai on Windows), written with mode 0600. Set ASKOAI_CONFIG_DIR to use another directory.

Notes

  • An unquoted prompt that starts with a command name (profile, p, ask) is treated as that command. Quote it (askoai 'profile of Ada Lovelace') or use the explicit form: askoai ask profile of Ada Lovelace.
  • Clipboard copy uses clipboardy; on Linux it wants xsel/xclip/wl-copy but ships a fallback. If copying fails you'll see a dim notice on stderr and the answer is still printed.
  • Only OpenAI's Chat Completions endpoint is used, so any server that implements it works via BASE_URL.

Development

npm install
npm run dev -- What is 2+2          # run from source
npm run check                       # typecheck + lint + tests
npm run build                       # emit dist/

node scripts/mock-server.mjs        # OpenAI-compatible echo server on :8765 for manual testing
ASKOAI_CONFIG_DIR=/tmp/askoai askoai profile new dev -y --api-key x --base-url http://127.0.0.1:8765/v1

License

MIT