Skip to main content

ai_agent/commands/
commit_push_pr.rs

1use super::Command;
2
3const ALLOWED_TOOLS: &[&str] = &[
4    "Bash(git checkout --branch:*)",
5    "Bash(git checkout -b:*)",
6    "Bash(git add:*)",
7    "Bash(git status:*)",
8    "Bash(git push:*)",
9    "Bash(git commit:*)",
10    "Bash(gh pr create:*)",
11    "Bash(gh pr edit:*)",
12    "Bash(gh pr view:*)",
13    "Bash(gh pr merge:*)",
14    "ToolSearch",
15    "mcp__slack__send_message",
16    "mcp__claude_ai_Slack__slack_send_message",
17];
18
19pub fn create_commit_push_pr_command() -> Command {
20    Command::prompt("commit-push-pr", "Commit, push, and open a PR")
21        .argument_hint("[<additional-instructions>]")
22}
23
24pub fn get_commit_push_pr_allowed_tools() -> Vec<String> {
25    ALLOWED_TOOLS.iter().map(|s| s.to_string()).collect()
26}