Skip to main content

Repo hygiene scanner and fixer (junk files, secrets, gitignore).

Project description

Repoclean (CLI) v0.7.0

PyPI License CI

repoclean — GitHub Repo Cleanup & Secret Leak Prevention CLI

A fast repo hygiene scanner + scary-good secrets detector + pre-commit hook that blocks risky commits automatically.

Why repoclean exists

Most repo leaks don’t happen because people are careless — they happen because shipping is fast and repo hygiene is manual.

repoclean stops:

  • accidental API key/token leaks
  • pushing .env, .pem, id_rsa etc
  • committing junk (__pycache__/, .log, .tmp, dist/, etc)
  • committing huge files that bloat history

repoclean is a small CLI tool meant to be run before pushing to GitHub. It helps you quickly:

  • spot repo hygiene issues
  • detect secret/token patterns
  • block accidental leaks via an optional Git pre-commit hook

Demo

repoclean demo

Install

pip install repoclean-cli

Quick Start

repoclean scan
repoclean secrets
## Secrets scanner (v0.6.0)

repoclean detects:
- Private key markers (`BEGIN PRIVATE KEY`)
- GitHub tokens (`ghp_`, `github_pat_`, `gho_`)
- Slack tokens (`xoxb-...`)
- Stripe live keys (`sk_live_...`)
- Telegram bot tokens (`123456:ABC...`)
- JWT tokens
- High entropy secret candidates in assignment contexts

CI usage

repoclean ci
repoclean scan --fail-on sensitive,large
repoclean secrets --fail

Typical workflow

repoclean scan
repoclean secrets --fail
repoclean fix --yes
repoclean install-hook --mode strict

Secrets severity + CI

repoclean secrets --min-severity high
repoclean secrets --fail-on critical
repoclean ci --json

Command

Scan repo hygiene issues
repoclean scan
Create a default .gitignore
repoclean init
Config

Create a .repoclean.toml config file:

repoclean config init
Safely clean junk files/folders

Preview:

repoclean fix --dry-run --verbose

Apply cleanup:

repoclean fix --yes
### Unstage instead of delete

```bash
repoclean fix --staged-only --unstage --yes
Scan for secrets/tokens
repoclean secrets

Fail mode (useful for CI and hooks):

repoclean secrets --fail

Install git pre-commit hook

Install (strict mode blocks commit on issues):
repoclean install-hook --mode strict
Install (warn mode prints warnings but allows commit):
repoclean install-hook --mode warn
Uninstall:
repoclean uninstall-hook
Hook utilities:
repoclean hook status
repoclean hook print --mode warn
repoclean hook print --mode strict

Notes

  • repoclean is the command name.
  • The PyPI package name is repoclean-cli.

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

repoclean_cli-0.7.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

repoclean_cli-0.7.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file repoclean_cli-0.7.0.tar.gz.

File metadata

  • Download URL: repoclean_cli-0.7.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for repoclean_cli-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5c80563276ac4fcdb5141df355af69aa5492a082a7bd2fde6671e5eb0dd202bf
MD5 ee2695572adfd20907e548d4e1a07aea
BLAKE2b-256 a1ffb339ed80287dd062430162936de7221747876f320b2a8805740f32e71dc0

See more details on using hashes here.

File details

Details for the file repoclean_cli-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: repoclean_cli-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for repoclean_cli-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edf9e49643b1b771caa5b31557a8397f8ac8b1248f2a9aff174ca7258d38a7d5
MD5 e5b3682fea18e3a61371e913c19be51f
BLAKE2b-256 f3110e026a6c6f34a808c81e37d5b42277f08f20a47f1cb84b7c6990d6cbd28e

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