Open
Conversation
Add two new command modules: - `rtk aws`: Specialized filters for STS, S3, EC2, ECS, RDS, and CloudFormation commands. Generic fallback forces --output json and compresses via json_cmd schema extraction. Achieves 60%+ token savings on verbose AWS table/text output. - `rtk psql`: Detects table format (strips borders, separators, row counts, outputs tab-separated) and expanded format (converts -[ RECORD N ]- blocks to compact key=val one-liners). Passthrough for COPY/SET/notices. Both modules include 32 inline tests covering all filters, edge cases, overflow limits, and token savings verification. Hook rewrite patterns added for both distributable and dev hooks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Piped (cmd | grep), chained (cmd && cmd), and redirected (cmd > file) commands are no longer rewritten by the hook — the output is being processed by the next command, not shown to the LLM, so filtering would break the pipeline. RTK.md updated with guidance on when to use `rtk proxy` for raw unfiltered output (parsing specific fields, scripting, debugging). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… guidance" This reverts commit a0293af.
Collaborator
|
Thanks for adding AWS CLI and psql support — great additions to RTK's ecosystem! Tests pass (428/428), build is clean, and existing commands are unaffected. Here are some items to address Critical
Improvements
Minor
Overall solid work, looking forward to the next iteration! 🔧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk aws: Specialized filters for 8 high-frequency AWS CLI commands (STS identity, S3 ls, EC2 describe-instances, ECS list/describe-services, RDS describe-db-instances, CloudFormation list/describe-stacks). Generic fallback forces--output jsonand compresses viajson_cmd::filter_json_string()at depth 4. Achieves 60%+ token savings on verbose AWS table/text output.rtk psql: Detects psql table format (strips----+----borders,(N rows)footer, column padding → tab-separated) and expanded format (-[ RECORD N ]-blocks →[N] key=valone-liners). Passthrough for COPY/SET/notices. Overflow limits: 30 table rows, 20 expanded records.awsandpsqlin distributable and dev hooks.Test plan
cargo fmt --allcleancargo clippy --all-targets— no new warningsrtk aws sts get-caller-identityrtk psql -c "SELECT 1" mydb🤖 Generated with Claude Code