{"record":{"id":"e9833e27b6bc3bcf","repo":"rtk-ai/rtk","slug":"unknown-filter-available-cargo-test-pytest","errorCode":null,"errorMessage":"Unknown filter '{}'. Available: cargo-test, pytest, go-test, go-build, tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, log, mypy, ruff-check, ruff-format, prettier, phpunit, pest, paratest, php-test, ecs, phpstan, pint","messagePattern":"Unknown filter '(.+?)'\\. Available: cargo-test, pytest, go-test, go-build, tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, log, mypy, ruff-check, ruff-format, prettier, phpunit, pest, paratest, php-test, ecs, phpstan, pint","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmds/system/pipe_cmd.rs","lineNumber":264,"sourceCode":"pub fn run(filter_name: Option<&str>, passthrough: bool) -> Result<()> {\n    if passthrough {\n        std::io::copy(&mut std::io::stdin(), &mut std::io::stdout())\n            .map_err(|e| anyhow::anyhow!(\"Failed to relay stdin: {}\", e))?;\n        return Ok(());\n    }\n\n    let mut buf = String::new();\n    std::io::stdin()\n        .take((RAW_CAP + 1) as u64)\n        .read_to_string(&mut buf)\n        .map_err(|e| anyhow::anyhow!(\"Failed to read stdin: {}\", e))?;\n    if buf.len() > RAW_CAP {\n        anyhow::bail!(\"stdin exceeds {} byte limit\", RAW_CAP);\n    }\n\n    let filter_fn = match filter_name {\n        Some(name) => resolve_filter(name).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Unknown filter '{}'. Available: cargo-test, pytest, go-test, go-build, \\\n                 tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, \\\n                 log, mypy, ruff-check, ruff-format, prettier, phpunit, pest, \\\n                 paratest, php-test, ecs, phpstan, pint\",\n                name\n            )\n        })?,\n        None => auto_detect_filter(&buf),\n    };\n\n    let output = apply_filter(filter_fn, &buf);\n    let shown = never_worse(&buf, &output);\n    print!(\"{}\", shown);\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/rtk-ai/rtk/blob/d977e1c31621fe8704e6500ceeb9c7a0de2b6836/src/cmds/system/pipe_cmd.rs#L246-L282","documentation":"`rtk pipe --filter <name>` resolves the name against a fixed registry; unknown names fail with the full supported list (cargo-test, pytest, go-test, go-build, tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, log, mypy, ruff-check, ruff-format, prettier, phpunit, pest, paratest, php-test, ecs, phpstan, pint). Omitting --filter lets auto_detect_filter guess from content instead of failing.","triggerScenarios":"Passing any name outside the registry: `rtk pipe --filter jest`, `--filter bun-test`, `--filter cargo-clippy`, `--filter tox`; or a format typo like `--filter cargo_test` / `--filter CargoTest` — keys are exact kebab-case.","commonSituations":"Assuming every tool rtk wraps as a command proxy also exists as a pipe filter; snake_case habit from other CLIs; stale blog/docs examples; npm users reaching for jest when vitest is the registered key.","solutions":["Drop --filter entirely and let auto-detection pick from the content: `cat out.txt | rtk pipe`","Use an exact kebab-case name from the list — e.g. `--filter vitest` for Vite test output, `--filter tsc` for TypeScript diagnostics","For genuinely unsupported tools, use `rtk pipe --passthrough` or pre-filter with grep"],"exampleFix":"# before: jest is not a registered filter\nrtk pipe --filter jest < test-out.txt\n# Unknown filter 'jest'. Available: cargo-test, pytest, ...\n\n# after\ncat test-out.txt | rtk pipe                 # auto-detect (vitest output matches vitest)\ncat test-out.txt | rtk pipe --filter vitest  # or name it exactly","handlingStrategy":"validation","validationCode":"bash:\nKNOWN='cargo-test pytest go-test go-build tsc vitest grep rg find fd git-log git-diff git-status log mypy ruff-check ruff-format prettier phpunit pest paratest php-test ecs phpstan pint'\nif [ -n \"$FILTER\" ] && ! [[ \" $KNOWN \" =~ \" $FILTER \" ]]; then\n  echo \"unknown filter '$FILTER' — omit --filter to auto-detect\" >&2\n  FILTER=\"\"\nfi\nrtk pipe ${FILTER:+--filter \"$FILTER\"} < out.txt","typeGuard":"rust:\nconst PIPE_FILTERS: &[&str] = &[\n    \"cargo-test\", \"pytest\", \"go-test\", \"go-build\", \"tsc\", \"vitest\", \"grep\", \"rg\", \"find\", \"fd\",\n    \"git-log\", \"git-diff\", \"git-status\", \"log\", \"mypy\", \"ruff-check\", \"ruff-format\", \"prettier\",\n    \"phpunit\", \"pest\", \"paratest\", \"php-test\", \"ecs\", \"phpstan\", \"pint\",\n];\nfn is_known_pipe_filter(name: &str) -> bool {\n    PIPE_FILTERS.contains(&name)\n}","tryCatchPattern":"rust:\nmatch pipe_cmd::run(Some(name), false) {\n    Err(e) if e.to_string().contains(\"Unknown filter\") => {\n        pipe_cmd::run(None, false) // retry with auto-detect from content\n    }\n    r => r,\n}","preventionTips":["Omit --filter; auto-detect reads the content and rarely needs help","Filter keys are exact kebab-case: cargo-test, not cargo_test or CargoTest","A command proxy existing (rtk jest) does not imply a pipe filter exists","Copy names from the error message itself — it always prints the full registry"],"tags":["pipe","filters","registry","usage","kebab-case"],"backgroundTag":null,"analyzedSha":"d977e1c31621fe8704e6500ceeb9c7a0de2b6836","analyzedAt":"2026-08-16T05:40:46.291Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}