CLI
Install the Lets Gen CLI and use the API from your terminal or coding agent.
Read as Markdown ↗The Lets Gen CLI is a standalone executable named letsgen. Discover models, upload owned references, generate image/video/audio, recover requests, and download completed outputs. Use the HTTP API for text streaming and video analysis, which are not CLI commands yet.
Install
Find packaged executables and checksum-verified installers on the GitHub releases page. Supported targets are macOS, Linux, and Windows on x86-64 and arm64. If a packaged release is not available yet, install from source with Go 1.25 or later:
go install github.com/LetsGenLab/letsgen-cli/cmd/letsgen@v0.1.0-alpha.1
letsgen versionAdd Go's binary installation directory to your PATH if letsgen is not found. Follow the repository's installation guide for packaged installation and upgrades.
Sign in
Use this API base URL for sign-in and subsequent commands.
letsgen --origin https://wegen.art auth login
letsgen --origin https://wegen.art auth statusBrowser login creates a revocable 30-day personal key. Choose read-only access with --read-only or set --monthly-gem-cap N; a cap of 0 disables spending. --no-browser prints the sign-in URL, but the browser must still reach the terminal's loopback callback. For remote terminals, use auth login --api-key and enter the key at its hidden prompt. Never put credentials in command arguments or chat.
For automation, provide LETSGEN_API_KEY securely in the environment; it overrides saved credentials. Set LETSGEN_API_ORIGIN=https://wegen.art to avoid repeating --origin. LETSGEN_CONFIG_DIR selects a different credential/request storage directory.
Discover, preview, then generate
letsgen --origin https://wegen.art --json models list --kind image
letsgen --origin https://wegen.art models inspect MODEL_ID
# Preview only: no network calls, uploads, or Gem spending.
letsgen --origin https://wegen.art --json generate image \
--model MODEL_ID --prompt 'A red fox in the snow' --max-gems 10 --dry-run
# Run only after approving this request's Gem budget.
letsgen --origin https://wegen.art generate image \
--model MODEL_ID --prompt 'A red fox in the snow' --max-gems 10 --output ./outReplace MODEL_ID with a current catalog ID. baseGems is not an exact quote. Pass only supported model settings in --parameters, for example '{"ratio":"1:1"}'. Repeat --reference ASSET_ID for owned references after assets upload FILE.
Use generate video for video, or generate audio --operation speech|music|voice_clone for audio. Speech and voice cloning need an authorized voiceProfileId in parameters; discover voices with voices list --scope mine. See image, video, and audio for input limits.
Tasks and request recovery
Generation waits up to 10 minutes by default. --timeout 20m changes the wait; --async returns the durable task immediately. A timeout does not cancel the server task.
letsgen --origin https://wegen.art tasks get TASK_ID
letsgen --origin https://wegen.art tasks wait TASK_ID --timeout 10m
letsgen --origin https://wegen.art tasks download TASK_ID --output ./out
# Recover an uncertain submission with its saved identity and exact payload.
letsgen --origin https://wegen.art requests list
letsgen --origin https://wegen.art requests retry REQUEST_ID --asyncRetry with the original origin and credential. Never create another request to recover an ambiguous submission. Downloads refresh signed URLs and never generate again or overwrite existing files. Partial tasks may still contain successful outputs.
Coding agents and scripts
--json keeps stdout machine-readable; progress and errors go to stderr. Agents need explicit spending permission and a numeric Gem budget before generation, with --max-gems on every approved request. A per-request ceiling does not replace a total session budget.
The CLI bundles its own letsgen skill:
letsgen skills list
letsgen skills show
letsgen skills install --target codex
letsgen skills install --target claudeThese install under ~/.codex/skills/letsgen or ~/.claude/skills/letsgen. Choose another skill root with --path DIR; existing skills are not overwritten. The docs-hosted generation skill also links to this CLI guide and the HTTP reference.
Exit codes: 0 success, 1 request/local failure, 2 invalid usage, 3 authentication/access, 4 timeout/interruption, 5 failed task/no outputs. Use letsgen help for the complete command list.
Sign out
letsgen --origin https://wegen.art auth logoutLogout revokes the saved credential and removes it locally. Remove any separately supplied environment credential from your shell or secret manager as needed.