diff --git a/all_repos/find_files.py b/all_repos/find_files.py
index c6826b8..e230264 100644
--- a/all_repos/find_files.py
+++ b/all_repos/find_files.py
@@ -7,6 +7,7 @@ import sys
 from all_repos import cli
 from all_repos import color
 from all_repos.config import load_config
+from all_repos.util import zsplit
 
 
 def ls_files(config, repo):
@@ -15,7 +16,7 @@ def ls_files(config, repo):
         ('git', '-C', path, 'ls-files', '-z'),
         stdout=subprocess.PIPE, check=True,
     )
-    return path, ret.stdout.rstrip(b'\0').split(b'\0')
+    return path, zsplit(ret.stdout)
 
 
 def find_files(config, regex):
diff --git a/all_repos/sed.py b/all_repos/sed.py
new file mode 100644
index 0000000..b6b685d
--- /dev/null
+++ b/all_repos/sed.py
@@ -0,0 +1,69 @@
+import argparse
+import functools
+import os.path
+import shlex
+import subprocess
+
+from all_repos import autofix_lib
+from all_repos import cli
+from all_repos.util import zsplit
+
+
+def find_repos(config, *, ls_files_cmd):
+    for repo in config.get_cloned_repos():
+        repo_dir = os.path.join(config.output_dir, repo)
+        if subprocess.run(
+            ('git', '-C', repo_dir, *ls_files_cmd[1:]),
+            check=True, stdout=subprocess.PIPE,
+        ).stdout:
+            yield repo_dir
+
+
+def apply_fix(*, ls_files_cmd, sed_cmd):
+    filenames = zsplit(subprocess.check_output(ls_files_cmd))
+    filenames = [f.decode() for f in filenames]
+    autofix_lib.run(*sed_cmd, *filenames)
+
+
+def _quote_cmd(cmd):
+    return ' '.join(shlex.quote(arg) for arg in cmd)
+
+
+def main(argv=None):
+    parser = argparse.ArgumentParser()
+    cli.add_fixer_args(parser)
+    parser.add_argument(
+        '-r', '--regexp-extended',
+        action='store_true',
+        help='use extended regular expressions in the script.',
+    )
+    parser.add_argument('--branch-name', default='all-repos-sed')
+    parser.add_argument('--commit-msg')
+    parser.add_argument('pattern')
+    parser.add_argument('filenames_glob', help='(passed to ls-files)')
+    args = parser.parse_args(argv)
+
+    dash_r = ('-r',) if args.regexp_extended else ()
+    sed_cmd = ('sed', '-i', *dash_r, args.pattern)
+    ls_files_cmd = ('git', 'ls-files', '-z', '--', args.filenames_glob)
+
+    msg = f'{_quote_cmd(ls_files_cmd)} | xargs -0 {_quote_cmd(sed_cmd)}'
+    msg = args.commit_msg or msg
+
+    repos, config, commit, autofix_settings = autofix_lib.from_cli(
+        args,
+        find_repos=functools.partial(find_repos, ls_files_cmd=ls_files_cmd),
+        msg=msg, branch_name=args.branch_name,
+    )
+
+    autofix_lib.fix(
+        repos,
+        apply_fix=functools.partial(
+            apply_fix, ls_files_cmd=ls_files_cmd, sed_cmd=sed_cmd,
+        ),
+        config=config, commit=commit, autofix_settings=autofix_settings,
+    )
+
+
+if __name__ == '__main__':
+    exit(main())
diff --git a/all_repos/util.py b/all_repos/util.py
new file mode 100644
index 0000000..a689acb
--- /dev/null
+++ b/all_repos/util.py
@@ -0,0 +1,5 @@
+def zsplit(bs):
+    if bs:
+        return bs.rstrip(b'\0').split(b'\0')
+    else:
+        return []
diff --git a/setup.py b/setup.py
index 5b79eb7..51c20ae 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,7 @@ setup(
             'all-repos-clone=all_repos.clone:main',
             'all-repos-find-files=all_repos.find_files:main',
             'all-repos-grep=all_repos.grep:main',
+            'all-repos-sed=all_repos.sed:main',
         ],
     },
 )

