Adds support for custom tools - user-defined functions that the LLM can
call during conversations. Custom tools work alongside opencode's built-in
tools and are configured through the new `tools` option.
The configuration follows the same pattern as other opencode settings like
`agents` and `commands`, supporting:
- Inline TypeScript content
- Individual file paths
- Bulk directory imports
The `commands`, `agents`, and `themes` options now accept either an
attribute set (existing behavior) or a path to a directory containing
multiple files. When a directory path is provided, it is symlinked to
the appropriate `$XDG_CONFIG_HOME/opencode/` subdirectory.
This change aligns with the existing `skills` option implementation and
provides a more convenient way to manage multiple configuration files
without needing to define each one individually in Nix.
Adds support for OpenCode Agent Skills by managing skill definitions
under "/opencode/skill/<name>/SKILL.md" via `programs.opencode.skills`.
Documentation: https://opencode.ai/docs/skills/
Include various tests for the agents and command file generation and
different ways of configuring it.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
- Automatically include "$schema": "https://opencode.ai/config.json" in the generated
opencode config.json file
- Update documentation to mention the added schema property
- Add corresponding "$schema" entry in test config.json file for validation purposes
Closes#7506
- Introduce `rules` option to provide global custom instructions for opencode
- Write `rules` content to `~/.config/opencode/AGENTS.md` if non-empty
- Update tests to cover presence and absence of `AGENTS.md` file with rules content