Commit Graph

80 Commits

Author SHA1 Message Date
github-actions[bot] 3dde699240 chore(master): release 0.12.0 2026-02-09 02:00:59 +00:00
github-actions[bot] 22182e48d2 chore(master): release 0.11.0 2026-02-07 22:13:14 +00:00
patrick szymkowiak a3814fc3d3 Merge branch 'master' into feat/auto-patch-settings-json 2026-02-07 23:12:50 +01:00
github-actions[bot] 109f5d66db chore(master): release 0.10.0 2026-02-07 16:01:00 +00:00
Florian BRUNIAUX 848a63dfac feat(init): auto-patch settings.json for frictionless hook installation
## Summary

Eliminates manual settings.json setup friction by automating hook
registration with safety (backup, atomic writes, idempotency).

## Changes

### Core Features
- **Auto-patch**: Default `rtk init -g` prompts to patch settings.json [y/N]
- **CLI flags**: `--auto-patch` (no prompt), `--no-patch` (manual), `--uninstall` (full cleanup)
- **Safety**: Automatic backup to `settings.json.bak` before modification
- **Idempotency**: Detects existing hook, skips modification
- **Status check**: `rtk init --show` now displays settings.json registration

### Implementation
- New types: `PatchMode` (Ask/Auto/Skip), `PatchResult` (tracking outcomes)
- New functions in `src/init.rs`:
  - `hook_already_present()` - Detects RTK hook via substring match
  - `insert_hook_entry()` - Deep-merges hook using idiomatic `entry()` API
  - `atomic_write()` - Crash-safe writes with tempfile
  - `patch_settings_json()` - Main orchestrator
  - `uninstall()` - Complete cleanup (hook, RTK.md, settings.json)
- Modified functions: `run()`, `run_default_mode()`, `run_hook_only_mode()`, `show_config()`

### Code Quality Improvements
- Refactored `insert_hook_entry()` to use Rust `entry()` API (no manual unwraps)
- Simplified `hook_already_present()` with iterator chains (3x shorter)
- Improved error messages with file paths and actionable hints
- Fixed string allocation (to_str() vs to_string())

### Dependencies
- Added `preserve_order` feature to `serde_json` (key order preservation)
- Moved `tempfile` to production dependencies (atomic writes)

### Documentation
- **README.md**: Updated Quick Install, added Installation Flags, Uninstalling, Troubleshooting, What Are Hooks sections
- **INSTALL.md**: Updated Recommended Setup, added Common User Flows, Uninstalling sections
- **CHANGELOG.md**: Documented new feature under Unreleased

### Testing
- 11 new unit tests for hook detection, insertion, atomic writes, cleanup
- All 249 tests passing
- Smoke tested: install, idempotency, show, uninstall

## User Impact

**Before**: Users had to manually copy JSON snippet to settings.json
**After**: Single command with prompt, automatic backup, clean uninstall

## Breaking Changes

None. Backwards compatible - manual setup still works via `--no-patch`.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 16:12:40 +01:00
github-actions[bot] 0cd8d6ea95 chore(master): release 0.9.4 2026-02-06 19:15:05 +00:00
github-actions[bot] c072201629 chore(master): release 0.9.3 2026-02-06 13:36:27 +00:00
github-actions[bot] 459538c7a2 chore(master): release 0.9.2 2026-02-05 16:13:22 +00:00
github-actions[bot] 8c638e3782 chore(master): release 0.9.1 2026-02-04 17:24:08 +00:00
github-actions[bot] ca53553501 chore(master): release 0.9.0 2026-02-03 16:12:12 +00:00
github-actions[bot] 5eb65f61d7 chore(master): release 0.8.1 2026-02-02 15:48:14 +00:00
github-actions[bot] 92a3333d10 chore(master): release 0.8.0 2026-02-02 13:32:50 +00:00
Florian BRUNIAUX cb71237b80 docs: document execution time tracking feature in v0.7.1
Add comprehensive documentation for the execution time tracking feature
introduced in upstream v0.7.1:

- CHANGELOG.md: Add v0.7.1 entry with execution time tracking feature
- CHANGELOG.md: Document parser infrastructure and migrations
- README.md: Update rtk gain analytics section with time metrics
- ARCHITECTURE.md: Add exec_time_ms column to database schema
- ARCHITECTURE.md: Update INSERT statement with exec_time_ms
- ARCHITECTURE.md: Update REPORTING example with time metrics

The feature tracks command execution duration with <0.1ms overhead
and displays total/average execution time in rtk gain output.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 10:44:34 +01:00
Florian BRUNIAUX edab4e142e feat: add parser infrastructure with three-tier fallback system
Implement Phase 3 of maintainability plan - unified parser architecture:

**Core Components:**
- parser/mod.rs: OutputParser trait + ParseResult enum (Full/Degraded/Passthrough)
- parser/error.rs: ParseError types with thiserror (JSON, Pattern, Partial, etc.)
- parser/types.rs: Canonical types (TestResult, LintResult, DependencyState, BuildOutput)
- parser/formatter.rs: TokenFormatter trait with Compact/Verbose/Ultra modes
- parser/README.md: Complete usage guide and migration examples

**Three-Tier Fallback System:**
1. Tier 1 (Full): Complete JSON parsing with structured data
2. Tier 2 (Degraded): Partial regex extraction with warnings
3. Tier 3 (Passthrough): Truncated raw output with [RTK:PASSTHROUGH] marker

