whatisgithub

What is repren?

jlevy/repren — explained in plain English

Analysis updated 2026-05-18

371PythonAudience · developerComplexity · 1/5Setup · easy

In one sentence

A command-line tool that renames files and rewrites their contents at the same time using simultaneous, undo-safe search-and-replace.

Mindmap

mindmap
  root((repren))
    What it does
      Bulk find and replace
      Rename files
      Swap names safely
    Tech stack
      Python
      CLI
    Use cases
      Refactor identifiers
      Rename across a codebase
      Undo with backups
    Audience
      Developers
      AI coding agents

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Swap two names everywhere at once, like renaming foo to bar and bar to foo.

USE CASE 2

Rename an identifier across a codebase in all its casing styles automatically.

USE CASE 3

Preview changes safely with dry-run mode before writing anything.

USE CASE 4

Undo a bulk rename using the automatic .orig backup files.

What is it built with?

PythonCLI

How does it compare?

jlevy/reprenavaturn-live/avtr-1juyterman1000/entroly
Stars371362382
LanguagePythonPythonPython
Setup difficultyeasyhardeasy
Complexity1/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Single Python file with no dependencies, runs directly with uvx repren, no install needed.

So what is it?

repren is a command-line tool for bulk text replacement and file renaming. You give it one or more search-and-replace patterns, point it at files or directories, and it rewrites file contents and renames files at the same time in a single pass. The feature that sets it apart from tools like sed is that all substitutions happen simultaneously. This means you can swap two names at once, for example renaming every occurrence of foo to bar while also renaming every occurrence of bar to foo, without needing a temporary intermediate step. It also handles filename renaming, not just file contents, and can recurse through entire directory trees. A case-preserving mode lets you rename an identifier in all its common forms at once. If you rename user_name to account_id, the tool automatically also renames userName to accountId, UserName to AccountId, and USER_NAME to ACCOUNT_ID. This is useful when renaming variables across a codebase that mixes coding conventions. For safety, repren defaults to a dry-run mode that shows what would change without writing anything. When you run it for real, it saves .orig backup copies of every modified file. If you realize you made a mistake, you can run it again with the --undo flag to restore everything from those backups. When you are satisfied, a separate --clean-backups command removes the backups. The tool is a single Python file with no external dependencies, requiring only Python 3.10 or later. It can be run directly with uvx repren without installing anything. It also includes a built-in skill file for AI coding tools like Claude Code, so an agent can install it and use it as part of a refactoring workflow. Output can be formatted as JSON for easier parsing by scripts or agents.

Copy-paste prompts

Prompt 1
Show me the repren command to rename user_name to account_id across all its casing forms.
Prompt 2
How do I run repren in dry-run mode to preview changes before applying them?
Prompt 3
Explain how to undo a repren rename using the --undo flag.
Prompt 4
How can an AI coding agent use repren's skill file for a refactoring task?

Frequently asked questions

What is repren?

A command-line tool that renames files and rewrites their contents at the same time using simultaneous, undo-safe search-and-replace.

What language is repren written in?

Mainly Python. The stack also includes Python, CLI.

How hard is repren to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is repren for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.