{"id":51668594,"url":"https://github.com/uutils/red","last_synced_at":"2026-07-14T22:04:04.618Z","repository":{"id":331695149,"uuid":"1130668803","full_name":"uutils/red","owner":"uutils","description":"An experimental drop-in replacement for GNU sed, written in Rust.","archived":false,"fork":false,"pushed_at":"2026-05-25T09:16:52.000Z","size":222,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-12T06:20:00.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uutils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-08T20:50:05.000Z","updated_at":"2026-07-06T15:56:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/uutils/red","commit_stats":null,"previous_names":["vyavdoshenko/red","uutils/red"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/uutils/red","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uutils","download_url":"https://codeload.github.com/uutils/red/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fred/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35480626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-14T22:04:03.154Z","updated_at":"2026-07-14T22:04:04.613Z","avatar_url":"https://github.com/uutils.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Red - Rust Stream Editor\n\nAn experimental drop-in replacement for GNU sed, written in Rust.\n\n[![Crates.io](https://img.shields.io/crates/v/red-sed.svg)](https://crates.io/crates/red-sed)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Rust](https://img.shields.io/badge/Rust-1.70+-orange.svg?logo=rust)](https://www.rust-lang.org/)\n[![CI](https://github.com/vyavdoshenko/red/actions/workflows/ci.yml/badge.svg)](https://github.com/vyavdoshenko/red/actions/workflows/ci.yml)\n\n---\n\n## About This Project\n\nThis project started as an experiment to understand how far one can go in creating a Rust replacement for GNU sed.\n\n**Functional Compatibility**: As far as I know, `red` currently achieves 100% functional compatibility with GNU sed behavior.\n\n**Performance**: There's still work to be done on the performance front. For performance comparisons and benchmarks, please refer to the [Benchmarking](#benchmarking) section below.\n\n**Documentation**: For usage instructions, please refer to the [GNU sed manual](https://www.gnu.org/software/sed/manual/). Red is designed to work exactly like GNU sed.\n\n---\n\n## Features\n\n- **GNU sed Compatible**: Drop-in replacement for GNU sed\n- **Cross-Platform**: Runs on Linux, macOS, and Windows\n- **SELinux Support**: Preserves SELinux contexts during in-place editing (Linux)\n- **Memory Safe**: Written in Rust\n- **Full Command Support**: All GNU sed commands\n\n---\n\n## Command-Line Options\n\n```\nUsage: red [OPTION]... {SCRIPT} [FILE]...\n       red [OPTION]... -e SCRIPT... -f FILE... [FILE]...\n\nOptions:\n  -n, --quiet, --silent    suppress automatic printing of pattern space\n  -e SCRIPT, --expression=SCRIPT\n                           add the script to the commands to be executed\n  -f FILE, --file=FILE     add the contents of script-file to the commands\n  -i[SUFFIX], --in-place[=SUFFIX]\n                           edit files in place (makes backup if SUFFIX supplied)\n  -r, -E, --regexp-extended\n                           use extended regular expressions\n  -s, --separate           consider files as separate rather than continuous\n  -l N, --line-length=N    specify line-wrap length for 'l' command\n  -u, --unbuffered         load minimal amounts of data and flush output often\n  -z, --null-data          use NUL character as line separator\n      --posix              disable all GNU extensions\n      --follow-symlinks    follow symlinks when processing in place\n      --sandbox            disable e/r/w commands\n      --help               display this help and exit\n      --version            output version information and exit\n```\n\n---\n\n## Architecture\n\nRed uses a two-phase architecture:\n\n1. **Compile Phase**: Parse and validate scripts once\n2. **Execute Phase**: Apply commands to input data\n\nFor detailed documentation, see [ARCHITECTURE.md](ARCHITECTURE.md).\n\n---\n\n## Testing\n\n### Running Tests\n\n```bash\n# Unit tests\ncargo test\n\n# Fetch GNU sed tests (required once)\n./scripts/fetch_gnused_tests.sh\n\n# GNU sed compatibility tests\n./scripts/run_gnused_tests.sh\n\n# Specific test\n./scripts/run_gnused_tests.sh --test-pattern \"help.sh\"\n\n# Fast mode\n./scripts/run_gnused_tests.sh --fast\n```\n\n### Benchmarking\n\nCompare performance with GNU sed:\n\n```bash\n# Install hyperfine\ncargo install hyperfine\n\n# Run benchmarks\n./scripts/benchmark.sh\n\n# Custom runs\nRUNS=50 WARMUP=5 ./scripts/benchmark.sh\n\nRED_BIN=./target/release/red SED_BIN=/usr/bin/sed ./scripts/benchmark.sh\n```\n\n---\n\n## Development\n\n### Building\n\n```bash\n# Debug build\ncargo build\n\n# Release build\ncargo build --release\n\n# Build with SELinux support (Linux only)\ncargo build --release --features selinux\n```\n\n---\n\n## Releases\n\n### Download\n\nPre-built binaries are available on the [Releases](https://github.com/vyavdoshenko/red/releases) page:\n\n| Platform | File | Notes |\n|----------|------|-------|\n| Linux x86_64 | `red-linux-x86_64-musl.tar.gz` | Static binary, works on any Linux |\n| Linux ARM64 | `red-linux-aarch64-musl.tar.gz` | Static binary for ARM64 |\n| Linux x86_64 + SELinux | `red-linux-x86_64-gnu-selinux.tar.gz` | For Fedora, RHEL, CentOS |\n| Linux ARM64 + SELinux | `red-linux-aarch64-gnu-selinux.tar.gz` | ARM64 with SELinux |\n| macOS Intel | `red-darwin-x86_64.tar.gz` | macOS 10.15+ |\n| macOS Apple Silicon | `red-darwin-aarch64.tar.gz` | macOS 11+ (M1/M2/M3) |\n| Windows | `red-windows-x86_64.zip` | Windows 10+ |\n\n### Install\n\n**From crates.io:**\n```bash\ncargo install red-sed\n```\n\n**Linux:**\n```bash\ncurl -LO https://github.com/vyavdoshenko/red/releases/latest/download/red-linux-x86_64-musl.tar.gz\ntar -xzf red-linux-x86_64-musl.tar.gz\nsudo mv red /usr/local/bin/\n```\n\n**macOS:**\n```bash\ncurl -LO https://github.com/vyavdoshenko/red/releases/latest/download/red-darwin-aarch64.tar.gz\ntar -xzf red-darwin-aarch64.tar.gz\nxattr -d com.apple.quarantine red   # Remove Gatekeeper quarantine\nsudo mv red /usr/local/bin/\n```\n\n**Verify:**\n```bash\nred --version\n```\n\n### Creating a Release (Maintainers)\n\n1. Update version in `red/Cargo.toml`\n2. Commit changes\n3. Create and push a tag:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nGitHub Actions will automatically build all platforms and create a release with artifacts.\n\nUse `-` in tag for pre-releases (e.g., `v1.0.0-beta`).\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuutils%2Fred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuutils%2Fred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuutils%2Fred/lists"}