Skip to content
Closed
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: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ rtk rubocop # Ruby linting (JSON, -60%+)

### Package Managers
```bash
rtk yarn test # Intelligent script routing + filtering
rtk yarn build # Next.js build compact via yarn
rtk yarn typecheck # TypeScript errors via yarn
rtk pnpm list # Compact dependency tree
rtk pip list # Python packages (auto-detect uv)
rtk pip outdated # Outdated packages
Expand Down Expand Up @@ -362,6 +365,7 @@ cp hooks/opencode-rtk.ts ~/.config/opencode/plugins/rtk.ts
| `docker ps/images/logs` | `rtk docker ...` |
| `kubectl get/logs` | `rtk kubectl ...` |
| `curl` | `rtk curl` |
| `yarn test/build/lint/typecheck` | `rtk yarn ...` |
| `pnpm list/outdated` | `rtk pnpm ...` |

Commands already using `rtk`, heredocs (`<<`), and unrecognized commands pass through unchanged.
Expand Down
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ mod verify_cmd;
mod vitest_cmd;
mod wc_cmd;
mod wget_cmd;
mod yarn_cmd;

use anyhow::{Context, Result};
use clap::error::ErrorKind;
Expand Down Expand Up @@ -538,6 +539,13 @@ enum Commands {
args: Vec<String>,
},

/// Yarn scripts with intelligent routing (test, build, lint, typecheck -> specialized filters)
Yarn {
/// Yarn arguments (script name + options)
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
args: Vec<String>,
},

/// npx with intelligent routing (tsc, eslint, prisma -> specialized filters)
Npx {
/// npx arguments (command + options)
Expand Down Expand Up @@ -1896,6 +1904,10 @@ fn main() -> Result<()> {
npm_cmd::run(&args, cli.verbose, cli.skip_env)?;
}

Commands::Yarn { args } => {
yarn_cmd::run(&args, cli.verbose, cli.skip_env)?;
}

Commands::Curl { args } => {
curl_cmd::run(&args, cli.verbose)?;
}
Expand Down Expand Up @@ -2291,6 +2303,7 @@ fn is_operational_command(cmd: &Commands) -> bool {
| Commands::Playwright { .. }
| Commands::Cargo { .. }
| Commands::Npm { .. }
| Commands::Yarn { .. }
| Commands::Npx { .. }
| Commands::Curl { .. }
| Commands::Ruff { .. }
Expand Down
2 changes: 1 addition & 1 deletion src/tsc_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn run(args: &[String], verbose: u8) -> Result<()> {
}

/// Filter TypeScript compiler output - group errors by file, show every error
fn filter_tsc_output(output: &str) -> String {
pub fn filter_tsc_output(output: &str) -> String {
lazy_static::lazy_static! {
// Pattern: src/file.ts(12,5): error TS2322: Type 'string' is not assignable to type 'number'.
static ref TSC_ERROR: Regex = Regex::new(
Expand Down
Loading