Tags: rammie/rsh
Tags
Use BRE regex flavor in sed builtin to match GNU sed behavior Adds a BRE-to-ERE translator so that regex address patterns behave like GNU sed: bare parens/braces/pipes are literal, escaped versions are metacharacters. Fixes `/^);/p` being rejected as "unopened group" and `/function()/p` not matching literal parens. Bumps version to 0.1.2. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add MCP stdio server and --install claude for native Claude Code inte… …gration rsh can now run as an MCP server (`rsh --mcp`), exposing a single `rsh` tool over JSON-RPC 2.0 stdio transport. This lets Claude Code use rsh directly as a tool without wrapping it in bash. `rsh --install claude` writes/merges .mcp.json at the project root to register the server. New files: src/mcp.rs, src/install.rs, tests/mcp_tests.rs (17 tests). Refactors: extracted parse_and_execute(), resolve_working_dir(), and prime_text() as shared helpers to eliminate duplication between CLI and MCP code paths. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Strip LD_PRELOAD/DYLD vars in --inherit-env, add substitution depth g… …uard Security hardening from audit: - Strip LD_PRELOAD, LD_LIBRARY_PATH, LD_AUDIT, DYLD_INSERT_LIBRARIES, DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH even in --inherit-env mode to prevent arbitrary code injection via dynamic linker - Add substitution depth cap (16) in both validator and executor to prevent stack overflow from deeply nested $(...) (DoS) - Return error for arithmetic expansion $((...)) instead of silent empty - Add test coverage for sed path traversal, input redirects, compound redirects, and nested command substitution Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Bump version to 0.0.7, fix flaky grep -f test - Bump version from 0.0.6 to 0.0.7 - Fix test_concatenated_flag_relative_path_allowed: Cargo.toml contains version strings (e.g. "0.3") that grep interprets as invalid character ranges when used as a pattern file. Use controlled test files instead. - Update mise.toml tooling Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add --prime claude hook installer and --version flag Adds `rsh --prime claude` to install rsh as a Claude Code SessionStart hook in .claude/settings.local.json, with git root detection, dedup, and preservation of existing settings. Adds --version/-V flag. Bumps edition to 2024 and version to 0.0.6. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add built-in restricted sed for safe line extraction Implement sed as an in-process builtin that only supports -n with address+p (e.g. sed -n '10,20p' file). No sed binary is executed, eliminating the risk of sed's e (execute), w (write), s///e, and -i features. Supports single lines, ranges, $ (last line), multiple expressions via semicolons or -e, multiple files, and stdin pipelines. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Allow safe redirects (2>/dev/null, 2>&1) on non-final pipeline commands Previously, all redirects on non-final pipeline stages were rejected, breaking common patterns like `grep -r pattern . 2>/dev/null | head`. Now only unsafe redirects (file writes) are blocked mid-pipeline while fd duplication and /dev/null writes are allowed anywhere. Also adds xargs alternative example to --prime LLM guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
PreviousNext