A command-line tool to help you choose the right open-source license for your project, implemented in Zig.
This is a CLI version of repolicense, which guides you through a series of questions to determine the most suitable license for your needs.
- Interactive question-and-answer interface
- Navigate forward and backward through the decision tree
- Reset at any time to start over
- Get detailed information about each license
- Links to GitHub API for license details
- NEW: License compatibility checker for forking projects This feature allows you to input a list of existing licenses and find out which licenses are compatible with all of them when combining code from multiple projects.
- Zig version 0.15.2 or later
zig buildAfter building, run the executable:
./zig-out/bin/repolicenseOr build and run in one command:
zig build runTo check which licenses you can use when forking or combining projects:
./zig-out/bin/repolicense --compatThis mode helps you determine compatible licenses when you want to combine code from multiple projects with different licenses.
The tool will ask you a series of yes/no questions about your project requirements. Based on your answers, it will recommend an appropriate open-source license.
Available commands:
yesory- Answer yes to the current questionnoorn- Answer no to the current questionbackorb- Go back to the previous questionresetorr- Start over from the beginningquitorq- Exit the program
Run with the --compat flag (or -c) to check license compatibility:
./zig-out/bin/repolicense --compatThis mode allows you to:
- Enter a comma-separated list of licenses from projects you want to combine
- See which licenses are compatible with all of them
- Understand why certain combinations are compatible or not
Example:
Enter licenses: MIT, Apache-2.0
You can use any of these licenses for your combined work:
• MIT
• BSD-2-Clause
• Apache-2.0
• GPL-3.0
...The tool helps you choose from the following licenses:
- Permissive: MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0, 0BSD, ISC
- Copyleft: GPL-2.0, GPL-3.0, AGPL-3.0, LGPL-3.0, MPL-2.0, EPL-1.0, EPL-2.0
- Public Domain: Unlicense
- Specialized: OFL-1.1 (for fonts)
ℹ️ Note:
If you wish to add more licenses, please submit a Pull Request with the new license details and update the decision tree accordingly.
Run the test suite:
zig build testThe test suite includes:
- Decision tree structure validation
- License compatibility logic tests
- Navigation and path verification
Contributions are welcome! Please feel free to submit a Pull Request and follow the guidelines in CONTRIBUTING.md.
Based on the original repolicense web application.