loading
loading
Utilities
A CLI utility for interacting with OpenAI and generating a response from a file input.
overview
openai-file feeds a file and a prompt to an OpenAI chat model and writes back the model's response, which makes it the LLM step inside a security workflow. Hand it the output of an earlier node, describe what to do with it, and the model returns text you can route onward without leaving the pipeline.
It exposes the model as a choice between gpt-4 (gpt4), gpt-4-32k (4-32k), gpt-3.5-turbo (chatgpt), and gpt-3.5-turbo-16k (chatgpt-16k), so you trade context size and cost against the size of the file you are processing. The API key is supplied as a file input, keeping the credential out of the command line.
Point it at a scan report, a list of findings, or a blob of crawled text, and let the model condense or reshape it before the result reaches a human or the next node.
source github.com/simonw/llm
use cases
Feed a findings file with a prompt that asks for a short summary, so a long report becomes a few readable lines for the next reviewer.
Pass a list of results and ask the model to group or rank them, turning unsorted output into a prioritized view inside the workflow.
Choose gpt-4-32k or the 16k turbo variant when the input file is large, or a smaller model when context and cost should stay low.
Prompt the model to reshape raw tool text into prose for a writeup, keeping the rewrite inside the pipeline rather than a manual step.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| input-file | FILE | · | Input file for the model to read. |
| prompt | STRING | · | Prompt applied to the file input. |
| open-ai-api-key | FILE | · | OpenAI API key, supplied as a file. |
| gpt-4 | BOOLEAN | gpt4 | Use OpenAI Chat gpt-4 (aliases 4, gpt4). |
| gpt-4-32k | BOOLEAN | 4-32k | Use OpenAI Chat gpt-4-32k for larger context. |
| gpt-3-5-turbo | BOOLEAN | chatgpt | Use OpenAI Chat gpt-3.5-turbo (aliases 3.5, chatgpt). |
| gpt-3-5-turbo-16k | BOOLEAN | chatgpt-16k | Use OpenAI Chat gpt-3.5-turbo-16k for a wider context window. |
Showing key inputs. openai-file exposes 7 inputs in total.
example
# openai-file: summarize hosts.txt with gpt-4# openai-file input=hosts.txt prompt="List live hosts" gpt4Live hosts from the scan:api.example.comapp.example.comstaging.example.comdev.example.commail.example.comvpn.example.com# openai-file summary of 6 hostsguidance
Reach for openai-file when a workflow needs an LLM to read a file and produce text, such as summarizing a report or classifying findings. It calls OpenAI, so it needs an API key. For local string manipulation without a model, use a text utility instead.
Renders structured data without a model. Use it when the transform is deterministic, not generative.
Builds a report from results with fixed templates. openai-file uses an LLM for free-form text instead.
Reshapes JSON for grepping. openai-file is for generative summarizing, not mechanical reformatting.
faq
related
Import, export, and link workflow data with Airtable.
Decode Android APK files into smali sources and resources.
Check a file's values against conditions and exit with a matching code.
Extract all hosted zones from AWS Route53.
Output file lines by batch size, given START_LINE and END_LINE.
Extract a batch range from a file's lines or a folder's files, with parallel processing.
A scan report and an API key feed openai-file, which prompts an OpenAI model over the file and writes the generated summary as output.
Facts on this page come from the live Trickest tool library.