Skip to content
Open
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
10 changes: 10 additions & 0 deletions .claude/hooks/rtk-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ elif echo "$MATCH_CMD" | grep -qE '^pip[[:space:]]+(list|outdated|install|show)(
elif echo "$MATCH_CMD" | grep -qE '^uv[[:space:]]+pip[[:space:]]+(list|outdated|install|show)([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^uv pip /rtk pip /')"

# --- Ruby / RSpec ---
elif echo "$MATCH_CMD" | grep -qE '^rspec([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^rspec/rtk rspec/')"
elif echo "$MATCH_CMD" | grep -qE '^bin/rspec([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's|^bin/rspec|rtk rspec|')"
elif echo "$MATCH_CMD" | grep -qE '^bundle[[:space:]]+exec[[:space:]]+rspec([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^bundle exec rspec/rtk rspec/')"
elif echo "$MATCH_CMD" | grep -qE '^bundle[[:space:]]+exec[[:space:]]+rails[[:space:]]+spec([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^bundle exec rails spec/rtk rspec/')"

# --- Go tooling ---
elif echo "$MATCH_CMD" | grep -qE '^go[[:space:]]+test([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^go test/rtk go test/')"
Expand Down
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
rust = "latest"
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod prettier_cmd;
mod prisma_cmd;
mod pytest_cmd;
mod read;
mod rspec_cmd;
mod ruff_cmd;
mod runner;
mod summary;
Expand Down Expand Up @@ -498,6 +499,13 @@ enum Commands {
args: Vec<String>,
},

/// RSpec test runner with compact output (Rails/Ruby)
Rspec {
/// RSpec arguments (e.g., spec/models, --tag focus)
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
args: Vec<String>,
},

/// Pip package manager with compact output (auto-detects uv)
Pip {
/// Pip arguments (e.g., list, outdated, install)
Expand Down Expand Up @@ -1383,6 +1391,10 @@ fn main() -> Result<()> {
pytest_cmd::run(&args, cli.verbose)?;
}

Commands::Rspec { args } => {
rspec_cmd::run(&args, cli.verbose)?;
}

Commands::Pip { args } => {
pip_cmd::run(&args, cli.verbose)?;
}
Expand Down
Loading