Backed by mandō

Transform text.
At stream speed.

Rewrite is the stream transformation engine that rewrites any text, in any pipeline, at any scale. Regex-powered pattern matching meets in-place mutation — the primitive that every CI/CD pipeline, data workflow, and config system secretly depends on.

See it live
rewrite
$ echo "Hello World" | rewrite 's/World/Universe/'
Hello Universe
$ rewrite -i 's/http:/https:/g' config.yml
# config.yml mutated in-place ✓
$ rewrite -E 's/v[0-9]+\.[0-9]+/v2.0/g' CHANGELOG.md
# 47 substitutions applied
$

Shipped by teams at

Vercel
GitHub
Cloudflare
Linear
Stripe
Docker
Datadog
CircleCI

Every substitution primitive.
One composable engine.

We took the most powerful text transformation tool ever built and gave it a platform. Eight core features. Zero compromises.

SubstEngine™ s///

The crown jewel. Match any regular expression against the pattern space and replace it with surgical precision. Supports backreferences (\1–\9), the full match operator (&), and flags that give you total control over every transformation.

📝

InPlace™ -i

Edit files directly on disk. No temp files, no redirects, no copy-and-pray. InPlace™ mutates your files atomically with optional backup suffix — the write-back primitive that every deployment script depends on.

🔗

ChainExec™ -e

Stack multiple transformation expressions in a single invocation. ChainExec™ composes operations sequentially — each expression receives the output of the previous — enabling arbitrary pipeline depth without subshells.

📄

ScriptFile™ -f

Store complex transformation logic in dedicated script files. Version them, review them, deploy them. ScriptFile™ turns ad-hoc one-liners into reproducible, auditable transformation artifacts.

🔮

ExtendedRegex™ -E

Unlock extended regular expressions — grouping, alternation, quantifiers (+, ?, {n,m}) — without the backslash tax. ExtendedRegex™ is the POSIX-compliant power mode that makes complex patterns actually readable.

🌐

GlobalReplace™ g flag

Apply substitutions to every match on every line — not just the first. GlobalReplace™ is the difference between "fixed one thing" and "fixed everything." The flag that turns spot-fixes into fleet-wide migrations.

🧠

HoldSpace™ h/H/g/G/x

A secondary buffer for multi-line transformations, look-aheads, and state accumulation. Copy, append, and exchange between pattern and hold space — the memory model that makes Rewrite Turing-complete.

🎯

AddressRange™ addr1,addr2

Target transformations by line number, regex match, or inclusive range. AddressRange™ restricts operations to exactly the lines that matter — surgical precision at stream scale.

Stream in. Transform. Stream out.

01

Feed the stream

Pipe any input — files, stdin, command output — into the Rewrite engine. Each line enters the pattern space individually, ready for transformation.

02

Match & transform

Your expressions execute against each line. Substitute patterns, delete matches, append text, branch conditionally. The full command set processes in sequence.

03

Control the flow

Use addresses to scope operations. Use hold space for multi-line context. Use branching (b/t) for conditional logic. One pass, infinite possibilities.

04

Emit or mutate

Results stream to stdout by default — or write back in-place with -i. Zero intermediate files. Zero temp directories. The transformation is the deployment.

0
Substitutions per day
0
Avg. transformation latency
0
Pattern match accuracy
0
Over the input. Always.

Scale your transformations.

From single substitutions to fleet-wide in-place rewrites. Pick the tier that matches your mutation velocity.

Starter

Free

For individual developers exploring stream transforms.

  • Basic s/pattern/replacement/
  • Single -e expression
  • Line-number addressing
  • p and d commands
  • Community support

Pro

$29/mo

For teams running production pipelines.

  • Everything in Starter
  • Global flag (g)
  • In-place editing (-i)
  • Multiple -e chains
  • Extended regex (-E)
  • Regex address ranges

Enterprise

Custom

For organizations with compliance requirements.

  • Everything in Team
  • Sandbox mode (--sandbox)
  • Null-separated mode (-z)
  • Debug annotations (--debug)
  • Quiet mode (-n) SLA
  • SSO & audit logging
  • Dedicated support engineer

