# facebookarchive/codemod

Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.

Repository: https://github.com/facebookarchive/codemod
Canonical: https://ross.abutalabs.com/products/codemod
Language: Python
License: Apache-2.0
License Family: permissive
Archived: true
Last push: 2020-11-28T11:33:52+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 6362, "days_push": 2104, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4133, forks 197 (observed 2026-08-28T04:08:36.131094+00:00)

## What it is
Codemod is a Python tool and library from Facebook for assisting large-scale codebase refactors that are partially automated but need human oversight. It interactively shows diffs for regex-based replacements across many files, letting users accept, reject, or edit each change.

## Use cases
- interactively refactor a large codebase with regex replacements
- review and approve each automated code change via a diff
- deprecate an API or tag across hundreds of files
- split a bulk code-editing task across a team with start/end offsets
- count occurrences of a pattern before refactoring
- edit matched lines in my editor during a bulk rename

## When to choose
- you need human review on each automated replacement across many files
- you want a lightweight Python CLI without learning a full codemod framework
- you need to pause, resume, or divide refactoring work by file position

## When to avoid
- you need AST-aware, language-specific transformations (use jscodeshift or a language codemod framework)
- you want fully automated, unattended bulk edits
- you need an actively maintained tool (the repo is archived)

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: developer-tools, cli, parser
- domain: developer-tools
- platform: python, cli, cross-platform
- tags: code-refactoring, interactive-editing, regex-replacement, facebook, archived, command-line, automation

## Member repositories
- facebookarchive/codemod (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:36.131094+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:23:02.450949+00:00, confidence not recorded.
  - readme: https://github.com/facebookarchive/codemod (fetched 2026-08-28T04:08:36.131094+00:00, sha a6ad216b9a9d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
