Skip to content

Generating Output

The betterprompt generate command runs an installed skill and produces output. The skill must be installed locally before you can generate with it.

Basic usage

bash
betterprompt generate <skill-slug> --input <key=value>
bash
betterprompt generate seo-blog-writer \
  --input topic="best ai prompt tools" \
  --input audience="marketers"

The CLI resolves the skill slug to a promptVersionId from the installed manifest and sends it to the API. When the run completes, text output is printed to stdout. Image and video outputs are saved as local files.

Input methods

There are several ways to provide inputs. They are mutually exclusive — use one approach per call.

Pass each input as a repeatable --input flag:

bash
betterprompt generate seo-blog-writer \
  --input topic="best ai prompt tools" \
  --input tone="professional"

Image inputs

For skills that accept images, use --image-input-url or --image-input-base64:

bash
betterprompt generate image-captioner \
  --input style="casual" \
  --image-input-url "https://example.com/photo.png"

Both flags are repeatable for skills that accept multiple images.

JSON payload

Pass a complete input object as JSON:

bash
betterprompt generate seo-blog-writer \
  --input-payload '{"textInputs":{"topic":"ai trends","tone":"clear"}}'

Stdin

Pipe a JSON input payload from stdin:

bash
cat input.json | betterprompt generate seo-blog-writer --stdin --json

Input precedence

  1. --input / --image-input-* flags
  2. --stdin
  3. Skill default values

--input-payload is mutually exclusive with all other input methods.

Options

FlagDescription
--input <key=value>Text input (repeatable).
--image-input-url <url>Image input as URL (repeatable).
--image-input-base64 <b64>Image input as Base64 (repeatable).
--input-payload <json>Complete JSON input object.
--stdinRead JSON input from stdin.
--model <model>Override the generation model.
--options <json>Run options JSON (e.g. {"reasoningEffort":"high"}).
--jsonOutput raw JSON instead of pretty-printed result.

Output format

By default, text outputs are printed directly to stdout. Use --json for structured output:

json
{
  "runId": "01234567-89ab-cdef-0123-456789abcdef",
  "runStatus": "succeeded",
  "outputs": [
    { "type": 0, "data": "# Best AI Prompt Tools\n\nHere are the top tools..." }
  ]
}

Output types:

TypeNameDescription
0TextMarkdown-formatted text.
1ImagePath to saved image file.
2ErrorError message.
3VideoPath to saved video file.

Examples

bash
# Text generation
betterprompt generate seo-blog-writer --input topic="ai trends"

# Image generation with model override
betterprompt generate product-shot-generator \
  --image-input-url "https://example.com/product.png" \
  --model gpt-image-1 \
  --options '{"quality":"high"}'

# Pipe to file
betterprompt generate seo-blog-writer --input topic="ai" --json > output.json