Plugin
Hawa Code supports extending its capabilities through plugins and a plugin marketplace. Plugins are distributed as declarative directories and can contain components such as Skills, slash commands, Agents, Hooks, MCP Servers, and LSP Servers. The marketplace is a plugin catalog for centrally managing and distributing multiple plugins.
Claude Code compatibility:
settings.plugins.pluginClaudeCompatis enabled by default. Hawa Code recognizes both.hcode-plugin/and.claude-plugin/directories, preferring.hcode-plugin/. This allows reusing a large number of plugins from the Claude Code ecosystem.
Quick Start
1. Add a Marketplace
# Local directory |
2. Install a Plugin
hcode plugin install demo-plugin@my-marketplace |
3. Use the Plugin
Once installed and enabled, the plugin’s Skills and commands are registered automatically:
- Skill: invoke in chat via
/plugin-name:SkillNameor/SkillName. - Custom command: invoke via
/commandName. - MCP Server: after restarting or refreshing, view via
hcode mcp list.
Marketplace Management
A marketplace is a collection of plugins described by a marketplace.json file. Hawa Code supports managing marketplaces through CLI and interactive slash commands.
Add a Marketplace
hcode plugin marketplace add <source> |
<source> supports the following forms:
| Source | Example |
|---|---|
| Local directory | ./my-marketplace |
| GitHub shorthand | owner/repo |
| git URL | https://github.com/owner/repo.git or git@github.com:owner/repo.git |
| marketplace.json URL | https://example.com/marketplace.json |
Remove a Marketplace
hcode plugin marketplace remove <name> |
List Marketplaces
hcode plugin marketplace list |
Update a Marketplace
Re-fetch marketplace content from its source:
# Update all marketplaces |
Plugin Management
Install a Plugin
hcode plugin install <plugin[@marketplace]> |
plugin: plugin name.marketplace: optional marketplace name. If omitted, all known marketplaces are searched; if only one marketplace contains the plugin, it is used automatically.
Uninstall a Plugin
hcode plugin uninstall <plugin[@marketplace]> |
You can use the full ID or the plugin@marketplace shorthand.
Update a Plugin
# Update all plugins |
List Installed Plugins
hcode plugin list |
Enable/Disable a Plugin
hcode plugin enable <plugin[@marketplace]> |
After disabling, the plugin’s Skills, commands, MCP, and other components no longer take effect, but the files remain in the local cache.
Interactive Manager
Enter the following in the Hawa Code interactive interface:
/plugin |
This opens the plugin manager with keyboard navigation:
← / →: switch tabs (Available / Installed / Marketplaces).↑ / ↓: select list items.Enter: view details or install/uninstall/update.Esc: exit.
marketplace.json
The marketplace description file is usually located at .hcode-plugin/marketplace.json in the marketplace root. In compatibility mode, .claude-plugin/marketplace.json is also supported.
{ |
Plugin Source (source)
plugins[].source supports multiple forms:
| Type | Example |
|---|---|
| Local relative path | "./plugins/formatter" |
| GitHub | { "source": "github", "repo": "owner/repo", "ref": "main", "sha": "..." } |
| URL | { "source": "url", "url": "https://...", "ref": "..." } |
| Git subdirectory | { "source": "git-subdir", "url": "https://...", "path": "plugins/foo", "ref": "main" } |
| npm | { "source": "npm", "package": "@org/pkg", "version": "1.0.0" } |
Relative paths are resolved against the marketplace root (the directory containing
.hcode-plugin/), not.hcode-plugin/itself.
plugin.json
The description file for a single plugin is located at .hcode-plugin/plugin.json in the plugin root. In compatibility mode, .claude-plugin/plugin.json is also supported.
{ |
Field Reference
| Field | Description |
|---|---|
name |
Unique plugin name |
version |
Version number |
description |
Description |
author |
Author information |
homepage / repository / license |
Project metadata |
keywords / category |
Classification and tags |
skills |
Skill directory path, default skills |
commands |
Custom command directory path, default commands |
agents |
Agent directory path, default agents |
hooks |
Hooks configuration directory or inline object |
mcpServers |
MCP Server configuration directory or inline object |
lspServers |
LSP Server configuration directory or inline object |
permissions |
List of permissions required by the plugin |
strict |
When true, plugin.json takes precedence; when false, the marketplace entry fully overrides |
defaultEnabled |
Whether the plugin is enabled by default after installation, default true |
Strict Mode
strict: true(default):plugin.jsonis the authoritative source of component definitions; the marketplace entry only supplements information.strict: false: the marketplace entry is the complete definition, andplugin.jsonmust not declare components (skills, commands, etc.), otherwise installation fails.
Plugin Components
A plugin can contain the following extension components:
Skill
Each subdirectory under the plugin’s skills directory (containing SKILL.md) is registered as a Skill and can be invoked directly in chat after installation. See the Skill documentation for details.
Custom Commands
.md files under the plugin’s commands directory are registered as slash commands. Command names are namespaced by default as plugin-name:commandName.
Agent
Definitions under the plugin’s agents directory are added to the Agent scan path.
Hooks
The hooks field can be a directory path (which must contain hooks.json) or an inline HooksConfig object. Supports SessionStart and SessionEnd hooks.
MCP Server
The mcpServers field can be a directory path (containing JSON configuration files) or an inline object. MCP Servers registered by plugins are automatically prefixed:
plugin__<marketplace>__<plugin>__<server> |
LSP Server
The lspServers field is used similarly to MCP for registering LSP Servers.
Variable Substitution
Strings in MCP and Hook configurations support the following variable substitutions:
| Variable | Substituted with |
|---|---|
${HCODE_PLUGIN_ROOT} |
Plugin cache directory |
${HCODE_PLUGIN_DATA} |
Plugin data directory |
${CLAUDE_PLUGIN_ROOT} |
Same as ${HCODE_PLUGIN_ROOT} |
${CLAUDE_PLUGIN_DATA} |
Same as ${HCODE_PLUGIN_DATA} |
Configuration
Configure plugin behavior in ~/.hcode/settings.json or project .hcode/settings.json:
{ |
Configuration Reference
| Setting | Description |
|---|---|
enabledPlugins |
List of plugin IDs to force-enable |
disabledPlugins |
List of plugin IDs to force-disable |
pluginConfigs |
Per-plugin configuration objects |
extraKnownMarketplaces |
Additional built-in marketplace list |
strictKnownMarketplaces |
When true, only accept known marketplaces; when false, allow adding new marketplaces |
pluginMarketplaceAllowlist |
Marketplace source allowlist, supports glob/regex |
pluginAutoUpdate |
Whether to enable background auto-update for marketplaces and plugins |
pluginAutoUpdateInterval |
Auto-update interval in minutes, default 60 |
pluginSandboxHooks |
Whether to execute Hook and MCP commands in sandbox, default true |
pluginClaudeCompat |
Whether to support .claude-plugin/ directories, default true |
Security and Permissions
Installation Confirmation
Before installing a plugin, Hawa Code displays its source, version, required permissions, and sandbox status, and requires user confirmation. CLI can skip confirmation via --yes (in current implementation, some paths trust known marketplaces by default).
Allowlist
Use pluginMarketplaceAllowlist to restrict allowed marketplace sources, supporting glob and regular expressions.
Path Isolation
Each plugin is copied to an isolated cache directory. ../ references and out-of-bounds symlinks are forbidden. ${HCODE_PLUGIN_ROOT} and ${HCODE_PLUGIN_DATA} serve as safe variable substitution entry points.
Sandbox Execution
pluginSandboxHooks is enabled by default. Hooks and MCP commands are executed through Hawa Code’s sandbox mechanism, subject to settings.sandbox restrictions.
Cache Directory
Plugin-related data is stored by default under ~/.hcode/plugins/:
~/.hcode/plugins/ |
Environment Variables
| Environment Variable | Description |
|---|---|
HCODE_PLUGIN_CACHE_DIR |
Override the entire plugin cache root directory |
HCODE_PLUGIN_ROOT |
Points to the installed plugin directory |
HCODE_PLUGIN_DATA |
Points to the plugin data directory |
HCODE_PLUGIN_SEED_DIR |
Pre-installed plugin directory, used for containers/CI |
HCODE_PLUGIN_GIT_TIMEOUT_MS |
Git operation timeout, default 120000ms |
HCODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE |
Keep old cache when update fails |
Command Quick Reference
Slash Commands
/plugin marketplace add <source> |
CLI
hcode plugin marketplace add <source> |
Manual Verification Example
Create a local marketplace:
mkdir -p my-marketplace/.hcode-plugin |
Write my-marketplace/.hcode-plugin/marketplace.json:
{ |
Write my-marketplace/plugins/demo-plugin/.hcode-plugin/plugin.json:
{ |
Write my-marketplace/plugins/demo-plugin/skills/demo/SKILL.md:
--- |
Add and install:
hcode plugin marketplace add ./my-marketplace |
After installation, run /demo-plugin:Demo in Hawa Code to see the result.