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
1 change: 1 addition & 0 deletions src/discover/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub fn category_avg_tokens(category: &str, subcmd: &str) -> usize {
"GitHub" => 200,
"GitLab" => 200,
"PackageManager" => 150,
"Elixir" => 400,
_ => 150,
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/discover/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,23 @@ pub const RULES: &[RtkRule] = &[
subcmd_savings: &[],
subcmd_status: &[],
},
// Elixir tooling
RtkRule {
pattern: r"^mix\s+(test|compile|credo|phx\.routes|ash\.codegen|ash_postgres\.generate_migrations)",
rtk_cmd: "rtk mix",
rewrite_prefixes: &["mix"],
category: "Elixir",
savings_pct: 85.0,
subcmd_savings: &[
("test", 90.0),
("compile", 85.0),
("credo", 80.0),
("phx.routes", 70.0),
("ash.codegen", 88.0),
("ash_postgres.generate_migrations", 88.0),
],
subcmd_status: &[],
},
RtkRule {
pattern: r"^aws\s+",
rtk_cmd: "rtk aws",
Expand Down
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod core;
mod discover;
mod hooks;
mod learn;
mod mix_cmd;
mod parser;

// Re-export command modules for routing
Expand Down Expand Up @@ -672,6 +673,13 @@ enum Commands {
args: Vec<String>,
},

/// Elixir Mix commands with compact output (compile, credo, phx.routes, ash.codegen)
Mix {
/// Mix arguments (e.g., compile, credo, phx.routes)
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
args: Vec<String>,
},

/// Mypy type checker with grouped error output
Mypy {
/// Mypy arguments
Expand Down Expand Up @@ -2134,6 +2142,8 @@ fn run_cli() -> Result<i32> {

Commands::Pytest { args } => pytest_cmd::run(&args, cli.verbose)?,

Commands::Mix { args } => mix_cmd::run(&args, cli.verbose)?,

Commands::Mypy { args } => mypy_cmd::run(&args, cli.verbose)?,

Commands::Rake { args } => rake_cmd::run(&args, cli.verbose)?,
Expand Down Expand Up @@ -2496,6 +2506,7 @@ fn is_operational_command(cmd: &Commands) -> bool {
| Commands::Npm { .. }
| Commands::Npx { .. }
| Commands::Curl { .. }
| Commands::Mix { .. }
| Commands::Ruff { .. }
| Commands::Pytest { .. }
| Commands::Rake { .. }
Expand Down
Loading