Add installation guide for AI coding assistants#8
Conversation
Documents 3 upstream PRs (git fix, pnpm support, issues) with: - Before/after examples - Token savings metrics - Production testing notes - Security improvements - Installation instructions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add INSTALL.md with step-by-step installation instructions - Mandatory pre-installation verification check (rtk --version) - Troubleshooting section for common issues - Production-validated token savings metrics (anonymized) - AI assistant integration checklist - Fork vs upstream installation strategy
There was a problem hiding this comment.
Pull request overview
Adds an installation/onboarding guide aimed at AI coding assistants and updates the README with detailed “fork improvements” content (including claimed support/fixes and token-savings metrics).
Changes:
- Added a new
INSTALL.mdwith pre-install verification, install steps, troubleshooting, and an AI assistant checklist. - Extended
README.mdwith a large section describing fork-specific improvements, upstream PR links, and installation guidance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| README.md | Adds a fork-focused section (claimed git parsing fix, pnpm support, token metrics, and fork install instructions). |
| INSTALL.md | Introduces a dedicated installation guide with verification-first workflow, troubleshooting, and assistant checklist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - [ ] Use `rtk` for ALL git/pnpm/test/vitest commands | ||
| - [ ] Check savings: `rtk gain` | ||
|
|
||
| **Golden Rule**: AI coding assistants should ALWAYS use `rtk` as a proxy for shell commands that generate verbose output (git, pnpm, npm, cargo test, vitest, docker, kubectl). |
There was a problem hiding this comment.
The “AI Assistant Checklist” says to use rtk for ALL pnpm/vitest commands, but those subcommands are not implemented in the current CLI. This should be reworded to match the actual supported command set (or explicitly scoped to the branch/PR that adds pnpm/vitest support).
| - [ ] Use `rtk` for ALL git/pnpm/test/vitest commands | |
| - [ ] Check savings: `rtk gain` | |
| **Golden Rule**: AI coding assistants should ALWAYS use `rtk` as a proxy for shell commands that generate verbose output (git, pnpm, npm, cargo test, vitest, docker, kubectl). | |
| - [ ] Prefer using `rtk` for git and test commands that are supported by your installed RTK version (see `rtk --help`) | |
| - [ ] Check savings: `rtk gain` | |
| **Golden Rule**: AI coding assistants should use `rtk` as a proxy for shell commands that generate verbose output and are supported by the installed RTK version (for example: git, npm, cargo test; and pnpm/vitest when using a fork/branch that adds support, docker, kubectl). |
| Fixes a major bug where git flags were rejected as invalid arguments. | ||
|
|
||
| **Problem**: | ||
| ```bash | ||
| rtk git log --oneline -20 | ||
| # Error: unexpected argument '--oneline' found | ||
| ``` | ||
|
|
||
| **Solution**: | ||
| - Fixed Clap argument parsing with `trailing_var_arg + allow_hyphen_values` | ||
| - Auto-detects `--merges` flag to skip `--no-merges` injection | ||
| - Propagates git exit codes properly (fixes CI/CD false positives) | ||
|
|
||
| **Now Working**: | ||
| ```bash | ||
| rtk git log --oneline -20 # Compact commit history | ||
| rtk git diff --cached # Staged changes only | ||
| rtk git log --graph --all # Branch visualization | ||
| rtk git status --short # Ultra-compact status | ||
| ``` |
There was a problem hiding this comment.
The README claims the git argument parsing bug is fixed and shows examples like rtk git log --oneline -20 as “Now Working”, but the current CLI definition for rtk git log/rtk git diff still doesn’t allow hyphen-prefixed values for the args positional (see src/main.rs where GitCommands::{Log,Diff} have #[arg(trailing_var_arg = true)] without allow_hyphen_values = true). As-is, --oneline is still likely to be rejected by clap. Either update the docs to describe this as a pending change / branch-specific behavior, or implement the parsing fix before advertising it here.
| ### 📦 PR #6: pnpm Support for Modern JavaScript Stacks | ||
|
|
||
| **Status**: [Open](https://github.com/pszymkowiak/rtk/pull/6) | **Target**: T3 Stack users | ||
|
|
||
| Adds first-class pnpm support with security hardening. | ||
|
|
||
| **New Commands**: | ||
| ```bash | ||
| rtk pnpm list # Dependency tree (70% token reduction) | ||
| rtk pnpm outdated # Update candidates (80-90% reduction) | ||
| rtk pnpm install <pkg> # Silent success confirmation | ||
| ``` |
There was a problem hiding this comment.
This section documents rtk pnpm ... commands and claims pnpm support exists in this fork, but there is no pnpm subcommand in the current CLI (src/main.rs enum Commands doesn’t include Pnpm). This will mislead users following the README. Either remove/soften this to “planned” and point at the relevant branch/PR, or add the actual pnpm command implementation before merging the docs.
| # Clone and build | ||
| git clone https://github.com/FlorianBruniaux/rtk.git | ||
| cd rtk | ||
| cargo build --release | ||
|
|
||
| # Install globally | ||
| cargo install --path . | ||
|
|
||
| # Or use directly |
There was a problem hiding this comment.
The installation snippet runs cargo build --release and then cargo install --path .. cargo install --path . already performs a release build and does not reuse the local target/release artifacts, so this extra build step is redundant and can confuse readers (and wastes time). Consider either (a) using only cargo install --path . (optionally with --force for upgrades) or (b) using cargo build --release and running ./target/release/rtk without cargo install as an alternative path.
| # Clone and build | |
| git clone https://github.com/FlorianBruniaux/rtk.git | |
| cd rtk | |
| cargo build --release | |
| # Install globally | |
| cargo install --path . | |
| # Or use directly | |
| # Clone and install from source | |
| git clone https://github.com/FlorianBruniaux/rtk.git | |
| cd rtk | |
| cargo install --path . | |
| # Or build and run locally (no install) | |
| cargo build --release |
| ## Improvements in This Fork | ||
|
|
||
| This fork adds critical fixes and modern JavaScript stack support to RTK, validated on production T3 Stack codebases. |
There was a problem hiding this comment.
The PR description says only INSTALL.md is changed, but this PR also adds a large fork-specific section to README.md. Please update the PR description (or remove the README change) so reviewers and downstream consumers understand the scope and intent of the PR.
| # Test with pnpm (fork only) | ||
| rtk pnpm list | ||
|
|
||
| # Test with Vitest (feat/vitest-support branch only) | ||
| rtk vitest run | ||
| ``` |
There was a problem hiding this comment.
INSTALL.md instructs users to run rtk pnpm list / rtk vitest run, but the current CLI doesn’t expose pnpm or vitest subcommands (src/main.rs has no Pnpm/Vitest in enum Commands). This verification section should only reference commands that exist in this repo, or clearly label them as branch-specific and point to the exact branch/commit that provides them.
| git clone https://github.com/FlorianBruniaux/rtk.git | ||
| cd rtk | ||
|
|
||
| # Check branch (should be master or feat/vitest-support) |
There was a problem hiding this comment.
This step hardcodes the default branch as master for the fork. In this repository the primary branch appears to be main (and forks may vary), so instructing “should be master” is likely to be wrong and confusing. Consider changing this to “ensure you’re on the default branch (e.g. main)” and only mention feat/vitest-support when explicitly needed.
| # Check branch (should be master or feat/vitest-support) | |
| # Check branch (ensure you're on the default branch, e.g. `main`, or `feat/vitest-support` when explicitly needed) |
Applies targeted code quality improvements: Issue rtk-ai#5: Reduce clones in HashMap merge - Destructure CcusagePeriod to avoid cloning key - Use .or_insert_with_key() for ccusage data merging - Keep necessary clones for rtk data (HashMap ownership requirement) - Affects: merge_daily, merge_weekly, merge_monthly Issue rtk-ai#7: Replace magic number with named constant - Add const BILLION: f64 = 1e9 - Improves readability in cache token calculation Issue rtk-ai#8: Add NaN/Infinity safety check - Guard format_usd() against invalid float values - Return "$0.00" for non-finite inputs Build: Clean (1 pre-existing warning) Tests: 79/82 passing (3 pre-existing failures) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add installation guide for AI coding assistants
Applies targeted code quality improvements: Issue rtk-ai#5: Reduce clones in HashMap merge - Destructure CcusagePeriod to avoid cloning key - Use .or_insert_with_key() for ccusage data merging - Keep necessary clones for rtk data (HashMap ownership requirement) - Affects: merge_daily, merge_weekly, merge_monthly Issue rtk-ai#7: Replace magic number with named constant - Add const BILLION: f64 = 1e9 - Improves readability in cache token calculation Issue rtk-ai#8: Add NaN/Infinity safety check - Guard format_usd() against invalid float values - Return "$0.00" for non-finite inputs Build: Clean (1 pre-existing warning) Tests: 79/82 passing (3 pre-existing failures) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix misleading correctable count comment in rubocop_cmd.rs to explain the 0-value ambiguity (absent field vs genuinely zero) (issue rtk-ai#8) - Update compact_minitest_failure doc to describe full behavior including message line context (issue rtk-ai#14) - Add JSON-parse-failure fallback mention to rspec_cmd.rs and rubocop_cmd.rs module-level docs (issue rtk-ai#15) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Adds INSTALL.md with comprehensive installation guide optimized for AI coding assistant integration and team collaboration.
Changes
Key Features
1. Mandatory Verification First
rtk --versioncheck before any installation attempt2. Installation Options
3. Troubleshooting Section
4. Production Metrics
Documents validated token savings from production T3 Stack projects:
5. AI Assistant Integration
Provides checklist for AI coding assistants (Claude Code, Cursor, etc.):
rtk initrtk gainUse Cases
Files Changed
INSTALL.md: Comprehensive installation and usage guide (183 lines)