JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q49922F
  • License MIT

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

Package Exports

  • @inliner/cli
  • @inliner/cli/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@inliner/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

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

Options:

Flag Description
-p, --project Project namespace (required)
--size WxH Dimensions (default: 800x600)
--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

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

Environment Variables

Variable Description
INLINER_API_KEY API key (required)
INLINER_API_URL API base URL (default: https://api.inliner.ai)
INLINER_IMG_URL Image CDN URL (default: https://img.inliner.ai)