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.
Commands
Section titled “Commands”aos file append
Section titled “aos file append”Append stdin, or the given words, to a file
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
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
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
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
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
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
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 stat
Section titled “aos file stat”Print one path’s size, mode, and modified time
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
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