Cursor + Inliner CLI Integration - Terminal Image Generation | Inliner.ai

Cursor + Inliner CLI

Maximize your Cursor workflow with Inliner's CLI and MCP integration. Generate images from the integrated terminal or let Cursor's AI handle it automatically.

Cursor IDE with terminal panel showing code editor in modern workspace

Two Ways to Generate Images

MCP Server (AI-Driven)

Let Cursor's AI generate images automatically during conversations.

  • AI picks appropriate dimensions
  • Seamless conversation flow
  • Project-aware generation

CLI (Direct Control)

Run commands directly in Cursor's integrated terminal.

  • Precise control over output
  • Batch processing support
  • CI/CD integration

Setup: MCP Server Integration

Give Cursor's AI direct access to image generation:

Step 1: Get Your API Key

  1. Log into your Inliner.ai dashboard
  2. Go to Account > API Keys
  3. Click Create API Key and copy it

Step 2: Configure MCP in Cursor

Create .cursor/mcp.json in your project root:

.cursor/mcp.json

{
  "mcpServers": {
    "inliner": {
      "command": "npx",
      "args": ["@inliner/mcp-server"],
      "env": {
        "INLINER_API_KEY": "inl_your-api-key-here"
      }
    }
  }
}
Pro Tip: For global setup (all projects), configure MCP in Cursor Settings > Features > MCP.

Setup: CLI in Cursor Terminal

Use the Inliner CLI directly from Cursor's integrated terminal:

Cursor Terminal (Ctrl+`)

# Set your API key (add to .bashrc/.zshrc for persistence)
export INLINER_API_KEY=inl_your-api-key

# Generate an image
npx @inliner/cli "hero-banner_1200x600.png" -p myproject

# Generate and save to specific path
npx @inliner/cli "product-photo_800x800.png" -p store -o ./public/images/product.png

Workflow Examples

Building a Landing Page

Terminal

# Generate all images for a landing page
npx @inliner/cli "hero-startup-team_1920x1080.png" -p landing -o ./public/hero.png
npx @inliner/cli "feature-analytics_600x400.png" -p landing -o ./public/feature1.png
npx @inliner/cli "feature-dashboard_600x400.png" -p landing -o ./public/feature2.png
npx @inliner/cli "testimonial-avatar_200x200.png" -p landing -o ./public/avatar1.png

Quick Image Edits

Terminal

# Remove background from a photo
npx @inliner/cli edit ./photo.png "remove background" -p myproject -o ./photo-clean.png

# Chain edits with pipes
npx @inliner/cli edit ./logo.png "add shadow" -p brand | \
  npx @inliner/cli edit - "resize to 512x512" -p brand -o ./logo-final.png

Using with npm scripts

Add to your package.json:

package.json

{
  "scripts": {
    "generate:hero": "npx @inliner/cli 'hero_1920x1080.png' -p mysite -o ./public/hero.png",
    "generate:og": "npx @inliner/cli 'og-image_1200x630.png' -p mysite -o ./public/og.png",
    "generate:all": "npm run generate:hero && npm run generate:og"
  }
}

Best Practices

Team Tip: Create a shared Inliner team account and distribute API keys to team members. Each person can have their own key while sharing the same credit pool. Learn about team accounts →

Related Documentation

Ready to Supercharge Cursor with AI Images?

Get your API key and start generating images in minutes