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

yolox

v4.0.1

Published

Use AI language models to write one-liner shell commands, then execute them. 🤞

Readme

yolox 🤞

Use AI language models to write one-liner shell commands, then execute them.

Examples

$ yolox list all files in the current directory, sorted by human size
# ls -lhS
$ yolox rename all jpeg files to jpg
# for file in *.jpeg; do mv "$file" "${file%.jpeg}.jpg"; done
$ yolox extract from 0:30 to 1:22 from video.mp4 and save it as audio.m4a
# ffmpeg -i video.mp4 -ss 00:00:30 -to 00:01:22 -vn -acodec copy audio.m4a
$ yolox create slideshow.mp4 from all the jpg files in the current directory with one second for each slide
# ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' slideshow.mp4
$ yolox "add 100px white padding around dots.png and save it as dots-with-room.png"
# convert dots.png -bordercolor white -border 100 dots-with-room.png

Working with Piped Data

You can pipe data to yolox and it will include that data in the context when generating commands:

$ echo '{"name": "Alice", "age": 30, "city": "NYC"}' | yolox "use jq to extract just the name"
# echo '{"name": "Alice", "age": 30, "city": "NYC"}' | jq '.name'
$ cat users.json | yolox "use jq to get all users over age 25"
# cat users.json | jq '.[] | select(.age > 25)'
$ ps aux | yolox "find processes using more than 50% CPU"
# ps aux | awk '$3 > 50'
$ curl -s https://api.github.com/users/octocat | yolox "extract the public repos count with jq"
# curl -s https://api.github.com/users/octocat | jq '.public_repos'

File-based Prompts

You can also pass a file containing the prompt. This lets you write long prompts and iterate on them without retyping:

echo "do some stuff" > PROMPT.md
$ yolox PROMPT.md

Supported Models

Use the --model flag to specify which model to use (default is gpt-4o-mini).

  • gpt-4o-mini (default)
  • gpt-4o
  • claude-sonnet-4-5
  • claude-haiku-4-5
  • llama-3-70b
  • llama-3.1-405b

Examples:

# Use default (gpt-4o-mini)
yolox "list files"

# Use Claude Sonnet
yolox --model=claude-sonnet-4-5 "list files"

# Use GPT-4o
yolox --model=gpt-4o "list files"

Caution

This tool should be used with caution. It's called "YOLO X" because it's dangerous. yolo as in "you only live once" and x as in "execute this code". It lets an AI write code for you, then blindly executes that code on your system. There are a few guardrails in its prompt to prevent the result from taking destructive actions like deleting files or directories, but there's always still a danger that the resulting commands will have unintended consequences. You've been warned!

Installation

npm i -g yolox

or you can just invoke it directly with npx:

npx yolox@latest "use ffmpeg to convert foo.mkv to foo.mp4"

Usage

yolox supports three input methods:

  1. Direct command: yolox "command description"
  2. File input: yolox filename.txt (where the file contains the command description)
  3. Stdin input: echo "data" | yolox "process this data"

Command Line Options

  • --model: Choose the AI model to use (default: gpt-4o-mini)
  • --print: Show the generated command without executing it

Examples

# Basic usage (uses gpt-4o-mini by default)
yolox "list files by size"

# Use Claude Sonnet
yolox --model=claude-sonnet-4-5 "compress all png files"

# Use Claude Haiku (fast and cost-effective)
yolox --model=claude-haiku-4-5 "find large files"

# Use GPT-4o
yolox --model=gpt-4o "complex task requiring advanced reasoning"

# Print mode (don't execute)
yolox --print "find large files"

# With piped data
cat data.csv | yolox "convert to JSON using any available tools"

# Using a prompt file
echo "complex multi-line prompt here" > prompt.txt
yolox prompt.txt

OpenAI Usage (GPT-4o-mini, GPT-4o)

Set your OpenAI API key in the environment:

export OPENAI_API_KEY="..."

Then give it a command and it will execute it (uses GPT-4o-mini by default):

yolox "extract audio from maths.mp4 and save it as maths.m4a"
# ffmpeg -i maths.mp4 -vn -acodec copy maths.m4a

To use GPT-4o instead:

yolox --model=gpt-4o "extract audio from maths.mp4 and save it as maths.m4a"
# ffmpeg -i maths.mp4 -vn -acodec copy maths.m4a

Anthropic Usage (Claude Sonnet, Claude Haiku)

Set your Anthropic API key in the environment:

export ANTHROPIC_API_KEY="..."

Then specify model as claude-sonnet-4-5 for Claude Sonnet 4.5 (best for complex reasoning):

yolox --model=claude-sonnet-4-5 "extract audio from maths.mp4 and save it as maths.m4a"
# ffmpeg -i maths.mp4 -vn -acodec copy maths.m4a

Or use claude-haiku-4-5 for Claude Haiku 4.5 (faster and more cost-effective):

yolox --model=claude-haiku-4-5 "list all jpg files"
# ls *.jpg

Replicate Usage (Llama 3)

Set your Replicate token in the environment:

export REPLICATE_API_TOKEN="r8_..."

Then specify model as llama-3.1-405b or llama-3-70b:

yolox --model=llama-3.1-405b "extract audio from maths.mp4 and save it as maths.m4a"
# ffmpeg -i maths.mp4 -vn -acodec copy maths.m4a

Print mode

Print the command but don't execute it:

yolox --print "extract audio from maths.mp4 and save it as maths.m4a"
ffmpeg -i maths.mp4 -vn -acodec copy maths.m4a

Testing

Run the test suite:

npm test

The tests cover:

  • Basic functionality and argument parsing
  • Stdin input handling
  • Model selection and validation
  • File-based prompt input
  • Print mode operation
  • Error handling

Alternatives

GitHub Copilot CLI is a paid offering from GitHub that works similarly to yolox, but is safer. Rather than running the generated command, it shows you the command and gives you some options:

$ gh copilot suggest -t shell "list all files"

Suggestion:

  ls -a

? Select an option  [Use arrows to move, type to filter]
> Copy command to clipboard
  Explain command
  Revise command
  Rate response
  Exit

License

MIT