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

@model-go/cli

v0.1.6

Published

The official CLI for modelgo. Pairs with AI agent skills so AI agents can operate modelgo on your behalf.

Readme

modelgo-cli

The official CLI for modelgo. Pairs with AI agent skills (Claude Code, Codex, Gemini CLI, etc.) so AI agents can operate modelgo on your behalf.

v0 framework stage. Device-flow auth commands are available. modelgo pay request supports anonymous x402 pay-per-call calls to model gateway APIs; API key management is not wired up yet.

Install

npx @model-go/cli@latest install

This runs an interactive wizard that:

  1. Installs @model-go/cli globally via npm (which downloads the Go binary from GitHub Releases as modelgo).
  2. Distributes modelgo-* skills to every AI agent installed on your machine (Claude Code, Trae, Trae CN, and other agents in the skills ecosystem).

After install, restart your AI agent (open a new chat / session) and try:

"Check my modelgo login status."

Your AI should find the modelgo-shared skill and run modelgo auth status.

Direct commands

modelgo --version
modelgo auth login
modelgo auth status
modelgo auth logout
modelgo pay methods
modelgo pay request --env cn --path /v1/chat/completions --method POST --data '{"model":"gpt-4o","messages":[]}' --json
modelgo --help

modelgo auth login without --no-wait is a blocking command: it prints the authorization URL, then keeps polling until the browser approval completes or the device code expires.

Environments

The CLI talks to a named environment. Two are built in:

| Env | Base URL | | ------ | ---------------------------- | | cn | https://api.modelgo.com | | intl | https://api.modelgo.ai |

The active environment defaults to cn. Switch it, or register your own:

modelgo env list                 # show built-in + custom envs (active marked with *)
modelgo env current              # print the active env
modelgo env use intl             # switch the active env
modelgo env add <name> --base-url https://...   # register or override an env URL
modelgo env remove <name>        # remove a custom env or override

Environment definitions and the active selection live in ~/.modelgo/config.json. Credentials are stored per-env in ~/.modelgo/auth.json, so switching environments preserves each login. There are no environment variables to set.

Auth commands operate on the active env; pass --env <name> to target a different one:

modelgo auth login --env intl
modelgo auth status --env intl
modelgo auth logout --all          # clear every env

Non-streaming agent flows

For AI-agent harnesses that cannot stream intermediate output to the user, use:

modelgo auth login --no-wait --json
modelgo auth login --device-code <DEVICE_CODE>

Do not show the URL and then immediately block on --device-code in the same turn. In final-message-only harnesses, that pattern prevents the user from ever seeing the URL before the agent starts waiting.

--json emits newline-delimited JSON (NDJSON). In the default waiting flow (modelgo auth login --json without --no-wait), stdout receives two JSON objects: first the device-code object (with verification_url), then the authenticated object once approved. Parse line by line — don't JSON.parse the whole stream. With --no-wait, only the device-code object is printed.

x402 pay-per-call model APIs

Use modelgo pay request when the user wants to call a model API without logging in to ModelGo first. The CLI opts into the gateway x402 path with X-Payment-Protocol: x402.

modelgo pay request --env cn --path /v1/chat/completions --method POST --data '{"model":"gpt-4o","messages":[{"role":"user","content":"hello"}]}' --intent "调用 gpt-4o 完成聊天补全" --json

In the cn environment, if the gateway returns a 402 that advertises alipay:*, the CLI writes the PAYMENT-REQUIRED payload to a local file and returns a structured handoff for alipay-payment-skill. In intl, the CLI does not route to Alipay; it returns the advertised x402 options for a future non-Alipay rail.

Upgrade

Re-run the installer; it detects an out-of-date install and upgrades in place:

npx @model-go/cli@latest install

License

MIT — see LICENSE.