aos file
Read, write, and inspect files
11 commands. Run aos file --help for the same list from the binary, or see every group.
Read, write and inspect files with exit codes an agent can trust. read takes a line range, write and append take words or stdin, list and stat have --json. delete refuses filesystem roots, your home directory and system directories, and needs --recursive for a directory. recent lists the documents the person opened lately, newest first, from the OS’s own recents: macOS Recent Documents (per-app lists with --app, matched against the bundle id), the freedesktop recently-used.xbel on Linux (with --app), and the shortcuts in the Windows Recent folder (no --app there). It follows the host, because it is about the person’s desktop.
Commands
Section titled “Commands”aos file append
Section titled “aos file append”Append stdin, or the given words, to a file
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file append <path> [text...]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument |
aos file append log.txt "done"aos file copy
Section titled “aos file copy”Copy a file
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file copy <source> <destination>| flag | values | meaning |
|---|---|---|
<source> |
Required positional argument | |
<destination> |
Required positional argument |
aos file copy a.txt b.txtaos file delete
Section titled “aos file delete”Delete a file, or a directory with –recursive
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file delete <path> [--recursive]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument | |
--recursive |
Optional |
aos file delete /tmp/scratch --recursiveaos file list
Section titled “aos file list”List a directory
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file list [path] [--all] [--json]| flag | values | meaning |
|---|---|---|
--all |
Optional | |
--json |
Optional |
aos file listaos file list ~/Downloads --jsonaos file mkdir
Section titled “aos file mkdir”Create a directory, including parents
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file mkdir <path>| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument |
aos file mkdir ~/.config/aos/layoutsaos file move
Section titled “aos file move”Move or rename a path
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file move <source> <destination>| flag | values | meaning |
|---|---|---|
<source> |
Required positional argument | |
<destination> |
Required positional argument |
aos file move old.txt new.txtaos file read
Section titled “aos file read”Print a file, optionally a line range
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file read <path> [--lines=<from>:<to>]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument | |
<to> |
Optional positional argument | |
--lines |
<from> |
Optional |
aos file read go.modaos file read main.go --lines=10:40aos file recent
Section titled “aos file recent”List recently opened documents, newest first, from the OS’s own recents
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos file recent [--app=<name>] [--limit=<n>] [--json]| flag | values | meaning |
|---|---|---|
--app |
<name> |
Optional |
--limit |
<n> |
Optional |
--json |
Optional |
aos file recentaos file recent --app=textedit --limit=5aos file recent --jsonaos file search
Section titled “aos file search”Find files and folders by name, through the OS index when there is one
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file search <query> [--root=<dir>] [--kind=file|dir] [--limit=<n>] [--engine=auto|everything|index|walk] [--json]| flag | values | meaning |
|---|---|---|
<query> |
Required positional argument | |
--root |
<dir> |
Optional |
--kind |
file, dir |
Optional |
--limit |
<n> |
Optional |
--engine |
auto, everything, index, walk |
Optional |
--json |
Optional |
aos file search invoice --limit=10aos file search "*.pdf" --root=~/Downloads --jsonaos file search notes --kind=dir --engine=walkaos file stat
Section titled “aos file stat”Print one path’s size, mode, and modified time
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file stat <path> [--json]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument | |
--json |
Optional |
aos file stat go.mod --jsonaos file write
Section titled “aos file write”Write stdin, or the given words, to a file
Under WSL / SSH: runs inside WSL (where aos was started). How the host works
aos file write <path> [text...]| flag | values | meaning |
|---|---|---|
<path> |
Required positional argument |
aos file write notes.txt "first line"cat in.txt | aos file write out.txt