Overview
This guide walks through building a complete ArgentOS plugin. Plugins can register tools, read service keys, persist configuration, and hook into the agent lifecycle — all without modifying core files.Plugin Structure
- Global:
~/.argentos/extensions/<plugin-id>/ - Workspace:
.argent/extensions/<plugin-id>/(project-local)
Manifest
Every plugin needs anargent.plugin.json for discovery and config validation:
Entry Point
Export a default function that receives the registration API:No Core Imports
Registering Tools
Service Keys
ArgentOS has a centralized key store at~/.argentos/service-keys.json, managed through the dashboard (Settings > API Keys). Plugins should read from this store rather than requiring separate config.
Reading Service Keys
How It Works
1
User adds the key
Through Dashboard > Settings > API Keys.
2
Dashboard writes to store
Dashboard writes to
~/.argentos/service-keys.json.3
Plugin reads at runtime
Plugin reads the key at runtime via the pattern above.
4
Fallback for CI
Falls back to
process.env for CI/server deployments.Service Keys Format
Config Persistence
Plugins can persist configuration to~/.argentos/argent.json under plugins.entries.<id>.config:
Config in argent.json
Plugin Allowlist
If
plugins.allow[] has any entries, only plugins in that list are enabled. Non-bundled plugins default to enabled when the allowlist is empty.If your plugin isn’t loading, check whether an allowlist exists and add your plugin ID.Lifecycle Hooks
before_agent_start
Fires before each agent run. Inject context or nudge the agent:
systemPromptSuffix for:
- Open ticket counts or active alerts
- Nudging the agent when setup is incomplete
- Injecting operator-specific context
Tips
No build step needed
No build step needed
Jiti loads TypeScript directly.
One tool per concern
One tool per concern
Don’t create mega-tools — split tickets, devices, and alerts into separate tools.
Fail gracefully
Fail gracefully
Return a helpful message if the API key is missing, don’t throw.
Use AbortSignal.timeout()
Use AbortSignal.timeout()
Prevent hung API calls from blocking the agent.
Prefer service keys
Prefer service keys
Users manage keys through the dashboard UI.
Self-service setup
Self-service setup
Let the agent discover configuration instead of requiring manual entry.
Related
- Plugin System — Plugin discovery, manifests, and management
- Marketplace — Browse and publish packages
