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

surtoa

v0.1.2

Published

CLI for generating images via Surtoa imagine endpoints

Readme

Surtoa CLI

npm version

CLI for interacting with Surtoa function endpoints from the terminal.

Current commands:

  • surtoa image generate
  • surtoa video generate
  • surtoa text generate
  • surtoa models list

Requirements

  • Node.js >= 22

Install

After publishing to npm:

npm install -g surtoa
surtoa --help

For local development:

Install dependencies:

npm install

Build the CLI:

npm run build

Run directly from the repo:

node dist/bin/imagine.js --help

Or link the binary locally:

npm link
surtoa --help

Commands

Image

Generate images from the /v1/function/imagine/* endpoints.

node dist/bin/imagine.js image generate \
  --prompt "future city at night, neon rain, cinematic" \
  --ratio 2:3 \
  --count 1 \
  --mode auto \
  --out ./output

Options:

  • --prompt <text> required
  • --ratio <2:3|1:1|3:2|16:9|9:16> default 2:3
  • --count <1-3> default 1
  • --nsfw <true|false> default true
  • --out <dir> default ./output
  • --function-key <key> optional
  • --mode <auto|ws|sse> default auto
  • --debug

Notes:

  • auto tries WebSocket first and falls back to SSE when needed.
  • Generated images are saved into the output directory.

Video

Generate videos from the /v1/function/video/* endpoints.

node dist/bin/imagine.js video generate \
  --prompt "a red apple slowly rotating on a wooden table" \
  --ratio 3:2 \
  --length 6 \
  --resolution 480p \
  --preset normal \
  --out ./output

Reference images can be passed either as URLs or local files.

URL example:

node dist/bin/imagine.js video generate \
  --prompt "@图1 street at night, slow camera push" \
  --image-url "https://example.com/ref.jpg"

Local file example:

node dist/bin/imagine.js video generate \
  --prompt "@图1 street at night, slow camera push" \
  --image-file ./ref1.jpg \
  --image-file ./ref2.png

Options:

  • --prompt <text> required
  • --ratio <3:2|2:3|16:9|9:16|1:1> default 3:2
  • --length <6-30> default 6
  • --resolution <480p|720p> default 480p
  • --preset <normal|fun|spicy|custom> default normal
  • --out <dir> default ./output
  • --function-key <key> optional
  • --image-url <url> repeatable, max 7
  • --image-file <path> repeatable, max 7
  • --debug

Notes:

  • --image-url and --image-file cannot be used together.
  • The CLI parses progress from the SSE stream and downloads the final mp4.

Text

Generate text from the /v1/function/chat/completions endpoint.

node dist/bin/imagine.js text generate \
  --prompt "用一句话介绍你自己"

With system prompt:

node dist/bin/imagine.js text generate \
  --prompt "写一个三行简介" \
  --system "你是一个简洁的中文写作助手"

With output file:

node dist/bin/imagine.js text generate \
  --prompt "写一个三行简介" \
  --out ./output/result.txt

With local file attachment:

node dist/bin/imagine.js text generate \
  --prompt "总结这个文件内容" \
  --file ./notes.png

Options:

  • --prompt <text> required
  • --model <id> default grok-4.20-beta
  • --system <text> optional
  • --temperature <0-2> default 0.8
  • --top-p <0-1> default 0.95
  • --file <path> optional, max 1
  • --out <path> optional
  • --function-key <key> optional
  • --debug

Notes:

  • Output is streamed to stdout as tokens arrive.
  • If --out is provided, the final text is also written to a UTF-8 file.

Models

List models from /v1/models.

node dist/bin/imagine.js models list --function-key YOUR_KEY

JSON output:

node dist/bin/imagine.js models list --function-key YOUR_KEY --json

Options:

  • --function-key <key> optional in the CLI interface, but some deployments require it
  • --json
  • --debug

Output

Generated files are typically written under ./output by default:

  • images: imagine_<timestamp>_<taskId>_<imageId>.<ext>
  • videos: video_<timestamp>_<taskId>.mp4
  • text: custom path when --out is provided

Development

Type-check:

npm run typecheck

Build:

npm run build

Run tests:

npm test

Run the full publish preflight:

npm run release:check

Publish to npm:

npm publish

Show command help:

node dist/bin/imagine.js
node dist/bin/imagine.js image generate --help
node dist/bin/imagine.js video generate --help
node dist/bin/imagine.js text generate --help
node dist/bin/imagine.js models list --help

Source Layout

src/
  cli/       command parsing, help, and command runners
  clients/   API clients for imagine, video, text, and models
  shared/    shared TypeScript types
  utils/     filesystem helpers
bin/         CLI entrypoint
test/        node:test suites