Skip to content

Conversation

@ll931217
Copy link
Contributor

@ll931217 ll931217 commented Jul 5, 2025

Based off Issues #299

Custom slash command feature

Commands location

Checks for the commands directory under OpenCode's configuration directory.

~/.config/opencode/commands/

Commands under project directory

$PWD/.opencode/commands/

Usage

Should work exactly like Claude Code's Slash Command

/foo:bar:test-command $ARGUMENTS

Here is a command file I used to test:

---
description: Your weather forecast (Powered by wttr.in)
allowed-tools:
  - Bash(curl *)
---
# Context

- Get the weather forecast: !`curl wttr.in $ARGUMENTS`

Display the weather forecast for $ARGUMENTS

I don't have the allowed-tools frontmatter setup, because I don't think it is needed? Correct me if I am wrong

@ll931217 ll931217 marked this pull request as draft July 6, 2025 06:14
@ll931217 ll931217 force-pushed the custom-slash-command branch from 6366439 to ae629b1 Compare July 6, 2025 07:33
@ll931217 ll931217 marked this pull request as ready for review July 6, 2025 13:46
@ll931217 ll931217 force-pushed the custom-slash-command branch from e902e27 to 7795885 Compare July 9, 2025 03:01
@ll931217 ll931217 force-pushed the custom-slash-command branch from 69763b6 to 1c61494 Compare July 14, 2025 22:09
@thdxr
Copy link
Contributor

thdxr commented Jul 15, 2025

hey i appreciate how much work you put into this and this is definitely a feature we want to ship. however given it's such a core feature we need to talk internally about its design and that impacts implementation

i feel bad but i don't think it saves us too much time by merging this

we are discussing it tomorrow and will ship this week

@thdxr thdxr closed this Jul 15, 2025
@ll931217
Copy link
Contributor Author

@thdxr Awesome, no worries, I just implemented this for myself and thought I could share it here. Can't wait for you to release this feature, looking forward to it

@fettpl fettpl mentioned this pull request Aug 18, 2025
9 tasks
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.

2 participants