options.plugins is used to load local plugin directories into the current session. The SDK converts each local plugin into a --plugin-dir <path> startup argument; commands, agents, skills, and MCP servers contained in the plugin all take part in capability discovery for the session.
Loading Local Plugins
--plugin-dir arguments will be written in order:
💡 In Python,query()is a one-shot message stream and can't query the init response after the handshake. To read plugin-contributed commands / agents / skills, useQoderSDKClientand callget_server_info()afterconnect(), or captureSystemMessage(subtype='init')in the stream and readmessage.datayourself. For the full plugin inventory, callclient.list_plugins().
Plugin Directory Layout
A local plugin typically contains:
.qoder-plugin/plugin.json declares the plugin name, version, and description. The other directories are automatically scanned by the CLI based on file type.
The SDK does not validate whether the path exists or is well-formed:
- A non-existent
--plugin-dirpath is silently ignored in SDK mode; the session still initializes normally. - Broken frontmatter or
.mcp.jsondoes not block init; broken commands simply do not appear in the init response. - To diagnose plugin load failures explicitly, the only fallback today is the post-reload error_count.
Plugin-contributed Slash Commands
commands/*.md in a plugin appears in the initialization result, named in the <plugin>:<cmd> qualified form:
Plugin-contributed Agents
agents/*.md in a plugin appears in the initialization result; the SDK offers a convenience method to fetch the list:
Plugin-contributed Skills
skills/<name>/SKILL.md in a plugin is registered under the plugin-qualified name (plugin:skill). Control its main-session context visibility and invocation policy via options.skills: pass qualified names to enable specific skills, 'all' to enable all discovered ones, or omit for CLI default policy. See the Skills docs.
Plugin-contributed MCP Servers
.mcp.json in a plugin is launched by the CLI and included in MCP status:
Temporarily Overriding an Installed Plugin with the Same Name
Plugins loaded via options.plugins are session-scoped. During the current session, if a local plugin shares a name with an installed plugin, the local plugin takes priority in capability discovery. This is useful for plugin development, debugging, and canary testing.
Reloading Plugins at Runtime
When the plugin directory changes, call reloadPlugins() / reload_plugins() within the same session to have the CLI rescan plugin resources.
- Refreshing after adding or deleting
commands/*.mdduring plugin development. - After installing or updating a local plugin without restarting the host application.
- When the host UI needs to display commands, agents, plugins, and MCP status after a reload.
Note: in Python,reload_plugins()is only meaningful inQoderSDKClient(streaming) mode; the one-shotquery()stream has no runtime control channel.
Options Reference
| Field (TypeScript / Python) | Description |
|---|---|
plugins / plugins | Loads local plugin directories; { type: 'local', path } is the common form |
settings / settings | Settings passed through to the CLI; may include enabledPlugins, pluginConfigs, etc. |
settingSources / setting_sources | Controls which settings sources the CLI reads |
settings.enabledPlugins to control plugin enablement and settings.pluginConfigs to supply plugin config such as MCP server replacements.
Return Value Reference
Initialization result
initializationResult() (TypeScript) / client.get_server_info() (Python) returns the commands, agents, skills, and other initialization resources discovered in the session. It has no stable plugin-inventory field; full return type in SDK References.
Listing plugins
plugins field of the initialization result.
Each item is a PluginDetails object with id, name, source, path, version, scope, enabled, canDisable, and a resources summary grouped into skills, agents, mcpServers, commands, and hooks.
Reloading plugins
reloadPlugins() / reload_plugins() returns:
Best Practices
- Separate initialization resources from the plugin inventory: show discovered commands/agents/skills from the initialization result; show the plugin inventory via
listPlugins()/list_plugins(). The skills there are a discovery list, not the main session's invocable set. - Use
options.pluginsduring plugin development: It only affects the current session without modifying the user's global install state. - Prepare user messaging before reloads: a reload rescans the disk and may briefly change the available resource lists—keep the UI in sync.
- Check
error_countfor diagnostics: Iferror_count > 0after reload, some plugin resources failed to load; display the source to the user.
Current Limitations
- On some qodercli versions, a local plugin's commands, agents, and MCP appear in the initialization result while its skills may be missing from the discovery list—a CLI-side discovery issue.
- In the current qodercli implementation, nonexistent
--plugin-dirpaths are silently ignored in SDK mode; the only explicit diagnostic today is the post-reloaderror_count. - Reload is a runtime control API exposed by the SDK; if your CLI version returns internal
this._pluginserrors, upgrade to a fixed qodercli.