Defined in src/skills.metta, with the shell primitive backed by src/skills.pl.
(shell "command")Execute a shell command and return its standard output.
command— a string without apostrophes. Apostrophes are rejected by the Prolog helper.
The captured stdout of the command as a string.
(shell "ls -la /app")
(shell "python3 --version")- Runs with the permissions of the OmegaClaw process.
- No sandboxing. Run in a container for anything resembling untrusted use.
- Prefer writing complex commands to a file and invoking the file rather than embedding quotes-within-quotes.
(read-file "path")Read a file into a string.
path— absolute or relative filesystem path. MeTTa library paths of the form(library OmegaClaw-Core ./memory/prompt.txt)are also accepted (seegetPrompt).
The file's contents as a single string.
(read-file "/tmp/notes.txt")- Fails if the file does not exist (the call checks
exists_filefirst).
(write-file "path" "contents")Create or overwrite a file with the given contents.
path— target filesystem path.contents— the exact bytes to write.
True on success.
(write-file "/tmp/note.txt" "hello world")- Overwrites unconditionally — there is no confirm step.
- For incremental writes, use
append-file.
(append-file "path" "line")Append a line to an existing file, followed by a newline.
path— target filesystem path. File must exist.line— string to append.
True on success.
(append-file "/tmp/session.log" "turn 42 summary: ...")- Fails if the file does not exist (the call checks
exists_filefirst). Create it withwrite-filefirst if needed. - A trailing newline is always added.