Skip to main content

A cross-platform CLI tool for detecting exposed API keys and sensitive information.

Project description

SafeCommit

A cross-platform Python CLI that scans projects for exposed API keys, secrets, credentials, and sensitive information before you commit.

It recursively scans project files using pattern-based detection and reports potential security risks with file locations, line numbers, severity levels, and matched patterns.


Features

  • Cross-platform support (Windows, Linux, macOS)
  • Recursive directory scanning
  • Detects common API keys and credentials
  • Detects private keys, certificates, and tokens
  • Rich terminal output
  • Fast regex-based scanning
  • Lightweight and easy to use

Installation

Clone the repository:

git clone https://github.com/sushantkr1187/SafeCommit.git
cd SafeCommit

Create a virtual environment (recommended):

python -m venv .venv

Activate it.

Windows

.venv\Scripts\activate

Linux / macOS

source .venv/bin/activate

Install the package in editable mode:

pip install -e .

Usage

Scan the current directory

safecommit scan .

Scan another project

safecommit scan /path/to/project

Show version

safecommit --version

or

safecommit -v

Example Output

Scanning: D:\Projects\MyProject

Found 2 potential issue(s).

File      : backend/config.py
Line      : 18
Severity  : HIGH
Pattern   : OpenAI API Key
Match      : sk-proj-************************

Currently Detected

  • OpenAI API Keys
  • GitHub Personal Access Tokens
  • AWS Access Keys
  • Google API Keys
  • Google OAuth Credentials
  • Azure Storage Connection Strings
  • Stripe API Keys
  • Twilio API Keys
  • Slack Tokens
  • Discord Tokens
  • JWT Tokens
  • Bearer Tokens
  • MongoDB URIs
  • PostgreSQL URIs
  • MySQL URIs
  • Redis URIs
  • Hardcoded Passwords
  • Private Keys
  • SSH Keys
  • PGP Keys
  • Certificates

Project Structure

SafeCommit/
│
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── pyproject.toml
├── README.md
│
└── src/
    └── safecommit/
        ├── __init__.py
        ├── cli.py
        ├── scanner.py
        ├── patterns.py
        └── utils.py

Contributing

Contributions, bug reports, feature requests, and improvements are welcome.

Please open an issue before submitting major changes.


License

This project is licensed under the MIT License.


Author

Sushant Kumar Kushwaha

GitHub: https://github.com/sushantkr1187

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safecommit_cli-1.0.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

safecommit_cli-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file safecommit_cli-1.0.0.tar.gz.

File metadata

  • Download URL: safecommit_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for safecommit_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0db06e7fa7ebbdce4e6ad54cb759ff5502273ded6c65d2b36be04790bd054207
MD5 c0fcab37afb19999b043f37334c27d04
BLAKE2b-256 e058250ceb4dd99286f65d54e4be4ef4983e18c03603cedf56cea2ab538d8a4d

See more details on using hashes here.

File details

Details for the file safecommit_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: safecommit_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for safecommit_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51fcbafac60122d4cdbeb92382bfa616a9b80213ddd56d5306f0d69015de7559
MD5 dbb5e99d1aba4fd47199794846fad384
BLAKE2b-256 de37f4374bb7cf69c38c249aef5d4d4812928edc2f2bf348e37f285c94483e46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page