Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Plugin CLI commands not registered - clawdbot <plugin-cmd> fails with "unknown command" #2173

@dial481

Description

@dial481

Summary

Plugin CLI commands registered via api.registerCli() are not available when running clawdbot <plugin-command> directly. The command fails with the main help output as if the command doesn't exist.

Regression introduced between v2026.1.16-2 (working) and v2026.1.23-1 (broken).

Steps to reproduce

  1. Create a minimal plugin at ~/.clawdbot/extensions/test-plugin/index.ts:
                                                                                                                        
  export default {                                                                                                                     
    id: "test-plugin",                                                                                                                 
    name: "Test Plugin",                                                                                                               
    configSchema: { parse: () => ({}) },                                                                                               
    register(api) {                                                                                                                    
      console.log("REGISTER CALLED");                                                                                                  
      api.registerCli(({ program }) => {                                                                                               
        console.log("CLI REGISTRAR CALLED");                                                                                           
        program.command("testcmd").action(() => console.log("works!"));                                                                
      }, { commands: ["testcmd"] });                                                                                                   
    },                                                                                                                                 
  };
  1. Create manifest at ~/.clawdbot/extensions/test-plugin/clawdbot.plugin.json:
   "id": "test-plugin",                                                                                                               
   "kind": "utility",                                                                                                                 
   "configSchema": { "type": "object", "properties": {} }                                                                             
 }
  1. Enable the plugin:
    clawdbot plugins enable test-plugin

  2. Verify CLI command is registered:
    clawdbot plugins info test-plugin

Shows: CLI commands: testcmd

  1. Try to run the command:
    clawdbot testcmd --help

Expected behavior

Running clawdbot testcmd --help should show help for the testcmd command, and the console should print "REGISTER CALLED" and "CLI REGISTRAR CALLED".

Actual behavior

Running clawdbot testcmd --help shows the main clawdbot help (as if "testcmd" doesn't exist). No console output appears - the plugin's register() function is never called.

However, running clawdbot plugins list DOES print both console messages, proving the registration code works when plugins are loaded.

Environment

  • Clawdbot version: 2026.1.24-3 (also tested 2026.1.23-1)
  • Last working version: 2026.1.16-2
  • OS: Linux 6.1.0-42-amd64 (Debian 12)
  • Install method: npm global

Logs or screenshots

$ clawdbot plugins info test-plugin
REGISTER CALLED
CLI REGISTRAR CALLED
...
CLI commands: testcmd # ← Command IS registered in the plugin

$ clawdbot testcmd --help
🦞 Clawdbot 2026.1.24-3 (885167d)

Usage: clawdbot [options] [command]
...

No "REGISTER CALLED" output, shows main help instead of testcmd help

Analysis

registerPluginCliCommands() is only called inside the plugins subcommand's lazy register function at
src/cli/program/register.subclis.ts:181-182. Plugin CLI commands are never added to Commander for direct invocation.

The bundled voice-call plugin has the same issue - clawdbot voicecall --help also fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions