Plugins
Extend mine with third-party plugins that hook into any command, register custom subcommands, and run in a permission sandbox. Plugins are standalone binaries with a TOML manifest — build them in any language, share them via GitHub.
Key Capabilities
Section titled “Key Capabilities”- Sandboxed permissions — plugins declare what they need (network, filesystem, env vars) and you review it before installing
- Hook into any command — four-stage pipeline (prevalidate, preexec, postexec, notify) with wildcard pattern matching
- Custom commands — plugins can register their own subcommands under
mine <plugin> <command> - GitHub discovery — search for community plugins directly from the CLI
- Any language — shell scripts, Python, Go, Rust — anything that reads JSON from stdin
Quick Example
Section titled “Quick Example”# Search GitHub for pluginsmine plugin search obsidian
# Install from a local directorymine plugin install ./my-plugin
# List installed pluginsmine plugin list
# Show detailed info about a pluginmine plugin info todo-statsHow It Works
Section titled “How It Works”The Plugin Pipeline
Section titled “The Plugin Pipeline”Plugins integrate through the same four-stage hook pipeline as user-local hooks:
- prevalidate — modify arguments before validation
- preexec — modify validated context before execution
- postexec — modify results after execution
- notify — fire-and-forget side effects (logging, syncing, webhooks)
Plugin hooks and user-local hooks coexist in the same pipeline. Transform hooks chain alphabetically; notify hooks run in parallel.
Manifest-Declared Permissions
Section titled “Manifest-Declared Permissions”Every plugin includes a mine-plugin.toml manifest that declares exactly what system resources it needs. mine displays these permissions at install time so you can review them before granting access.
| Permission | What it grants |
|---|---|
network | Outbound network access |
filesystem | Read/write to specific paths |
store | Read/write mine’s SQLite database |
config_read | Read mine’s configuration (exposes MINE_CONFIG_DIR, MINE_DATA_DIR) |
config_write | Write to mine’s configuration |
env_vars | Access to specific environment variables |
Plugins run with a minimal environment — only PATH and HOME are always available. Everything else must be declared in the manifest and approved at install time.
Installation Flow
Section titled “Installation Flow”When you run mine plugin install, mine:
- Reads the
mine-plugin.tomlmanifest from the source directory - Validates the manifest (required fields, stage/mode pairing, kebab-case name)
- Displays the plugin’s name, version, description, and requested permissions
- Prompts for confirmation
- Copies the plugin to
~/.local/share/mine/plugins/<name>/ - Registers hooks and commands in the plugin registry
Learn More
Section titled “Learn More”- Plugin command reference — all subcommands, flags, and error handling
- Building Plugins — how to create your own plugins
- Plugin Protocol — the JSON communication contract