From fe10247d9cb6996700a9e42cbe356988d8a6f833 Mon Sep 17 00:00:00 2001
From: khaneliman
Custom agents for opencode. -The attribute name becomes the agent filename, and the value is either:
Inline content as a string
A path to a file containing the agent content
-Agents are stored in $XDG_CONFIG_HOME/opencode/agent/ directory.
Custom agents for opencode.
This option can either be:
An attribute set defining agents
A path to a directory containing multiple agent files
If an attribute set is used, the attribute name becomes the agent filename, +and the value is either:
Inline content as a string (creates opencode/agent/<name>.md)
A path to a file (creates opencode/agent/<name>.md)
If a path is used, it is expected to contain agent files.
+The directory is symlinked to $XDG_CONFIG_HOME/opencode/agent/.
Type: -attribute set of (strings concatenated with “\n” or absolute path)
+(attribute set of (strings concatenated with “\n” or absolute path)) or absolute pathDefault:
{ }
Custom commands for opencode. -The attribute name becomes the command filename, and the value is either:
Inline content as a string
A path to a file containing the command content
-Commands are stored in $XDG_CONFIG_HOME/opencode/command/ directory.
Custom commands for opencode.
This option can either be:
An attribute set defining commands
A path to a directory containing multiple command files
If an attribute set is used, the attribute name becomes the command filename, +and the value is either:
Inline content as a string (creates opencode/command/<name>.md)
A path to a file (creates opencode/command/<name>.md)
If a path is used, it is expected to contain command files.
+The directory is symlinked to $XDG_CONFIG_HOME/opencode/command/.
Type: -attribute set of (strings concatenated with “\n” or absolute path)
+(attribute set of (strings concatenated with “\n” or absolute path)) or absolute pathDefault:
{ }
SKILL.md. The directory is symlinked
Custom themes for opencode. The attribute name becomes the theme -filename, and the value is either:
An attribute set, that is converted to a json
A path to a file containing the content
-Themes are stored in $XDG_CONFIG_HOME/opencode/themes/ directory.
-Set programs.opencode.settings.theme to enable the custom theme.
-See https://opencode.ai/docs/themes/ for the documentation.
Custom themes for opencode.
This option can either be:
An attribute set defining themes
A path to a directory containing multiple theme files
If an attribute set is used, the attribute name becomes the theme filename, +and the value is either:
An attribute set that is converted to a JSON file (creates opencode/themes/<name>.json)
A path to a file (creates opencode/themes/<name>.json)
If a path is used, it is expected to contain theme files.
+The directory is symlinked to $XDG_CONFIG_HOME/opencode/themes/.
Set programs.opencode.settings.theme to enable the custom theme.
+See https://opencode.ai/docs/themes/ for the documentation.
Type: -attribute set of (JSON value or absolute path)
+(attribute set of (JSON value or absolute path)) or absolute pathDefault:
{ }
Declared by:
+
+
+<home-manager/modules/programs/opencode.nix>
+
+ |
programs.opencode.tools
+
+
+Custom tools for opencode.
This option can either be:
An attribute set defining tools
A path to a directory containing multiple tool files
If an attribute set is used, the attribute name becomes the tool filename, +and the value is either:
Inline content as a string (creates opencode/tool/<name>.ts)
A path to a file (creates opencode/tool/<name>.ts or opencode/tool/<name>.js)
If a path is used, it is expected to contain tool files.
+The directory is symlinked to $XDG_CONFIG_HOME/opencode/tool/.
See https://opencode.ai/docs/tools/ for the documentation.
+ +Type: +(attribute set of (strings concatenated with “\n” or absolute path)) or absolute path
+ +Default:
+{ }
Example:
{
+ database-query = ''
+ import { tool } from "@opencode-ai/plugin"
+
+ export default tool({
+ description: "Query the project database",
+ args: {
+ query: tool.schema.string().describe("SQL query to execute"),
+ },
+ async execute(args) {
+ // Your database logic here
+ return `Executed query: ${args.query}`
+ },
+ })
+ '';
+
+ # Or reference an existing file
+ api-client = ./tools/api-client.ts;
+}
+
+
+
Declared by: