genmedia
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegenmedia CLI: fal.ai endpoint runner
genmedia CLI:fal.ai端点运行器
genmedia--jsongenmediaFor the full command surface (every flag, every option, every example), see references/full-reference.md.
genmedia--jsongenmedia如需查看完整命令集(所有参数、选项及示例),请参阅references/full-reference.md。
Critical rules
核心规则
- Always use when an agent will read the output. Pretty mode is for humans only.
--json - Never invent endpoint IDs. Use to discover,
genmedia models "<query>"to verify.genmedia models --endpoint_id <id> - Inspect schema before running. shows the exact field names. Guessed flags fail with 422.
genmedia schema <endpoint_id> --json - Save files with , not curl. The CLI handles authentication, naming, and file format detection.
--download - Use for long-running generation. Image work usually completes inline; video/audio/3D usually need queue + status polling.
--async
- 当Agent需要读取输出时,务必使用参数。 美观格式仅面向人类用户。
--json - 请勿自行编造端点ID。 使用发现端点,使用
genmedia models "<query>"验证。genmedia models --endpoint_id <id> - 运行前先查看schema。 会显示精确的字段名称。猜测参数会导致422错误。
genmedia schema <endpoint_id> --json - 使用保存文件,而非curl。 CLI会处理认证、命名和文件格式检测。
--download - 针对长时间运行的生成任务使用参数。 图像生成通常可同步完成;视频/音频/3D生成通常需要队列+状态轮询。
--async
Command index
命令索引
| Command | Purpose |
|---|---|
| Configure API key, output mode, auto-update |
| Search the catalog (or |
| Inspect inputs/outputs (compact or |
| Execute a model |
| Poll an async job (with |
| Upload a local file or remote URL to the fal.ai CDN |
| Check cost per call |
| Search fal.ai documentation |
| Install the default skill bundle into |
| `genmedia skills <list | install |
| Check or apply CLI updates |
| 命令 | 用途 |
|---|---|
| 配置API密钥、输出模式、自动更新 |
| 搜索目录(或使用 |
| 查看输入/输出(简洁格式或使用 |
| 执行模型 |
| 轮询异步任务(支持 |
| 将本地文件或远程URL上传至fal.ai CDN |
| 查看单次调用成本 |
| 搜索fal.ai文档 |
| 将默认技能包安装至 |
| `genmedia skills <list | install |
| 检查或应用CLI更新 |
Quick patterns
快速使用模式
Run a model and download the result
运行模型并下载结果
bash
genmedia run fal-ai/flux/dev \
--prompt "a cat on the moon" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonbash
genmedia run fal-ai/flux/dev \
--prompt "a cat on the moon" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonAsync + poll
异步任务+轮询
bash
SUBMIT=$(genmedia run fal-ai/veo3.1 --prompt "a dog running" --async --json)
REQ=$(echo "$SUBMIT" | jq -r '.request_id')
genmedia status fal-ai/veo3.1 "$REQ" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonbash
SUBMIT=$(genmedia run fal-ai/veo3.1 --prompt "a dog running" --async --json)
REQ=$(echo "$SUBMIT" | jq -r '.request_id')
genmedia status fal-ai/veo3.1 "$REQ" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonUpload then run
上传后运行模型
bash
URL=$(genmedia upload ./photo.jpg --json | jq -r '.url')
genmedia run fal-ai/nano-banana-pro/edit \
--image_urls "$URL" \
--prompt "make the sky stormy" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonbash
URL=$(genmedia upload ./photo.jpg --json | jq -r '.url')
genmedia run fal-ai/nano-banana-pro/edit \
--image_urls "$URL" \
--prompt "make the sky stormy" \
--download "./out/{request_id}_{index}.{ext}" \
--jsonDiscover when the user names a fuzzy task
用户模糊任务时的发现操作
bash
genmedia models "background removal product image" --json
genmedia models --category text-to-video --limit 5 --json
genmedia docs "webhook callbacks" --jsonbash
genmedia models "background removal product image" --json
genmedia models --category text-to-video --limit 5 --json
genmedia docs "webhook callbacks" --jsonSetup (first-time only)
首次设置
If is not installed:
genmediabash
curl https://genmedia.sh/install -fsS | bash # Linux / macOS
irm https://genmedia.sh/install.ps1 | iex # Windows PowerShell
genmedia setup --non-interactive --api-key "$FAL_KEY"For full setup details (output modes, auto-update, loading) see full-reference.md.
.env若未安装:
genmediabash
curl https://genmedia.sh/install -fsS | bash # Linux / macOS
irm https://genmedia.sh/install.ps1 | iex # Windows PowerShell
genmedia setup --non-interactive --api-key "$FAL_KEY"如需完整设置详情(输出模式、自动更新、加载),请参阅full-reference.md。
.env