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.

    1

    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.

    $ npm init @copado/agentia-plugin my-plugin

    The destination can be a relative or an absolute path:

    $ npm init @copado/agentia-plugin /path/to/my-plugin
    2

    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.

    3

    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

    $ "agentia": {
    $ "hostApi": 1,
    $ "requires": ["work.getWorkItem", "format.table"],
    $ "permissions": {"network": [], "files": "none", "commands": [], "env": []},
    $ "hooks": []
    $ }
    4

    Start developing

    Once the project is generated, build it and link it into your local Agentia CLI:

    $ cd my-plugin
    $ npm run build
    $ agentia plugins link .

    Then run the generated sample command:

    $ agentia <topic> <command>

    Re-run npm run build after every change to your TypeScript files.

    5

    Publish and submit

    Publish to npm with provenance, then list the plugin in the Marketplace.

    $ npm publish --provenance
    Submit a pluginComing soon

    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 start only loads tools shipped with the CLI)

    Need something that is not listed? New capabilities are added deliberately after review.