Execute a prompt using a generative AI model
Constructs a prompt from the provided text and file arguments, then streams the model's response to stdout. Arguments that correspond to existing file paths are read and included as file content.
stencila models run [OPTIONS] [ARGS]...
# Run with automatic model selection
stencila models run "Explain quantum computing"
# Run with a specific model
stencila models run "Write a haiku" --model gpt-4o
# Use a specific provider
stencila models run "Hello" --provider anthropic
# Multiple text arguments
stencila models run "Analyze this data:" "temperature: 23C, humidity: 65%"
# Mix text and file paths (files detected automatically)
stencila models run "Summarize:" report.txt
# Write output to a file
stencila models run "Generate a story" --output story.md
# Dry run to see prompt construction
stencila models run "Hello world" --dry-run