**Benefits:**
- Never returns false data silently (fixes prisma_cmd issue)
- Graceful degradation on tool version changes
- Unified interface across all tool types
- Observable degradation with [RTK:DEGRADED] warnings
- Foundation for Phase 4 module migrations

**Dependencies:**
- Added thiserror 1.0 for structured error types

**Testing:**
- 3 unit tests for ParseResult tier system
- Tests pass: tier(), is_ok(), map(), warnings()

Next: Phase 4 - Migrate existing modules to use parser trait

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:43:19 +01:00
github-actions[bot] c04fe839b8 chore(master): release 0.7.0 2026-02-01 19:07:31 +00:00
github-actions[bot] 669f1d5801 chore(master): release 0.6.0 2026-02-01 10:58:18 +00:00
github-actions[bot] 038af6f648 chore(master): release 0.5.2 2026-01-30 15:49:54 +00:00
github-actions[bot] c30f3a151e chore(master): release 0.5.1 2026-01-30 14:32:41 +00:00
github-actions[bot] 3475992c14 chore(master): release 0.5.0 2026-01-30 13:15:53 +00:00
github-actions[bot] cf8ddcbe6e chore(master): release 0.4.0 2026-01-30 10:37:17 +00:00
github-actions[bot] 6781f2112b chore(master): release 0.3.1 2026-01-29 16:51:43 +00:00
github-actions[bot] 378e5bc2ff chore(master): release 0.3.0 2026-01-29 16:05:41 +00:00
Patrick szymkowiak d30b3e2fd0 correcting ls bug
adding benchmark script for local performance monitoring in dev
2026-01-28 23:03:36 +01:00
Florian BRUNIAUX 681729d205 feat: add pnpm support (list, outdated, install)
Adds ultra-compact output for pnpm commands to support modern
JavaScript stacks (T3 Stack, Turborepo, Nx).

Commands added:
- rtk pnpm list --depth=0 (filter box-drawing, keep packages)
- rtk pnpm outdated (extract upgrades: "pkg: old → new")
- rtk pnpm install <pkg> (filter progress bars, keep summary)

Implementation:
- New module: src/pnpm_cmd.rs
- Filters: box-drawing chars, legend, metadata, progress bars
- Output format: "package: current → latest" for upgrades
- Testing: Verified on production T3 Stack codebase (Méthode Aristote)

Market impact:
- pnpm = 40% of npm downloads (rising rapidly)
- T3 Stack = dominant Next.js starter
- Reduction: 80-90% for outdated, ~70% for list (depth >0)

Related: Issue #3

Test cases verified:
- rtk pnpm list --depth=0 ✓
- rtk pnpm outdated ✓ (shows "All packages up-to-date ✓")
- Unit tests for filter functions ✓

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 14:55:19 +01:00
Patrick szymkowiak f8c9a8165f feat: add SQLite tracking, gain command, and CI/CD
- Add SQLite tracking for all commands (90-day history)
- Add rtk gain command with ASCII graph visualization
- Add config.rs for TOML configuration support
- Integrate tracking in all command modules
- Add CI/CD workflow for multi-platform releases (deb, rpm, win, mac)
- Add LICENSE file and improve .gitignore
2026-01-23 14:02:10 +01:00
Patrick szymkowiak ed9a0c5c57 v0.1.7: Add git add/commit/push/pull + grep with minimal output 2026-01-23 07:27:35 +01:00
Patrick szymkowiak 0eed484994 v0.5.0: Add rtk init command for CLAUDE.md setup
New command:
- rtk init          # Add rtk instructions to local ./CLAUDE.md
- rtk init --global # Add rtk instructions to global ~/CLAUDE.md
- rtk init --show   # Show current rtk configuration
Total: 16 commands
2026-01-22 21:03:54 +01:00
Patrick szymkowiak a0128e38cd v0.3.0: Add 6 new token-saving commands
New commands:
- rtk git (diff/log/status) - Compact git output
- rtk test <cmd> - Run tests, show only failures
- rtk err <cmd> - Run command, filter errors/warnings
- rtk json <file> - Show JSON structure without values
- rtk deps - Summarize project dependencies
- rtk env - Filtered environment variables (masks secrets)
2026-01-22 20:19:54 +01:00
Patrick szymkowiak 2f2e2bfaeb v0.2.0: Replace LLM with fast heuristic analyzer
- Remove candle, tokenizers, hf-hub dependencies (50MB -> 1.8MB binary)
- rtk smart now uses regex-based code analysis (instant, no token needed)
- Detects: imports, functions, structs, traits, design patterns
- Compile time: 1m30s -> 16s
2026-01-22 18:15:34 +01:00
Patrick szymkowiak daab79cca4 Initial commit: rtk (Rust Token Killer) v0.1.0
High-performance CLI proxy to minimize LLM token consumption:
- rtk ls: Token-optimized directory tree (filters .git, node_modules, etc.)
- rtk read: Intelligent code filtering (minimal/aggressive modes)
- rtk smart: Local LLM summaries via candle-core (Llama-3.2-1B)
Includes CI/CD (GitHub Actions), Homebrew formula, and install script.
2026-01-22 18:10:30 +01:00