A versatile tool to bulk edit names and years in license files across all your GitHub repositories or those within a specific organization. Available as both a Command Line Interface (CLI) and a Web-based Interface.
- Dual Mode: Choose between a terminal-based CLI or a user-friendly browser interface.
- Bulk Processing: Automatically iterates through all repositories accessible by your GitHub Personal Access Token.
- Organization Support: Optionally target a specific GitHub organization.
- Smart Discovery: Automatically detects common license file names:
LICENSE,LICENSE.md,LICENSE.txt, etc. - Advanced Filtering: Filter repositories by name, stars, license, default branch, or size.
- Sorting: Sort repositories by name, stars, last updated, or size.
- Regex Replacement: Uses regular expressions for flexible and powerful text replacement.
- Change License: Switch between different license templates (MIT, Apache, etc.) or use a custom template.
- License Detection: Automatically detects existing licenses and warns if they differ from the intended change.
- Integrity Check: Verifies if the existing license text is a standard version of the declared license or if it has been modified.
- UTF-8 Support: Properly handles special characters in license files.
To use this tool, you need a GitHub Personal Access Token (PAT):
- Go to your GitHub Token Settings.
- Generate a new token (classic or fine-grained).
- Required Scopes:
repo(Full control of private and public repositories).
Follow these steps to set up the project locally:
- Clone the repository:
git clone https://github.com/DisabledAbel/RepoLicenseEditor.git- Navigate to the project directory:
cd RepoLicenseEditor- Install the required dependencies:
npm installYou can provide your token via the --token flag, or set a GITHUB_TOKEN environment variable.
Using a .env file:
Create a .env file in the root directory:
GITHUB_TOKEN=ghp_your_token_here
Update the year from 2023 to 2024:
node index.js --old-year 2023 --new-year 2024Update both Name and Year for an Organization:
node index.js --org my-org --old-year 2023 --new-year 2024 --old-name "Original Author" --new-name "New Author"Change the license to MIT and set the year/name:
node index.js --license mit --new-year 2024 --new-name "Jane Smith"| Option | Shorthand | Description |
|---|---|---|
--token |
-t |
GitHub Personal Access Token |
--org |
-o |
GitHub organization name |
--old-year |
The year to be replaced (for text replacement) | |
--new-year |
The new year | |
--old-name |
The name to be replaced (for text replacement) | |
--new-name |
The new name | |
--license |
-l |
The license template to use (e.g., mit, apache-2.0) |
--custom-license |
Path to a custom license template file | |
--min-stars |
Filter repositories with at least this many stars | |
--branch |
Filter repositories by default branch name | |
--current-license |
Filter repositories by their current license spdx_id | |
--verify |
Verify license integrity without making changes | |
--repos |
-r |
Comma-separated list of repository names to process |
--help |
-h |
Display help for command |
This project is licensed under the GNU General Public License v3.0