-
Notifications
You must be signed in to change notification settings - Fork 42
🤖 feat: add custom executable slash commands (.mux/commands/) #1523
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
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8152aa515
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Addressed the P1 and P2 review comments:
Also added:
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccbeaea806
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Addressed additional review comments:
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04ddac9a3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11cc4f1b8e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Adds support for custom slash commands that run executables in the workspace. ## Features - **Discovery**: Executables at `.mux/commands/<name>` are discovered and appear in slash command autocomplete. - **Execution**: `/<name> [args...]` runs the command with: - First line tokens become argv - Lines after the first become stdin - Stdout streams in real-time via init events - Stdout becomes the user message on success - **Environment**: Commands receive MUX_* env vars (project path, runtime, workspace name, workspace path). ## Implementation - Backend: SlashCommandService for discovery and execution with streaming - Frontend: Parser extended with rawInput for unknown commands - Frontend: ChatInput wired to execute custom commands and show autocomplete - Docs: New page at docs/hooks/slash-commands.mdx ## Example ```bash #!/bin/bash # .mux/commands/refinement echo "Refine this:" cat ``` Then use with: `/refinement\n<text to refine>`
- Quote command path before exec to handle spaces in workspace paths (P1) - Preserve stdin whitespace - don't trim multiline input (P2) - Add exit code 2 handling: show output but don't send to model - Update docs with progressive examples (static msg, args, stdin) - Add comprehensive UI integration tests for custom slash commands - Add unit tests for custom command suggestions
- Remove UI integration tests that were timing out in CI - Add backend integration tests for slash command functionality: - Command discovery (list) - Command execution (run) - Exit code handling (0, 2, others) - Argument and stdin passing
- P2: Preserve blank lines in command stdout by accumulating raw bytes instead of using LineBuffer (which drops empty lines) - P3: Restore input when command produces no output (consistent error handling)
11cc4f1 to
825fabf
Compare
Summary
Adds support for custom slash commands that run executables in the workspace.
Features
.mux/commands/<name>are discovered and appear in slash command autocomplete/<name> [args...]runs the command with:Example
Then use with:
/refinement\n<text to refine>Implementation
SlashCommandServicefor discovery and execution with streamingrawInputfor unknown commandsTesting
Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$11.85