Name
fov turns plain-language requests into shell pipelines.
Synopsis
fov [-o file | -n] [file]
command | fov [-o file | -n]
- -o file
- Write the result to file when you accept.
- -n
- Print only the command to standard output. Skip the final run.
Description
Describe the output you want from a file or a stream. fov asks a language model to write a pipeline of standard text tools such as awk, jq and sort. It runs the pipeline on your data and shows the output.
Refine your request if the output needs changes. When you accept, fov runs the pipeline on the whole input and prints the command.
Reuse the command in a script, Makefile or crontab. It uses programs on your machine and runs without fov or a model connection. fov sends the result to standard output and the command to standard error. For example, fov access.log > top.txt saves the result to top.txt.
The model proposes programs and their arguments. fov checks them against an allowlist and runs each process in an operating system sandbox. The sandbox blocks network access and restricts reads to system files and a scratch directory. Processes can write only in the scratch directory. The sandbox uses sandbox-exec on macOS, and Landlock and seccomp on Linux.
At startup, fov checks that the sandbox allows a command and blocks a file read. If either check fails, fov stops.
Keys
- Enter
- Send the request.
- a
- Run the pipeline on the whole input and exit.
- e
- Refine the result with a follow-up request.
- y
- Copy the displayed command.
- Tab
- Move to the input or output pane to scroll it.
- Esc
- Cancel the running request.
- q
- Quit and print the displayed command without running it.
- Ctrl-C
- Quit without printing a command.
Examples
fov generated these commands for the requests above them. Run them on the repository's sample files without installing fov.
which paths return the most 5xx errors?
access.log · 5,000 lines · refined once: "only the top 3"
awk '$9 ~ /^5[0-9][0-9]$/ { count[$7]++ } END { for (path in count) printf "%d %s\n", count[path], path }' < access.log | sort -k1,1nr -k2,2 | head -n 3
37 /api/search 28 /api/checkout 18 /api/cart
The recording uses the same request.
total revenue of completed orders per region, highest first
sales.csv · 2,000 orders
awk -F, 'NR>1 && $6=="completed" { cents[$3] += $7 * int($8*100+0.5) } END { for (r in cents) printf "%.0f\t%s\n", cents[r], r }' < sales.csv | sort -t ' ' -k1,1nr | awk -F ' ' 'BEGIN { print "region,revenue" } { printf "%s,%.2f\n", $2, $1/100 }'
region,revenue North,295430.31 South,240817.31 Central,174306.15 East,172422.70 West,158424.69
The command sums revenue in cents and returns CSV.
how many events of each type, most frequent first
github-events.json · one JSON array of 300 events
jq -r 'group_by(.type) | map({type: .[0].type, count: length}) | sort_by([-.count, .type])[] | (.count | tostring) + " " + .type' < github-events.json
165 PushEvent 44 CreateEvent 20 PullRequestEvent 18 IssueCommentEvent 14 PullRequestReviewEvent 14 WatchEvent 11 IssuesEvent 6 DeleteEvent 3 PullRequestReviewCommentEvent 2 ForkEvent 2 MemberEvent 1 ReleaseEvent
Caveats
- Read the command before you reuse it. fov runs pipelines in a sandbox. When you reuse a command in your shell, it runs with your permissions. Input data can contain instructions aimed at the model.
- Check the preview for errors. A pipeline can run without errors and still produce the wrong result.
- fov sends an input sample and the start of each preview's output to your model provider. The input sample is 16 KiB by default.
- Configure an OpenAI or OpenRouter API key, or AWS Bedrock credentials. Expect to wait several seconds for a reply.
- Standard input must end and cannot exceed 1 GiB. Save larger inputs to a file first.
- A plain
awk -F,cannot parse quoted CSV fields such as"a, b". Addmlrorqsvto the allowlist to handle them. - fov runs on macOS and Linux. Linux requires kernel 6.2 or later with Landlock enabled.
Installation
cargo install fov
You can also download a binary from the releases. Set the provider and model in ~/.config/fov/config.toml:
provider = "openrouter" # or "openai", "bedrock" [openrouter] model = "anthropic/claude-sonnet-5.5" api_key = "..." # or provide OPENROUTER_API_KEY reasoning_effort = "high"
See the README for OpenAI and Bedrock configuration and other settings.
See also
awk(1), jq(1), sort(1), uniq(1), sed(1), grep(1), cut(1)
Author
Sven Taute wrote fov and released it under the MIT licence.