FAQ
How are arguments passed?
They follow the order in the function signature and become shell variables with matching names. Legacy $1, $2, $@ still work. See Arguments and Variables.
How do I choose an interpreter?
Add a shebang as the first line of the body or set # @shell <interpreter>. The attribute wins if both are present. Details in Attributes and interpreters.
Can I mix languages in one Runfile?
Yes. Each function can use its own interpreter. Use shell functions to orchestrate calls between Python/Node helpers; see Polyglot commands and Command composition.
How do I document tools for AI agents?
Add @desc and @arg comments. Run run --inspect to confirm the generated schema. More in MCP integration.
Where are Runfiles discovered?
run walks up from the current directory, then falls back to ~/.runfile. Override with --working-dir. See the reference.
What if my output is very large?
In MCP mode, long output is truncated in the response and the full text is written to .run-output/ (configurable via RUN_MCP_OUTPUT_DIR).
How do I install shell completions?
Run run --install-completion (auto-detects shell) or run --generate-completion SHELL for manual setup. See CLI usage.
How do I run tasks from another project?
Use run --working-dir /path/to/project <function> ... so discovery happens in that directory.
Are type hints enforced at runtime?
In shell functions, no — types power documentation and MCP schemas only. In polyglot functions (Python, Node.js, Ruby), int, float, bool, and object types trigger automatic conversion of CLI string arguments. Validate inside your function for anything beyond that.
Is it safe to keep secrets in functions when using MCP?
Theoretically, yes. MCP exposes only the schema (names, descriptions, parameter shapes). Function bodies are not sent to the agent. However, if secrets are in your project Runfile and agents have other tools to read files, there is nothing to stop them from reading the Runfile (as with a plaintext .env file). See MCP integration for security notes.