Run
Runs a script on files and streams the LLM output to stdout or a folder from the workspace root.
where <script>
is the id or file path of the tool to run, and [spec]
is the name of the spec file to run it on.
Files can also include glob pattern.
If multiple files are specified, all files are included in env.files
.
Credentials
The LLM connection configuration is read from environment variables or from a .env
file in the workspace root directory.
See configuration.
Files
run
takes one or more glob patterns to match files in the workspace.
—excluded-files <files…>
Excludes the specified files from the file set.
—exclude-git-ignore
Exclude files ignored by the .gitignore
file at the workspace root.
Output
—prompt
Skips the LLM invocation and only prints the expanded system and user chat messages.
—out <file|directory>
Saves the results in a JSON file, along with markdown files of the output and the trace.
If file
does not end with .json
, the path is treated as a directory path.
—json
Output the entire response as JSON to the stdout.
—yaml
Output the entire response as YAML to the stdout.
—vars name=value name2=value2 …
Populate values in the env.vars
map that can be used when running the prompt.
—out-trace <file>
Save the markdown trace to the specified file.
In a GitHub Actions workflow, you can use this feature to save the trace as a step summary (GITHUB_STEP_SUMMARY
):
—out-annotations <file>
Emit annotations in the specified file as a JSON array, JSON Lines, SARIF or a CSV file if the file ends with .csv
.
Use JSON lines (.jsonl
) to aggregate annotations from multiple runs in a single file.
—out-data <file>
Emits parsed data as JSON, YAML or JSONL. If a JSON schema is specified and availabe, the JSON validation result is also stored.
—out-changelogs <file>
Emit changelogs in the specified file as text.
Pull Requests and Issues
The CLI can update a pull request/issue description and comments when running in a GitHub Action or Azure DevOps pipeline.
GitHub Action workflow configuration
Update your workflow configuration to include the following:
- add the
pull-requests: write
permission to the workflow/step
- set the
GITHUB_TOKEN
secret in theenv
when running the cli
Azure DevOps configuration
- add
<your projectname> Build Service
in the Collaborator role to the repository - pass secrets to scripts, including
System.AccessToken
—pull-request-description [tag]
When running within a GitHub Action or Azure DevOps pipeline on a pull request, the CLI inserts the LLM output in the description of the pull request (example)
The tag
parameter is a unique id used to differentiate description generate by different runs. Default is the script id.
—pull-request-comment [tag];
Upserts a comment on the pull request/issue with the LLM output (example)
The tag
parameter is a unique id used to differentiate description generate by different runs. Default is the script id.
—pull-request-reviews
Create pull request review comments from each annotations (example).
Read more
The full list of options is available in the CLI reference.