Skip to main content
genmedia is a command-line tool that gives any terminal, script, or AI agent direct access to fal’s 1,000+ models. In a terminal it prints a compact human-readable view; when its output is piped or --json is passed, every command emits structured JSON. While the MCP server is the best fit for assistants that speak the Model Context Protocol, genmedia needs nothing but a shell — so it also works in CI/CD pipelines, shell scripts, and agents driven purely by shell commands.
This is not the fal CLI. For deploying and managing your own fal applications — fal deploy, fal run, fal apps — see the CLI Reference.

Installation

This installs the release binary into ~/.genmedia and puts genmedia on your PATH.
genmedia requires a fal API key. If you don’t have one yet, create one here.

Quick Start

1

Set your API key

Or run genmedia setup to save it encrypted to your local config.
2

Find a model

3

Generate an image


Commands

genmedia covers configuration, model discovery, execution, file uploads, documentation search, and agent onboarding. Run genmedia --help --json for the complete machine-readable command list.

setup

Interactive wizard that configures your API key (saved encrypted locally), .env auto-loading, default output mode, and automatic updates.
For agents and CI, configure it without prompts. Every flag is optional and omitted fields keep their current values, so repeated invocations are idempotent.
Options:

models

Search and inspect fal’s catalog. Pass a query, a category filter, or both. When you give a query without --category, genmedia classifies it and applies an inferred category for you.
Options:

schema

Get the full input/output parameters for any model. Use this before run to see what options are available.
Returns all parameters with types, descriptions, defaults, and which are required.

run

Run any fal model. By default, submits to the queue and waits for the result.
Options: Model parameters are passed as --key value flags, and the key names match the model’s input schema exactly. To see a specific model’s parameters rendered as CLI flags:
You can also skip the endpoint ID entirely — pass a bare prompt and genmedia picks a suitable model for you:

status

Check the status of an async job, fetch the result, or cancel it.
Options:

upload

Upload a local file or URL to fal’s CDN. Returns a URL you can pass to any model.
Returns a cdn_url like https://v3b.fal.media/files/b/... that works with any model parameter that accepts a URL.

pricing

Get the cost of running a model.

docs

Search the fal documentation for guides, API references, and examples.

Every successful genmedia run records its outputs into a per-session, self-contained HTML page under ~/.genmedia/gallery/sessions/, aggregating every image, video, audio, and 3D asset produced in one agent session into a filterable grid.
Set GENMEDIA_NO_GALLERY=1 to disable recording.

init and skills

Install agent skills so coding agents in a project know how to use genmedia without reading --help first.
init writes into .agents/skills/ if the project has an .agents/ directory, otherwise .claude/skills/. Commit that directory so teammates and other agents get the same context.

version and update

Automatic background update checks are on by default. Set GENMEDIA_NO_UPDATE=1 to disable them; genmedia update still works.

Output and JSON

Output adapts to where it’s going:
  • In a terminal — a compact, human-readable view.
  • Piped, redirected, or with --json — structured JSON.
To make JSON the default everywhere, run genmedia setup --non-interactive --output-format json. Errors are written to stderr as JSON with a non-zero exit code:
Some errors carry an additional details object with context such as request_id, status, or validation_errors. Success responses vary by command but always include the relevant data as a JSON object.

Examples

End-to-end image generation

Video generation (async)

Image-to-video with file upload

Parameter names are per-endpoint. This endpoint takes start_image_url (plus an optional end_image_url), not image_url. Run genmedia run <endpoint_id> --help to see exactly what a model accepts.

Use with AI agents

The fastest way to teach an agent about genmedia is to install the skill bundle in your project:
For agents that build their own tool configuration, ask genmedia to describe itself:
This returns a structured object with the CLI’s name, version, install info, expected environment variables, and a commands map giving each command’s description, usage, arguments, options, and output fields — everything an agent needs to discover capabilities without guessing.

Next Steps

AI Tools

Connect MCP-compatible assistants to the full fal platform

Get Your API Key

Create and manage the keys genmedia authenticates with

Async Inference

How async submission, status polling, and webhooks work

GitHub Repository

View the source code, report issues, or contribute