AI-powered image generation and editing CLI tool built with Bun and Fal.ai.
- 🎨 Generate AI images from text prompts
- ✏️ Edit existing images with AI
- 🖼️ Display images directly in your terminal
- 📁 Manage generated images locally
- 🚀 Fast and efficient processing with Bun runtime
- 🚀 Fast and lightweight
- 🔄 Automated versioning with conventional commits
- Clone the repository:
git clone <your-repo-url>
cd paint- Install dependencies:
bun install- Set up your API key:
# Get your API key from https://fal.ai/dashboard/keys
paint config --api-key YOUR_FAL_API_KEY_HERE- Build the project:
bun run build- Install globally for local testing:
npm linknpm install -g paintai
# Set up your API key
paintai config --api-key YOUR_FAL_API_KEY_HERE-
Install the CLI:
npm install -g paintai
-
Get your API key:
- Visit fal.ai/dashboard/keys
- Create a new API key
-
Configure the CLI:
paintai config --api-key YOUR_FAL_API_KEY_HERE
-
Generate your first image:
paintai --prompt "a beautiful sunset over mountains"
# Generate a new image (interactive)
paintai
# Generate with a prompt
paintai --prompt "a serene mountain landscape at sunset"
# Show the last generated image
paintai l
# Edit mode (select from existing images)
paintai e
# Edit a specific image
paintai e image.png --prompt "add dramatic clouds"
# Configure your API key
paintai config
# Check API key status
paintai config-h, --help- Show help message-v, --version- Show version-d, --debug- Enable debug mode--prompt TEXT- Provide prompt as argument--type TYPE- Set command type (i/l/e)
The CLI stores your API key securely in a local config file (~/.paintai/config.json) with restricted permissions. This approach is more secure than using environment variables as it:
- ✅ Keeps your API key out of shell history
- ✅ Prevents exposure in process lists
- ✅ Uses file system permissions for security
- ✅ No need to modify shell configuration files
Note: Use paintai config --api-key YOUR_KEY to set up your API key securely!
FAL_API_KEY- Your Fal.ai API key (for backward compatibility)
The CLI will first check for a config file, then fall back to the environment variable if needed.
Enable tab completion for better user experience:
# Install completion
paintai --completion install
# Follow the instructions to add the completion script to your shell config
# Then reload your shell or restart your terminal
# Test completion
paintai <TAB> # Should show available commands and options
paintai e <TAB> # Should show available image files for editingTo uninstall completion:
paintai --completion uninstall# Development mode with hot reload
bun run dev
# Run tests
bun run test
# Build for production
bun run build
# Uninstall global link
bun run uninstall-global- Bun runtime (for development)
- Fal.ai API key (get one at fal.ai/dashboard/keys)
- Terminal that supports image display (iTerm2, Kitty, etc.)
MIT