-
Notifications
You must be signed in to change notification settings - Fork 147
feat: custom commands #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -56,6 +57,12 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) { | |||
if cmd != nil { | |||
return p, cmd | |||
} | |||
case dialog.CommandRunCustomMsg: | |||
// Handle custom command execution | |||
cmd := p.sendMessage(msg.Content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to check if the agent is busy here before we send the message.
p.app.CoderAgent.IsBusy()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's busy what should the behavior be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess just returning a warning should be fine right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you already did what I wanted to suggest 😂 awesome.
@ezynda3 do you mind adding a section for this in the readme? |
Done! |
Users can create custom commands by adding .md files to their configured
<data_dir>/commands
dir (default is.opencode/commands
). They can then open the command dialog as normal withcttrl+k
and select one of the custom commands.Custom commands are simply prompts and work similar to custom slash commands in Claude Code
ref: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#create-custom-slash-commands
Addresses: #132