rtk-ai / rtk-ai/rtk

feat(pipe): apply arbitrary TOML filter file to stdin (--toml)

Open
#3,473 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli enhancement priority:medium
Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 21h
Merged PRs (30d)
35

Description

Summary

rtk pipe -f <name> applies a named built-in (Rust) filter to stdin. Open PR #2999 extends -f to trusted/builtin TOML filters by name.

What's still missing for filter authoring / preview workflows: apply a draft TOML filter file to captured output without installing it into .rtk/filters.toml or trusting it into the agent path.

rtk pipe --toml /tmp/draft-filter.toml < captured-output.txt

Motivation

Local dashboard / filter workshop tools need to:

  1. Capture (or re-run) a command's raw output
  2. Draft a custom TOML filter from keep/strip marks
  3. Preview what that filter would do to the same output via RTK's real pipeline
  4. Iterate before writing + rtk trust

Today the engine can do this (parse_and_compile + apply_filter), but there is no CLI surface for an arbitrary path.

Proposal

  • Add rtk pipe --toml <path> (mutually exclusive with -f / --passthrough as appropriate)
  • Read + compile the TOML file explicitly named by the user (bypass trust store — this is preview, not agent injection)
  • If the file defines multiple [filters.*], apply the first, or require --filter <name> to select
  • Apply to stdin with existing RAW_CAP + never_worse behavior
  • Do not write the path into the trust store as a side effect

Related: #2179, #2999

Out of scope

  • Changing hook/rewrite trust gating
  • Inline TOML via CLI string (file path only)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the rtk pipe CLI entry point and trace the existing parse_and_compile and apply_filter engine paths. Add explicit TOML-file preview handling with the proposed -f/--passthrough constraints, selection behavior for multiple filters, existing RAW_CAP and never_worse behavior, and no trust-store write; related issues #2179 and #2999 provide context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.