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

genmagic-pi

v0.1.0

Published

Image, video and speech generation for the pi coding agent: 60+ image and 30+ video models (Veo, Kling, Seedance, FLUX, Nano Banana, GPT Image) on one GenMagic key, as agent tools plus six skills.

Downloads

355

Readme

genmagic-pi

Image, video and speech generation for the pi coding agent, on one GenMagic key.

Ask pi for a hero image, a product shot, a short clip or a voiceover and it makes the file with the model that fits, saves it in your project, and tells you what it cost. One key and one pay-as-you-go balance cover 60+ image models (Nano Banana, GPT Image, FLUX, Seedream, Qwen Image, Recraft, Grok Imagine) and 30+ video models (Veo, Kling, Seedance, Wan, Hailuo, Grok Imagine, HeyGen), so you pick by price and quality instead of wiring one provider per model.

Install

pi install npm:genmagic-pi

To try it for one run without installing: pi -e npm:genmagic-pi.

Set up

  1. Get a free key with starter credit (it takes a minute): https://genmagic.co/get-api-key?utm_source=pi&utm_medium=package

  2. Put it in the environment pi runs in, for example in your shell profile:

    export GENMAGIC_API_KEY="your key"
  3. Start pi and ask for something: "Make a 1792x1024 hero image of a fox in fresh snow for the landing page", or "Which video models are cheapest for a 5 second clip?"

Keep the key in the environment, not in a project file. The package never writes it anywhere. Without a key, list_models still works and the other tools answer with the sign-up link instead of failing.

Tools

| Tool | What it does | |---|---| | generate_image(prompt, model?, size?, image?) | Makes or edits a picture and saves it. size is 1024x1024, 1792x1024 or 1024x1792. image is a picture to build on: an https URL, a data:image URL, or a PNG, JPEG, WebP or GIF file inside the working directory (3 MB at most). | | generate_video(prompt, model?, aspect_ratio?, duration?, image?) | Starts a video job, waits for it (under a minute to several minutes; interrupting pi stops the wait), saves the clip as a file and returns its hosted URL. aspect_ratio is 16:9, 9:16 or 1:1. image starts the clip from a picture. | | generate_speech(text, voice?, model?) | Turns text into spoken audio and saves it, with a hosted URL for the audio. | | list_models(category) | Lists the image, video or audio models with an estimated price each. Free, no key needed. |

Every generation is saved as a new file in pi's working directory, named like genmagic-image-a-red-fox-in-fresh-snow-20261101-181500.png. An existing file is never overwritten. Each result reports the saved path, the model and the cost. Leave model out to get GenMagic's recommended default.

What it costs

You pay per generation from a prepaid GenMagic balance. There is no subscription. list_models shows an estimated price for every model, each result reports what the call actually cost and what is left, and a video is charged once, when the clip completes.

The tools tell the agent that every call is charged to your GenMagic balance, and ask it to name the model and its price before a video or a run of images, so you can object. When your balance runs out, GenMagic's own message (it says how to top up) is shown as it is. If you want a confirmation before every paid call, add a pi extension that gates tool calls: these tools declare that they are not read-only.

Skills

Seven GenMagic skills ship in the package, so pi can load the playbook when the task calls for it:

| Skill | For | |---|---| | genmagic-image-generation | Hero images, product shots, illustrations, logos, edits | | genmagic-video-generation | Text-to-video and image-to-video clips, and the asynchronous job | | genmagic-text-to-speech | Voiceovers and narration | | genmagic-music-generation | Background music, jingles and soundtracks | | genmagic-faceless-shorts | A complete faceless short for YouTube Shorts, TikTok or Reels | | genmagic-ugc-video-ads | A UGC-style video ad from a product photo | | genmagic-n8n-workflows | GenMagic steps in n8n workflows, with the verified node |

They are the same skills genmagic.co publishes at /.well-known/skills/. They call the GenMagic REST API with curl; inside pi the tools above do the same job, and pi is told to use the tools first. Music has no tool here, so the music skill still uses the REST API.

Safety and privacy

  • The key is read from GENMAGIC_API_KEY when a tool runs. It is sent to genmagic.co as a bearer token and nowhere else: not to the model providers, not to the media host a result is downloaded from.
  • Your prompt, text and any reference picture are sent to GenMagic, which passes them to the model's provider.
  • A local reference picture is read only if it is a real PNG, JPEG, WebP or GIF file inside the working directory (symlinks out of it are refused).
  • Results are downloaded over https only, and written as new files in the working directory.
  • Like any pi extension, it runs with your permissions. It has no runtime dependencies and no install scripts; the source is the TypeScript in extensions/ and src/.
  • A generation is never retried automatically, because a retry could be charged twice. Only the free status lookups that poll a video job are retried.

Limits

  • generate_video waits up to 20 minutes. If it stops waiting (you interrupt pi, the network fails, or the limit is reached), the job can still finish at GenMagic and is then charged; the result names the job so you do not start a second one.
  • For options the tools do not expose (an end frame, reference images, resolution, music, several images at once) use the GenMagic API directly: it is documented as OpenAPI at https://genmagic.co/openapi.json.

License

MIT. Questions: [email protected]