Make an `all-repos-sed`
Sometimes I don't want to write the full gamut of a fixer and such and really just want some nice `sed -i`.

I think the interface would be something like:

```
$ all-repos-sed 's/foo/bar/g' -- baz.f
```

And this tool would make a fixer which does essentially (for each repository):

```
git ls-files -- baz.f | xargs sed -i 's/foo/bar/g'
```
diff --git a/tests/sed_test.py b/tests/sed_test.py
new file mode 100644
index 0000000..bee579c
--- /dev/null
+++ b/tests/sed_test.py
@@ -0,0 +1,25 @@
+from all_repos import clone
+from all_repos.sed import main
+from testing.git import write_file_commit
+
+
+def test_main(file_config_files):
+    clone.main(('--config-filename', str(file_config_files.cfg)))
+    assert not main((
+        '--config-filename', str(file_config_files.cfg),
+        's/HAI/BAI/g', '*',
+    ))
+    assert file_config_files.dir1.join('f').read() == 'OBAI\n'
+    assert file_config_files.dir2.join('f').read() == 'OHELLO\n'
+
+
+def test_main_custom_file_pattern(file_config_files):
+    write_file_commit(file_config_files.dir1, 'g', 'OHAI\n')
+    clone.main(('--config-filename', str(file_config_files.cfg)))
+    assert not main((
+        '--config-filename', str(file_config_files.cfg),
+        's/AI/IE/g', 'g',
+    ))
+    assert file_config_files.dir1.join('f').read() == 'OHAI\n'
+    assert file_config_files.dir1.join('g').read() == 'OHIE\n'
+    assert file_config_files.dir2.join('f').read() == 'OHELLO\n'
diff --git a/tests/util_test.py b/tests/util_test.py
new file mode 100644
index 0000000..474efb8
--- /dev/null
+++ b/tests/util_test.py
@@ -0,0 +1,15 @@
+import pytest
+
+from all_repos.util import zsplit
+
+
+@pytest.mark.parametrize(
+    ('bs', 'expected'),
+    (
+        (b'', []),
+        (b'\0', [b'']),
+        (b'a\0b\0', [b'a', b'b']),
+    ),
+)
+def test_zsplit(bs, expected):
+    assert zsplit(bs) == expected

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-env
apt-get update apt-get install -y gcc
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/asottile/all-repos.git@0c1622739a951e5904debb622386e0840c751164#egg=all_repos
certifi==2025.1.31
cfgv==3.4.0
charset-normalizer==3.4.1
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.18.0
flake8==7.2.0
identify==2.6.9
idna==3.10
iniconfig==2.1.0
mccabe==0.7.0
nodeenv==1.9.1
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pre_commit==4.2.0
pycodestyle==2.13.0
pyflakes==3.3.2
pytest==8.3.5
pytest-env==1.1.5
PyYAML==6.0.2
requests==2.32.3
tomli==2.2.1
urllib3==2.3.0
virtualenv==20.29.3

name: all-repos
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - cfgv==3.4.0
      - charset-normalizer==3.4.1
      - coverage==7.8.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==7.2.0
      - identify==2.6.9
      - idna==3.10
      - iniconfig==2.1.0
      - mccabe==0.7.0
      - nodeenv==1.9.1
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pre-commit==4.2.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pytest==8.3.5
      - pytest-env==1.1.5
      - pyyaml==6.0.2
      - requests==2.32.3
      - tomli==2.2.1
      - urllib3==2.3.0
      - virtualenv==20.29.3
prefix: /opt/conda/envs/all-repos

tests/sed_test.py::test_main tests/sed_test.py::test_main_custom_file_pattern tests/util_test.py::test_zsplit[-expected0] tests/util_test.py::test_zsplit[\x00-expected1] tests/util_test.py::test_zsplit[a\x00b\x00-expected2]
setup.py all_repos/find_files.py all_repos/sed.py all_repos/util.py
setup.py all_repos/find_files.py all_repos/sed.py all_repos/util.py