Skip to content

Conversation

krissetto
Copy link
Contributor

Proposal for adding support for commands in the CLI/TUI/API

Example yaml file

version: "2"

agents:
  root:
    model: openai/gpt-5-nano
    instruction: you are a helpful computer assistant
    commands:
      df: "check how much free space i have on my disk"
      ls: "list the files in the current directory"
    toolsets:
      - type: filesystem
      - type: shell

  another:
    model: openai/gpt-5-nano
    instruction: you are a helpful computer assistant
    commands:
      - fun: "tell me a joke about computers"
      - info: "tell me some information about computers"

Example CLI usage

# run a command
$ cagent run test.yaml -c df
... opens tui and sends the chosen command as the user message

$ cagent run test.yaml --command ls
... opens tui and sends the chosen command as the user message


# list commands
$ cagent run test.yaml -c

For any feedback, please visit: https://docker.qualtrics.com/jfe/form/SV_cNsCIg92nQemlfw

Available commands for agent 'root':
 - df: check how much free space i have on my disk
 - ls: list the files in the current directory

closes #128

@krissetto krissetto requested a review from a team as a code owner October 1, 2025 12:05
@rumpl
Copy link
Member

rumpl commented Oct 2, 2025

I think I would prefer if we could run a command with cagent run agent.yaml df instead of -c df

And maybe have cagent commands agent.yaml ?

Things got merged and this has conflicts now, sorry

@krissetto krissetto force-pushed the support-for-commands branch from e95c5a3 to 72fd7de Compare October 2, 2025 12:48
@krissetto
Copy link
Contributor Author

krissetto commented Oct 2, 2025

conflicts resolved. i'm fine without the -c, but do we still want to support messages? right now cagent run agent.yaml hello works and that conflicts with what you're saying.

i can add the commands command if we want that

@krissetto
Copy link
Contributor Author

krissetto commented Oct 2, 2025

-c without a command currently does the listing like i assume you want cagent commands agent.yaml to do, just in case a user misuses the flag

@rumpl
Copy link
Member

rumpl commented Oct 2, 2025

cagent run agent.yaml --command that lists commands definitely looks weird to me.

What about:

$ cagent command ls agent.yaml
$ cagent command run agent.yaml <command>

I'm only asking mind you :)

@krissetto
Copy link
Contributor Author

Oh listing with --command/-c wasn't meant as the way to list available commands, but more as a ux thing for users who mess up so they don't have to type another command to see what commands are available.

I'm ok with either approach really, having a dedicated cagent command for commands (lol) feels a bit overkill to me right now for what we're trying to do, which is just have a default first message from the agent file sent automatically, but I can make those changes if that's what we agree upon. Would love to hear from the others as well but if I don't then I'll just make these changes and move on with other things :)

@krissetto krissetto force-pushed the support-for-commands branch 2 times, most recently from a0c4b83 to 67b6883 Compare October 8, 2025 11:55
@krissetto
Copy link
Contributor Author

Unless there are hard feelings around this, I'd honestly prefer if we merge this as is for now (meaning without a new top level CLI command) so this doesn't remain stuck here, and then iterate if we need to.

After using it a bit we can decide if we feel the need to make a top level cagent command command, especially if we feel the need for more features than currently implemented. To me it feels like a variation of the run command that's too small to warrant it's own top level command from the get-go

@krissetto krissetto force-pushed the support-for-commands branch from 67b6883 to 763e8de Compare October 8, 2025 12:04
@rumpl
Copy link
Member

rumpl commented Oct 8, 2025

Let's go

@krissetto krissetto merged commit aab5643 into docker:main Oct 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create agent dedicated commands

2 participants