Skip to content
Scan your repos and download an Open Source license
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ghlicense
setup
.gitignore
.pylintrc
.pypirc
LICENSE
MANIFEST.in
README.md
requirements.txt
setup.cfg
setup.py
upload.sh

README.md

GitHosting License

License Codacy Badge FOSSA Status

This script scans every repo of a user (on GitHub Bitbucket or other providers available) for a license file, downloads a license to the project folder, adds a license badge in the readme of the project and include git hooks to check if your project has one.

Remember, without a license file your project is proprietary even if it is on GitHub!

Install

pip3 install gh-license

In case of a git clone:

pip3 install -e ./folder-of-the-repo

Info: This overwrites the init.templatedir global git config after creating a backup of the current value in ~/.gh-license/config.ini with the key templatedir in section main.
The installed git template contains a hook that will be installed every time you run git init. The hook reminds you to install a license if you ever forget, and disables itself after adding one.

Example

gh-license --scan Mte90

With this command you will get a report in a file called Mte90-github-license-report

gh-license --scan Mte90 --provider bitbucket

With this command you will get a report in a file called Mte90-bitbucket-license-report

gh-license --scan Mte90 --report my-report

With this command you will get a report in a file called my-report

gh-license --licenselist

With this command will be showed the licenses avalaible

gh-license --license GPLv3

With this command, a GPLv3 license will be downloaded, a shields will be added in the readme and if Git is available a commit will be added and the changes will be pushed to the repo.

gh-license --license GPLv3 -- origin upstream

With this command the commit will be pushed on the upstream origin

Example of output

FOSSA Status

You can’t perform that action at this time.