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

@trycua/cli

v0.1.8

Published

Command-line interface for CUA cloud sandboxes and authentication

Downloads

173

Readme

CUA CLI (Bun)

Install

bun install
bun link           # register package globally
bun link cua-cli   # install the global binary `cua`

If you want to run without linking:

bun run ./index.ts -- --help

Commands

  • Auth

    The CLI supports both flat and grouped command styles:

    # Grouped style (explicit)
    cua auth login
    cua auth env
    cua auth logout
    
    # Flat style (quick)
    cua login
    cua env
    cua logout

    Available Commands:

    • login – opens browser to authorize; stores API key locally
      • --api-key sk-... – stores provided key directly
    • env – writes/updates .env with CUA_API_KEY
    • logout – clears stored API key
  • Sandboxes

    The CLI supports both flat and grouped command styles:

    # Flat style (quick & concise)
    cua list
    cua create --os linux --size small --region north-america
    cua start <name>
    cua stop <name>
    
    # Grouped style (explicit & clear)
    cua sb list         # or: cua sandbox list
    cua sb create       # or: cua sandbox create
    cua sb start        # or: cua sandbox start
    cua sb stop         # or: cua sandbox stop

    Available Commands:

    • list (aliases: ls, ps) – list all sandboxes
      • --show-passwords – include passwords in output
    • create – create a new sandbox
      • --os: linux, windows, macos
      • --size: small, medium, large
      • --region: north-america, europe, asia-pacific, south-america
    • get <name> – get detailed information about a specific sandbox
      • --json – output in JSON format
      • --show-passwords – include password in output
      • --show-vnc-url – include computed NoVNC URL
    • delete <name> – delete a sandbox
    • start <name> – start a stopped sandbox
    • stop <name> – stop a running sandbox
    • restart <name> – restart a sandbox
    • suspend <name> – suspend a sandbox (preserves memory state)
    • vnc <name> (alias: open) – open VNC desktop in your browser

Auth Flow (Dynamic Callback Port)

  • CLI starts a small local HTTP server using Bun.serve({ port: 0 }) which picks an available port.
  • Browser is opened to https://cua.ai/cli-auth?callback_url=http://127.0.0.1:<port>/callback.
  • After you click "Authorize CLI", the browser redirects to the local server with ?token=....
  • The CLI saves the API key in ~/.config/cua/cli.sqlite.

Note: If the browser cannot be opened automatically, copy/paste the printed URL.

Project Structure

  • index.ts – entry point (shebang + start CLI)
  • src/cli.ts – yargs bootstrapping
  • src/commands/auth.ts – auth/login/pull/logout commands
  • src/commands/sandbox.ts – sandbox list/start/stop/restart commands
  • src/auth.ts – browser flow + local callback server (dynamic port)
  • src/http.ts – HTTP helper
  • src/storage.ts – SQLite-backed key-value storage
  • src/config.ts – constants and paths
  • src/util.ts – table printing, .env writer

Notes

  • Stored API key lives at ~/.config/cua/cli.sqlite under kv(api_key).
  • Public API base defaults to https://api.cua.ai.
  • Website base defaults to https://cua.ai.
  • Authorization header: Authorization: Bearer <api_key>.