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

@inliner/cli

v0.1.9

Published

CLI for Inliner.ai — generate and edit AI images from the terminal

Readme

@inliner/cli

CLI for Inliner.ai — generate and edit AI images from the terminal.

Install

npm install -g @inliner/cli

Or run directly with npx:

npx @inliner/cli generate "hero image" --project mysite --size 1200x600

Setup

Get an API key from Account > API Keys in the Inliner dashboard.

export INLINER_API_KEY=your-key

Or pass it per-command:

inliner-ai generate "hero" --api-key=YOUR_KEY --project mysite

Commands

Smart Mode (Default)

When no command is specified, the CLI parses your input as a smart description string:

# Pattern 1: Filename with dimensions and format → saves to local file
inliner-ai "hero-image_1200x600.png" -p mysite
# → Generates 1200x600 PNG, saves to hero-image_1200x600.png

# Pattern 2: Description with dimensions → outputs URL (or pipe to file)
inliner-ai "fat happy cats 900x900" -p mysite
# → Generates 900x900 PNG, prints URL to stdout

# Pattern 3: Filename with format only → saves to local file
inliner-ai "sunset-landscape.jpg" -p mysite
# → Generates JPG (API decides dimensions, usually 1024x1024), saves to sunset-landscape.jpg

# Override output filename with -o flag
inliner-ai "hero-image_1200x600.png" -p mysite -o custom-name.png
# → Generates image, saves to custom-name.png instead

# Auto-detects project if omitted (uses default project or first project)
inliner-ai "test-image_800x600.png"
# → Uses your default project automatically, saves to test-image_800x600.png

Supported patterns:

  • description_WxH.jpg or description_WxH.png → extracts dimensions and format, saves to file
  • description WxH → extracts dimensions, defaults to PNG, outputs URL
  • description.jpg → extracts format, API decides dimensions (usually 1024x1024), saves to file
  • description → no dimensions or format, API decides (usually 1024x1024 PNG), outputs URL
  • Auto-detects project if -p is omitted
  • Use -o filename.png to override the auto-detected output filename

generate

Generate an AI image from a text prompt.

# Print image URL to terminal
inliner-ai generate "modern office hero" -p acme --size 1200x600

# Pipe binary to file
inliner-ai gen "sunset landscape" -p mysite > hero.png

# Save directly
inliner-ai g "product shot" -p store -o product.png

# Auto-detect project (uses default project or first project)
inliner-ai generate "hero image" --size 1200x600

# No dimensions specified - API decides (usually 1024x1024)
inliner-ai generate "hero image" -p mysite

Options: | Flag | Description | |------|-------------| | -p, --project | Project namespace (auto-detects if omitted) | | --size WxH | Dimensions (default: API decides, usually 1024x1024) | | --width, --height | Alternative to --size | | -f, --format | png or jpg (default: png) | | -o, --output | Save to file |

edit

Edit an image with AI instructions. Accepts a local file, Inliner URL, or stdin.

# Edit a local file
inliner-ai edit photo.png "remove the background" -p myproject -o clean.png

# Pipe from stdin
cat photo.jpg | inliner-ai edit - "make it warmer" -p proj > warm.jpg

# Edit an existing Inliner image by URL
inliner-ai edit https://img.inliner.ai/proj/hero_800x600.png "add sunset sky"

For local files, the CLI uploads the image to your project first, then applies the AI edit.

inline

Process HTML files to resolve Inliner image references. Reads from stdin or a file.

# Replace placeholders with Inliner image tags
inliner-ai inline template.html -p acme > output.html

# Embed images as base64 data URIs (for emails, offline HTML)
cat email.html | inliner-ai inline --embed > email-inlined.html

Supported HTML patterns (with --project):

<!-- inliner: hero banner sunset landscape 1200x600 png -->
<!-- Becomes: <img src="https://img.inliner.ai/acme/hero-banner-sunset-landscape_1200x600.png" ...> -->

<img data-inliner="product shot on white background" width="800" height="600">
<!-- Gets an Inliner src URL added -->

With --embed, downloads all img.inliner.ai images and replaces URLs with data: URIs.

projects

List your Inliner projects.

inliner-ai projects
inliner-ai proj --json

create-project

Create a new project (reserves the namespace for your account).

# Create a project with required name
inliner-ai create-project my-project --name "My Project"

# Create with description and set as default
inliner-ai create-project marketing --name "Marketing Team" --description "Marketing assets" --default

# JSON output
inliner-ai create-project dev --name "Development" --json

Options: | Flag | Description | |------|-------------| | --name <name> | Display name (required) | | --description <desc> | Description (optional) | | --default | Set as default project (optional) | | --json | Output raw JSON |

images

List generated images.

inliner-ai images
inliner-ai img -p myproject --limit 20
inliner-ai img --search "hero" --json

usage

Show credit usage for your account.

inliner-ai usage
inliner-ai u --json

Smart Output

The CLI adapts its output based on context:

| Context | Behavior | |---------|----------| | Interactive terminal (TTY) | Prints the image URL | | Piped (\| ... or > file) | Outputs raw image bytes | | --output file.png | Saves to file, prints URL to stderr |

This means standard Unix patterns work naturally:

# Save to file via redirect
inliner-ai generate "hero" -p site > hero.png

# Pipe through ImageMagick
inliner-ai generate "logo" -p brand --size 400x400 | convert - -resize 200x200 logo-small.png

# Chain edit operations
inliner-ai edit photo.png "remove background" -p proj | inliner-ai edit - "add gradient bg" -p proj > final.png

Project Selection

The CLI automatically selects a project in this order:

  1. --project flag (explicit)
  2. INLINER_DEFAULT_PROJECT environment variable
  3. Default project (project marked as default in your account)
  4. First project (fallback if no default is set)

When auto-detecting, the CLI prints which project was used to stderr:

Using default project: mysite

Environment Variables

| Variable | Description | |----------|-------------| | INLINER_API_KEY | API key (required) | | INLINER_DEFAULT_PROJECT | Default project namespace (if --project omitted) | | INLINER_API_URL | API base URL (default: https://api.inliner.ai) | | INLINER_IMG_URL | Image CDN URL (default: https://img.inliner.ai) |

Links