-
Download the binary file in release page (Not ready yet)
-
In your git repository, run the following command to install
gitshield-cli
as a git pre-commit hook../gitshield-cli install
- Go to the Github release page where the binary files are located.
- Look for the zip file that matches your operating system. If you're using macOS, download
gitshield-cli-macos-latest.zip
. If you're using Ubuntu, downloadgitshield-cli-ubuntu-latest.zip
. - Once the zip file is downloaded, navigate to the directory where it was saved.
- Unzip the file by double-clicking it or using a tool like unzip in the command line. For example, to unzip the macOS file, you can use the command
unzip gitshield-cli-macos-latest.zip
. - Once the zip file is unzipped, move the binary file to a directory that is included in your PATH variable. This will allow you to run the executable from anywhere in the command line.
- To check what directories are included in your PATH variable, open a terminal window and enter the command
echo $PATH
. This will display a list of directories separated by colons. - Move the binary file to one of the directories displayed by the
echo $PATH
command. For example, you can move the binary file to the/usr/local/bin
directory by entering the commandmv /path/to/binary/file /usr/local/bin
.
- To check what directories are included in your PATH variable, open a terminal window and enter the command
- Once the binary file is in a directory included in your PATH variable, you should be able to run the executable by entering its name in the command line. For example, if the binary file is named
gitshield-cli
, you can run it by entering the commandgitshield-cli
. - In your
git
repository, run the following command to installgitshield-cli
as a gitpre-commit
hook. If you want to use ChatGPT, You will need to provide an OpenAI API key and set it asOPENAI_API_KEY
environment variable. - To use
gitshield
, simply rungit commit
just as you usually do. The hook will automatically scan the changed files to identify any confidential information present in them.
-
Fork and clone the repository
-
Install Python 3.8.1^
-
Install Poetry
-
Install dependencies
poetry install
-
Activate Python environment
poetry shell
-
Open the project in VS Code
-
Install recommended extensions
-
Run the program
8.1 Use Python
python gitshield/cli.py
8.2 Use Pyinstaller
pyinstaller -p gitshield --add-data './pre-commit:.' --onefile --name gitshield-cli gitshield/cli.py
You will find
gitshield-cli
indist/
directory