Extending Agentia
The Agentia CLI is extensible: any developer can build a plugin on top of it and add new capabilities to the tool. Here is how to get started.
Create a plugin
Scaffold a new plugin with the generator. It asks for the package name, description, author, command topic, and command name, then creates the project and installs its dependencies.
The destination can be a relative or an absolute path:
Review the generated scaffold
The generator creates a ready-to-build oclif plugin with this structure:
my-plugin/ ├── src/ │ ├── commands/ │ │ └── <topic>/ │ │ └── <command>.ts │ └── index.ts ├── package.json ├── package-lock.json ├── tsconfig.json ├── .gitignore └── README.md
The sample command (src/commands/<topic>/<command>.ts) extends the oclif Command class and declares its description, examples, args and flags, then does the work in run(). Add new commands by creating more files in the same shape under src/commands.
Review the sample command
The sample extends AgentiaCommand from the Agentia plugin SDK, which gives you --json output and spinners for free. It gets Agentia from the SDK and reads a work item. Nothing to configure in code.
import {AgentiaCommand, getAgentiaHost} from '@copado/agentia-plugin-sdk'
export default class StoryShow extends AgentiaCommand {
static override description = 'Show the active user story'
public async run() {
const host = getAgentiaHost()
const story = await host.work.getWorkItem()
this.display(() => {
this.log(host.format.table(
[{field: 'name', header: 'Story'}, {field: 'status', header: 'Status'}],
[story],
))
})
return story
}
}What the plugin needs in package.json
Start developing
Once the project is generated, build it and link it into your local Agentia CLI:
Then run the generated sample command:
Re-run npm run build after every change to your TypeScript files.
Publish and submit
Publish to npm with provenance, then list the plugin in the Marketplace.
What plugins can do today
Supported
- Add new commands (
agentia <topic> <command>) - Use oclif flags, args, and the standard command lifecycle
- Read a user story, run the organization health check, and check which integrations are set up
- Print tables that match the built-in commands, and return data for
--json - Link or install like any other oclif plugin
Not supported yet
- Importing the CLI or its internals, or calling Copado endpoints directly
- Receiving API keys or any other credential
- Extending or wrapping all existing Agentia commands (
agentia cicd work commit, and so on) - Registering MCP tools through a plugin (
agentia mcp startonly loads tools shipped with the CLI)
Need something that is not listed? New capabilities are added deliberately after review.