Skip to content
Mikhail Deynekin edited this page Oct 12, 2026 · 4 revisions

sr — главная

sr 7.0.1 — безопасная и аудируемая замена текста по дереву проекта.

sr переписывает текст во множестве файлов и ведёт журнал каждого изменения, поэтому любой прогон можно просмотреть, снять диффом и отменить.

Быстрый вход

sr find "old_api" -p '*.py'                 # где встречается
sr diff "old_api" "new_api" -p '*.py'       # что именно изменится
sr replace "old_api" "new_api" -p '*.py'    # сделать (создаёт сессию отката)
sr rollback                                 # отменить последний прогон

Переход с 6.x

Командная строка 6.x не принимается. Соответствие флаг-в-флаг: sr help compat или docs/MIGRATION-6-to-7.md в репозитории. Файл sr.sh (реализация 6.1.0) сохранён в корне, чтобы sr --rollback против каталогов sr.backup.* работал.

Темы справки

sr help topics — everything the manual covers

intro Purpose and design rules quickstart Five steps from preview to rollback install Every installation method, verified commands All subcommands with their usage line options Every option, grouped, with defaults and env vars matching Literal vs regex/ERE/PCRE, ranges, counts targets Globs, exclusions, .gitignore, filters backup What is stored, where, and for how long rollback Undoing a run, drift detection, undoing a rollback sessions Listing, inspecting and pruning the audit trail rename Bulk file renaming with collision detection interactive Per-hunk confirmation json The --json document, exit codes, CI recipes env Every SR_* variable config Precedence, syntax, templates update How updates are fetched, verified and installed shell Completion, aliases, pager, pipes exit-codes The frozen exit-code contract performance Where the time goes and how to cut it troubleshooting Symptom → cause → fix examples Ready-to-run command lines recipes Complete workflows for common jobs architecture Module map and data flow development Building, testing and releasing sr security Guards, update chain, data handling compat From sr 6.x (bash) to sr 7 license MIT license text

Also: sr help <command> and sr help --<option>.


Страница сгенерирована из встроенной справки sr 7.0.1 (sr help <topic>). Первоисточник — sr/help_system.py; он же питает man sr и sr help --all. Если страница и вывод sr help расходятся, верить нужно sr help: он всегда соответствует установленной версии.

Clone this wiki locally