NAME

codefork - Worlds dumbest code forker

VERSION

version 1.000

SYNOPSIS

# Preview changes as unified diff (default config: fork.conf)
codefork

# Preview with a different config file
codefork other.conf

# Apply changes to disk
codefork apply
codefork apply other.conf

# Save diff to a file (e.g. for review or patch(1))
codefork output patch.diff
codefork output other.conf patch.diff

# Enable debug output
CODEFORK_DEBUG=1 codefork

DESCRIPTION

codefork performs systematic text replacements across an entire directory tree, modifying both filenames and file contents. It is intended for forking a codebase by renaming a project, module, or namespace throughout.

By default, codefork does not modify any files. It shows a unified diff of what would change, so you can review before committing to the changes. Use the apply command to actually write changes to disk, or output to save the diff to a file for use with patch(1).

The default config file is fork.conf in the current directory.

COMMANDS

codefork [config]

Show a unified diff of all changes that would be made. This is the default action and is completely safe — nothing is modified on disk.

codefork apply [config]

Apply all changes to files in the current directory tree. Filenames are renamed and file contents are modified in place.

codefork output [config] filename

Write the unified diff to filename instead of printing it. The output is compatible with patch -p1.

CONFIG FORMAT

The config file contains one replacement rule per line:

from|to

Regex replacement: applies s/from/to/g to filenames and file contents.

from%to

Word-boundary replacement: only replaces from when surrounded by non-alphanumeric characters, preventing partial matches inside longer words.

Lines without a | or % separator are ignored.

Example config:

HomeHive|AqHive
homehive|aqhive
hh%ah

UPGRADE NOTICE

The command-line interface changed in version 1.000.

The old --config, --dir, and --debug flags are no longer supported. Use positional commands instead:

# Old (no longer works):
codefork --config fork.conf
codefork --config fork.conf --debug

# New:
codefork fork.conf
CODEFORK_DEBUG=1 codefork fork.conf

ENVIRONMENT

CODEFORK_DEBUG

Set to a true value to enable verbose debug output to STDERR.

SUPPORT

Repository

L<https://github.com/Getty/p5-app-codefork>
Pull request and additional contributors are welcome

Issue Tracker

L<https://github.com/Getty/p5-app-codefork/issues>

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-app-codefork/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.