rtk-ai/rtk · error

Unknown filter ' '. Available: cargo-test, pytest, go-test…

Error message

Unknown filter '{}'. Available: cargo-test, pytest, go-test, go-build, ctest, tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, log, mypy, ruff-check, ruff-format, sqlfluff-lint, prettier, phpunit, pest, paratest, php-test, ecs, phpstan, pint

What it means

rtk's `rtk pipe <filter>` runs stdin through a named output filter. If the filter name passed after `pipe` does not exactly match one of the registered filter names, `resolve_filter` returns None and run() bails with this error listing every valid filter name.

Solutions

  1. Run the command again using one of the exact names printed in the error message (hyphenated, lowercase).
  2. Check `rtk pipe --help` or the docs for the canonical filter list for your installed version.
  3. Upgrade or downgrade rtk so the binary version matches the filter name your script expects.
  4. If the command is not covered, use `rtk proxy <cmd>` or raw execution instead of a nonexistent filter.

Example fix

// before
rtk pipe cargo_test < output.txt
// after
rtk pipe cargo-test < output.txt
Defensive patterns

Strategy: validation

Validate before calling

const VALID_FILTERS: &[&str] = &["cargo-test","pytest","go-test","go-build","ctest","tsc","vitest","grep","rg","find","fd","git-log","git-diff","git-status","log","mypy","ruff-check","ruff-format","sqlfluff-lint","prettier","phpunit","pest","paratest","php-test","ecs","phpstan","pint"];
fn is_valid_filter(name: &str) -> bool { VALID_FILTERS.contains(&name) }
// call before rtk pipe <name>

Prevention

When it happens

Trigger: Running `rtk pipe <name>` (or invoking the pipe command programmatically via run()) with a name that is not in the resolver's table — e.g. a typo like 'cargo_test' instead of 'cargo-test', a removed/renamed filter like an old 'jest' alias, or a filter added in a newer rtk version than the installed binary.

Common situations: Shell scripts or agent configs written against a different rtk version; users guessing filter names instead of consulting the list; underscore vs hyphen mistakes; docs referencing filters that were consolidated into other names.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/2cd020b2c7b745c7. Report an issue: GitHub.

Appendix: source

Thrown at src/cmds/system/pipe_cmd.rs:274

pub fn run(filter_name: Option<&str>, passthrough: bool) -> Result<()> {
    if passthrough {
        std::io::copy(&mut std::io::stdin(), &mut std::io::stdout())
            .map_err(|e| anyhow::anyhow!("Failed to relay stdin: {}", e))?;
        return Ok(());
    }

    let mut buf = String::new();
    std::io::stdin()
        .take((RAW_CAP + 1) as u64)
        .read_to_string(&mut buf)
        .map_err(|e| anyhow::anyhow!("Failed to read stdin: {}", e))?;
    if buf.len() > RAW_CAP {
        anyhow::bail!("stdin exceeds {} byte limit", RAW_CAP);
    }

    let filter_fn = match filter_name {
        Some(name) => resolve_filter(name).ok_or_else(|| {
            anyhow::anyhow!(
                "Unknown filter '{}'. Available: cargo-test, pytest, go-test, go-build, \
                 ctest, tsc, vitest, grep, rg, find, fd, git-log, git-diff, git-status, \
                 log, mypy, ruff-check, ruff-format, sqlfluff-lint, prettier, phpunit, pest, \
                 paratest, php-test, ecs, phpstan, pint",
                name
            )
        })?,
        None => auto_detect_filter(&buf),
    };

    let output = apply_filter(filter_fn, &buf);
    let shown = never_worse(&buf, &output);
    print!("{}", shown);
    Ok(())
}

#[cfg(test)]
mod tests {

View on GitHub (pinned to 0924356b4c)