Brief one-line description of what this plugin does.
# From marketplace
cortex plugin install marketplace:example-plugin
# From GitHub (for development)
cortex plugin install github:CortexPrism/cortex-plugin-example
# Local installation (for development)
cortex plugin install ./manifest.jsonAfter installation, list available tools:
cortex tools listUse a tool in an agent session:
cortex chat --plugin example-pluginGreet a person by name.
Parameters:
name(string, required) — Person's name
Example:
cortex tool call hello --name Alice
# Output: Hello, Alice! Welcome to Cortex.Add two numbers together.
Parameters:
a(number, required) — First numberb(number, required) — Second number
Example:
cortex tool call add --a 5 --b 3
# Output: 8Fetch data from an external API (HTTPS only).
Parameters:
url(string, required) — URL to fetch from
Example:
cortex tool call fetch_data --url https://api.example.com/dataConfigure this plugin in ~/.cortex/config.json:
{
"plugins": {
"example-plugin": {
"enabled": true,
"config": {}
}
}
}This plugin declares:
network:fetch— Makes HTTPS requests to external APIs
# Install dependencies
deno cache mod.ts
# Run tests
deno task test
# Format code
deno fmt
# Lint
deno lint# Validate the plugin
deno task validate
# Test locally
cortex plugin install ./manifest.json
cortex tool call hello --name Test
# Use in chat
cortex chat --plugin example-pluginTests are located in test/ directory:
# Run all tests
deno task test
# Run specific test
deno test --allow-all test/unit/mod.test.ts --filter "hello tool"
# Run with coverage
deno test --coverage=.coverage --allow-all test/When ready to publish:
- Update version in
manifest.json - Update
CHANGELOG.mdwith changes - Commit and tag:
git tag v1.0.0 - Push to GitHub:
git push origin main --tags - GitHub Actions automatically publishes to marketplace
For detailed publishing instructions, see Publishing Plugins.
Error: Plugin failed to load: Invalid manifest
Solution: Validate your manifest.json:
deno task validateError: Tool not found
Solution: Ensure the tool is:
- Exported in the
toolsarray inmod.ts - Declared in
manifest.jsonundertools - Plugin is enabled:
cortex plugin enable example-plugin
Error: Permission denied: network:fetch
Solution: The network:fetch capability must be in the manifest and approved by the user.
See Best Practices for complete guidelines:
✅ Do:
- Validate all tool parameters
- Handle errors gracefully
- Return ToolResult with
successandoutput/error - Respect timeouts
- Declare minimal permissions
- Write comprehensive tests
❌ Don't:
- Hardcode API keys or secrets
- Request overly broad permissions
- Ignore errors
- Leave console.log in code
- Skip input validation
MIT — See LICENSE file
See CONTRIBUTING.md for development standards.