Skip to content

aos file

Read, write, and inspect files

9 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.

Append stdin, or the given words, to a file

Terminal window
aos file append <path> [text...]
flag values meaning
<path> Required positional argument
Terminal window
aos file append log.txt "done"

Copy a file

Terminal window
aos file copy <source> <destination>
flag values meaning
<source> Required positional argument
<destination> Required positional argument
Terminal window
aos file copy a.txt b.txt

Delete a file, or a directory with –recursive

Terminal window
aos file delete <path> [--recursive]
flag values meaning
<path> Required positional argument
--recursive Optional
Terminal window
aos file delete /tmp/scratch --recursive

List a directory

Terminal window
aos file list [path] [--all] [--json]
flag values meaning
--all Optional
--json Optional
Terminal window
aos file list
aos file list ~/Downloads --json

Create a directory, including parents

Terminal window
aos file mkdir <path>
flag values meaning
<path> Required positional argument
Terminal window
aos file mkdir ~/.config/aos/layouts

Move or rename a path

Terminal window
aos file move <source> <destination>
flag values meaning
<source> Required positional argument
<destination> Required positional argument
Terminal window
aos file move old.txt new.txt

Print a file, optionally a line range

Terminal window
aos file read <path> [--lines=<from>:<to>]
flag values meaning
<path> Required positional argument
<to> Optional positional argument
--lines <from> Optional
Terminal window
aos file read go.mod
aos file read main.go --lines=10:40

Print one path’s size, mode, and modified time

Terminal window
aos file stat <path> [--json]
flag values meaning
<path> Required positional argument
--json Optional
Terminal window
aos file stat go.mod --json

Write stdin, or the given words, to a file

Terminal window
aos file write <path> [text...]
flag values meaning
<path> Required positional argument
Terminal window
aos file write notes.txt "first line"
cat in.txt | aos file write out.txt