Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/slash-command-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Slash Command Generator automates the creation of slash command files for AI

The generator reads markdown prompts from the `prompts/` directory and produces command files in the appropriate format for each configured AI assistant. It supports:

- **Multiple agents**: 6 supported AI assistants with different command formats
- **Multiple agents**: 7 supported AI assistants with different command formats
- **Auto-detection**: Automatically detects configured agents in your workspace
- **Dry run mode**: Preview changes without writing files
- **Safe overwrite handling**: Prompts before overwriting existing files with backup support
Expand Down Expand Up @@ -193,6 +193,7 @@ The following agents are supported:
| `codex-cli` | Codex CLI | Markdown | `.md` | `.codex/prompts` | [Home](https://developers.openai.com/codex) · [Docs](https://developers.openai.com/codex/cli/) |
| `cursor` | Cursor | Markdown | `.md` | `.cursor/commands` | [Home](https://cursor.com/) · [Docs](https://cursor.com/docs) |
| `gemini-cli` | Gemini CLI | TOML | `.toml` | `.gemini/commands` | [Home](https://github.com/google-gemini/gemini-cli) · [Docs](https://geminicli.com/docs/) |
| `opencode` | OpenCode CLI | Markdown | `.md` | `.config/opencode/command` | [Home](https://opencode.ai) · [Docs](https://opencode.ai/docs/commands) |
| `vs-code` | VS Code | Markdown | `.prompt.md` | `.config/Code/User/prompts` | [Home](https://code.visualstudio.com/) · [Docs](https://code.visualstudio.com/docs) |
| `windsurf` | Windsurf | Markdown | `.md` | `.codeium/windsurf/global_workflows` | [Home](https://windsurf.com/editor) · [Docs](https://docs.windsurf.com/) |

Expand Down Expand Up @@ -284,6 +285,7 @@ Generated files are placed in agent-specific directories:
.codex/prompts/ # Codex CLI
.cursor/commands/ # Cursor
.gemini/commands/ # Gemini CLI
.config/opencode/command/ # OpenCode CLI
.codeium/windsurf/global_workflows/ # Windsurf
```

Expand Down
8 changes: 8 additions & 0 deletions slash_commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ def iter_detection_dirs(self) -> Iterable[str]:
".md",
(".codeium", ".codeium/windsurf"),
),
(
"opencode",
"OpenCode CLI",
".config/opencode/command",
CommandFormat.MARKDOWN,
".md",
(".opencode",),
),
)

_SORTED_AGENT_DATA = tuple(sorted(_SUPPORTED_AGENT_DATA, key=lambda item: item[0]))
Expand Down
11 changes: 10 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
"command_file_extension": ".toml",
"detection_dirs": (".gemini",),
},
"opencode": {
"display_name": "OpenCode CLI",
"command_dir": ".config/opencode/command",
"command_format": CommandFormat.MARKDOWN,
"command_file_extension": ".md",
"detection_dirs": (".opencode",),
},
"vs-code": {
"display_name": "VS Code",
"command_dir": ".config/Code/User/prompts",
Expand Down Expand Up @@ -128,7 +135,7 @@ def test_supported_agents_include_all_markdown_and_toml_formats(
for agent in supported_agents_by_key.values()
if agent.command_format is CommandFormat.TOML
]
assert len(markdown_agents) == 5
assert len(markdown_agents) == 6
assert len(toml_agents) == 1


Expand All @@ -149,6 +156,8 @@ def test_detection_dirs_cover_command_directory_roots(
".codeium" in agent.detection_dirs
or ".codeium/windsurf" in agent.detection_dirs
)
elif agent.key == "opencode":
assert ".opencode" in agent.detection_dirs
else:
assert command_root in agent.detection_dirs
else:
Expand Down