Skip to content

rtk must pass through unrecognized commands #286

Closed

Description

@fnando

The instruction file states that if it doesn't have a dedicated filter, it passes commands through unchanged. That's not happening.

$ rtk make build-test-wasms

error: unrecognized subcommand 'make'

Usage: rtk [OPTIONS] <COMMAND>

For more information, try '--help'.

Another example:

$ rtk ruby --version

error: unrecognized subcommand 'ruby'

Usage: rtk [OPTIONS] <COMMAND>

For more information, try '--help'.

Activity

  1. tino commented on Mar 3, 2026

    @tino

    Yeah this is contradictory to the instructions

  2. FlorianBruniaux commented on Mar 5, 2026

    @FlorianBruniaux
    Contributor

    Resolved by PR #349 (TOML filter DSL).

    When Clap cannot route a command, run_fallback() now checks for a matching TOML filter before falling back to raw passthrough. Unrecognized commands are filtered if a TOML match exists, and streamed unfiltered otherwise — no output is ever dropped.

    Users can add their own filters in .rtk/filters.toml without writing Rust.

  3. pszymkowiak commented on Mar 10, 2026

    @pszymkowiak
    Collaborator

    Resolved — RTK now supports passthrough for unrecognized commands via the run_fallback() mechanism (landed in PR #349).

    When a command isn't recognized by RTK's Clap parser:

    1. If a TOML filter matches → filter is applied, savings tracked
    2. If no TOML filter matches → pure passthrough (stdout/stderr inherited), 0% savings but usage tracked
    3. If command not found → clean error [rtk: <error>], exit 127

    This means RTK never blocks unrecognized commands anymore. Combined with 36 built-in TOML filters, most common commands get filtered automatically.

    If you encounter any issues, feel free to reopen or file a new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions