Skip to main content

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

Plugins are discovered from two locations:
  • Global: ~/.argentos/extensions/<plugin-id>/
  • Workspace: .argent/extensions/<plugin-id>/ (project-local)
The entry point is loaded by Jiti (TypeScript JIT), so .ts files work without a build step.

Manifest

Every plugin needs an argent.plugin.json for discovery and config validation:

Entry Point

Export a default function that receives the registration API:

No Core Imports

Plugins in ~/.argentos/extensions/ don’t have access to core node_modules. Use plain JSON Schema objects instead of @sinclair/typebox.

Registering Tools

For tools that require credentials or have side effects, mark them as optional:

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:
This enables self-service setup flows where the agent discovers and saves config automatically.

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:
Use systemPromptSuffix for:
  • Open ticket counts or active alerts
  • Nudging the agent when setup is incomplete
  • Injecting operator-specific context

Tips

Jiti loads TypeScript directly.
Don’t create mega-tools — split tickets, devices, and alerts into separate tools.
Return a helpful message if the API key is missing, don’t throw.
Prevent hung API calls from blocking the agent.
Users manage keys through the dashboard UI.
Let the agent discover configuration instead of requiring manual entry.