Trusted by engineers who ship.

"We replaced a 200-line Python script with a single Rewrite expression. The s/pattern/replacement/g primitive is genuinely all you need for 90% of text processing. This is infra-level engineering."

K
Kira Tanaka
Staff SRE, Lattice

"InPlace™ changed our deployment workflow. We went from 'copy file, transform, move back' to a single atomic operation. The -i flag with backup suffix is genuinely the best rollback story I've seen."

M
Marcus Olivetti
Platform Lead, Render

"The hold space is the most underrated state management primitive in computing. We use HoldSpace™ to do multi-line JSON transforms in CI that would take 10x longer in any other tool. Rewrite is cracked."

S
Sophie Nguyen
DevTools Engineer, Retool

"We run Rewrite in every single GitHub Actions workflow. ExtendedRegex™ means our patterns are actually readable in code review. The ChainExec™ pipeline model is just *chef's kiss*."

D
Dev Patel
Engineering Manager, Fly.io

"I tried to explain to my CTO that we depend on a single stream editor for our entire config management pipeline. He asked what our bus factor was. I said 'zero — it's Rewrite. It doesn't break.'"

A
Ana Kowalski
Senior Backend, Railway

See Rewrite transform in real time.

Real commands, real output. Click a transformation to see it execute.

rewrite demo
BEFORE
AFTER

Why teams switch to Rewrite.

Capability Rewrite Manual regex scripts Find & Replace (IDE)
In-place file editing ✓ Atomic with backup Temp files required Manual save
Pipeline composability ✓ Native stdin/stdout Partial
Multi-expression chains ✓ Unlimited -e Script-dependent One at a time
Address-scoped transforms ✓ Line + regex ranges Custom loops
Hold space / state ✓ Built-in Manual variables
Single-pass performance ✓ Always Implementation varies File-scan each time

How Meridian reduced config migration time by 94%

Meridian, a fintech platform serving 2M+ accounts, needed to migrate 4,800 YAML configuration files from legacy key formats to a new schema — across 12 microservices, 3 environments, with zero downtime.

Their DevOps team initially estimated 3 weeks of manual scripting. With Rewrite, they wrote a single -f script file containing 14 chained substitutions with address ranges and backreferences, then applied it fleet-wide with -i.bak for atomic rollback.

4,800 files transformed
14 chained expressions
3.2s total execution time
0 rollbacks needed

What's new in Rewrite.

v4.9

Sandbox mode

New --sandbox flag disables e, r, and w commands for secure execution in untrusted pipelines. Enterprise-grade isolation.

v4.8

Debug annotations

--debug annotates program execution with step-by-step trace output. Finally see exactly what your expressions are doing at each cycle.

v4.7

Null-separated input

-z / --null-data separates lines by NUL characters instead of newlines. Process binary-safe content and handle filenames with embedded newlines.

Answers to real questions.

The g flag applies a single substitution to every match on a line. Multiple -e expressions apply different transformations sequentially to each line. Use g when you want to replace all occurrences of one pattern; use -e chains when you need different transformations in sequence.

Yes. InPlace™ editing with -i.bak creates an automatic backup before any mutation. Combined with --sandbox mode for untrusted inputs, Rewrite is the safest stream editor available for production use. Thousands of teams run it in CI/CD with zero incident rate.

The hold space is a secondary buffer that persists across line cycles. Use it to accumulate lines (H), swap context (x), or implement multi-line pattern matching. It's what makes Rewrite capable of transformations that go beyond single-line substitution — join lines, reorder blocks, implement look-ahead.

Use the N command to append the next line to the pattern space (separated by \n), then apply multi-line-aware patterns. Combined with P and D for partial print/delete, you get full multi-line transformation capability in a single pass.

Yes. The b command branches to a label unconditionally, while t branches only if the last s/// succeeded. Combined with address ranges and negation (!), you have a complete control-flow system within the stream editor.

Start transforming.

Join 12,000+ engineers who rely on Rewrite for every pipeline, every deploy, every migration.

No credit card. No sales call. Just stream transformations.

See mandō's portfolio

The accelerator behind the tools that run the internet.