Working without a copy
Read, search and write single files of a workspace from the CLI, for agents and scripts that don't keep a synced folder.
An agent or a script doesn't need a synced folder to use a workspace: it can read and write single files.
Read
fontego workspaces # the workspaces you can see, with your role
fontego ls notes # a folder (-r for everything below it)
fontego cat notes docs/plan.md # a file
fontego log notes docs/plan.md # its history, newest first
fontego search notes "opening hours" # text in the workspace's filesls and cat take --rev REV to look at an earlier version.
Write
fontego write notes docs/new.md < new.md # create a file
fontego write notes docs/plan.md --base HASH < plan.md # change one
fontego mv notes docs/old.md archive/old.md --base HASH
fontego rm notes docs/old.md --base HASHEvery change names the version it starts from with --base: the file's hash, which fontego cat ... --json gives
along with its content. Without --base, write only creates new files, so it never overwrites one by accident.
If the file changed meanwhile, the server merges the text when the edits don't touch the same lines. When they clash, it writes nothing and fails with a conflict (exit code 4); read the file again and redo the change.
The content comes from stdin when it isn't given as an argument, and nothing on stdin is an error, so a forgotten
< file never writes an empty file. --message TEXT sets the commit message.
Each write is one commit, with the same checks as a sync: roles, secrets, size, and protected and rejected paths.