Prepublic reviews a local Git repository the way a careful colleague would before it goes public: leaked credentials in the files and in the history, sensitive files, personal paths and emails, repository hygiene, documentation and licensing. It runs offline, never modifies the repository, and hands you one clearance record with a verdict, every finding, how to fix it and an honest account of what it could not check.
Try it in ten seconds
npx prepublic --demo
--demo builds a throwaway repository full of fake credentials and personal paths, scans it, opens the report and deletes the repository again. Nothing leaves your machine.
- Local-first: no telemetry, no accounts, no API keys, no network requests. Zero runtime dependencies: Node.js 20+ and Git.
- Read-only and hardened: Git runs with repository-configurable command hooks disabled, so even a hostile
.git/config cannot execute code during a scan.
- Safe to share: raw secret values never reach a report. Personal paths, user names and emails are masked.
- Built on established tooling: if Gitleaks is installed, Prepublic runs it as a second engine and merges the results.
Quick start
npx prepublic path/to/your-repo # run without installing
npm install -g prepublic # or install the `prepublic` command
From source: git clone https://github.com/egemenozen1/prepublic.git, then node bin/prepublic.js path/to/your-repo.
The scan prints a summary and opens the report in your browser. Reports go to your system temp folder, never into the scanned repository unless you pass --out.
prepublic --demo # leaky-service: blocked by secrets and history exposure
prepublic --demo almost-ready # needs review: license and personal-data issues
prepublic --demo release-ready # passes every automated check
What it checks
| Area |
Examples |
| Secrets in files |
AWS, GitHub, GitLab, Slack, Stripe, Google, OpenAI, Anthropic, npm, PyPI, SendGrid, Azure, Telegram tokens; private key blocks; JWTs; database and URL credentials; hard-coded password = "…" assignments (entropy-checked, placeholders ignored) |
| Git history |
Secrets that were removed but remain in old commits on any local ref; sensitive files that were deleted but are still retrievable; large blobs; non-noreply author emails that will become public |
| Sensitive files |
.env, private keys and keystores, cloud credential files, Terraform state, HAR captures, database dumps, shell history, registry configs with auth tokens; sensitive files that are untracked and not ignored |
| Personal & internal data |
Absolute home-directory paths (your OS user name), confidentiality notices, private IPs and internal hostnames |
| Repository hygiene |
.gitignore gaps for your stack (verified with git check-ignore, including patterns that only your global config ignores), committed node_modules, logs, OS and IDE clutter, oversized files, symlinks pointing outside the repo, tokens in submodule or remote URLs |
| Docs & licensing |
README presence, substance and broken relative links; license presence, recognition, unfilled [year]/[fullname] placeholders, and mismatches with package.json, pyproject.toml or Cargo.toml; CONTRIBUTING, SECURITY, tests, CI |
Every finding explains why it matters, what to do (including copy-ready commands such as git rm --cached or git filter-repo), its locations, and redacted evidence.
The report
A Prepublic report reads like a clearance record: who and what was inspected, a verdict, and the evidence behind it.
| Dark theme: review required |
On a phone |
|
|
- A verdict you can act on: Not ready to publish (any critical or high finding), Review before publishing (medium) or No blockers detected. Never "safe".
- Exposure ledger: one mark per finding, by category and severity. Select a mark to open that finding, a category or a severity to filter.
- Findings with everything needed to fix them: evidence with secrets replaced by solid redaction marks, numbered fix steps, copy-ready commands, exact paths, lines and commits. List and detail side by side on desktop, inline on phones.
- Publication checklist: the automated checks plus the steps no scanner can take for you: rotating exposed credentials, reviewing issues, wikis and CI logs, confirming you have the right to publish.
- Coverage and limitations: what was scanned, what was skipped, and why.
- Made for working through findings: keyboard navigation (
/ to search, arrows or j/k), a reviewed state kept only in your browser, light and dark themes, links that keep the current view.
- Exports: sanitized Markdown, JSON, or print to PDF. The HTML is one self-contained file: fonts embedded, a strict hash-based Content Security Policy, no external resources.
| Nothing to fix |
Publication checklist |
|
|
Usage
prepublic [path] [options]
-o, --out <file> Write the report to <file>; format follows the extension (.html, .md, .json)
-f, --format <fmt> html (default), md or json
--stdout Print the md/json report to stdout
--no-open Do not open the HTML report in your browser
--no-history Skip Git history checks
--no-snippets Leave redacted evidence lines out of the report
--gitleaks <mode> auto (default: use if installed), off, or require
--gitleaks-path <bin> Path to a gitleaks executable
--max-file-mb <n> Skip content checks for files larger than n MB (default 2)
--max-history-mb <n> Stop the history content scan after n MB of patches (default 512)
--fail-on <severity> Exit 1 if a finding is at or above: critical, high, medium, low, info
--demo [name] Scan a generated synthetic repository: leaky-service (default), almost-ready, release-ready
Exit codes: 0 scan completed, 1 --fail-on threshold reached, 2 usage or repository error.
In CI
- uses: actions/checkout@v4
with: { fetch-depth: 0 } # full history, so history checks are meaningful
- run: npx --yes prepublic@0.1.0 . --no-open --format md --out prepublic.md --fail-on high
Gitleaks integration
With --gitleaks auto (default) Prepublic runs gitleaks git --redact when the binary is on your PATH. Prepublic never downloads Gitleaks. Its report is written to a private temp directory that is deleted immediately, and Prepublic keeps only rule, file, line and commit. Matches that overlap a built-in finding are shown as confirmed by Gitleaks. Use --gitleaks require to fail when it cannot run.
Configuration and false positives
Add a prepublic:allow comment to a line to skip all line-level checks for it (gitleaks:allow also silences Prepublic's secret rules). For broader exclusions, add .prepublic.json to the repository root:
{
"ignorePaths": ["test/fixtures/**", "docs/examples/*.env"],
"ignoreRules": ["internal-network", "junk/*"]
}
Suppressed paths and findings are counted in the report, so exclusions stay visible.
Security and privacy model
- Read-only. Prepublic only runs read-only Git commands with
GIT_OPTIONAL_LOCKS=0, so it does not even refresh the index. The test suite verifies that every file in the repository, including .git, is byte-for-byte unchanged after a scan.
- Hardened against hostile repositories. Git is invoked with
core.fsmonitor=false, --no-textconv, --no-ext-diff, a fixed pager and protocol.allow=never. The tests include a repository whose config tries to execute commands through fsmonitor, textconv and the pager. Without hardening, plain git ls-files and git log -p run those commands.
- No raw secrets in output. Detectors keep values in memory only. Reports show a public format prefix and the length (
ghp_•••••••• (40 chars)), evidence lines are redacted, and a final pass re-redacts every string in the report. The absolute repository path is replaced with <repo>.
- No network. Prepublic makes no network requests. The HTML report loads nothing external.
See SECURITY.md to report a vulnerability.
Limitations
Prepublic reduces risk; it cannot prove that a repository is safe to publish.
- Detection is pattern-based. Unknown token formats and encoded, split or low-entropy secrets can be missed, and some findings will be false positives. Installing Gitleaks broadens coverage.
- Only tracked files (their working-tree versions) and history on local refs are inspected. Fetch all branches first. Remote-only branches, pull requests, issues, wikis, releases, CI logs, packages and container images are out of scope.
- Changes introduced only in merge commits are not content-scanned. Binary files and files over the size limit are only checked by name and size.
- If a credential was ever committed, assume it is compromised and rotate it. Rewriting history does not reach existing clones, forks or caches.
How Prepublic compares
Prepublic is a pre-publication tool. It does not try to replace established scanners; it combines their concerns into one local decision before the first push to a public remote.
| Tool |
Focus |
Where Prepublic differs |
| Gitleaks, TruffleHog, detect-secrets |
Deep secret detection |
Prepublic integrates Gitleaks and adds files, personal data, hygiene, docs and licensing, plus a readiness verdict and a shareable report |
| GitHub secret scanning and push protection |
Secrets, server-side |
Runs after code reaches GitHub; Prepublic runs before anything leaves your machine, on any host |
| Repolinter, community-profile checks |
Required files and metadata |
No secret, history or personal-data checks |
| OpenSSF Scorecard |
Security posture of public GitHub projects |
Assumes the project is already public |
Development
npm test # node:test suite: detectors, scans of the synthetic repos, read-only and hardening checks, report sanitization, CLI
npm run examples # generate the synthetic example repositories into examples/
npm run scan:self # scan this repository with Prepublic
npm run screenshots # regenerate docs/screenshots with a local headless Chrome or Edge
The example repositories are generated at runtime from a seeded generator (scripts/make-examples.mjs), so no secret-shaped strings are ever committed to this repository. See CONTRIBUTING.md.
License
MIT. The report embeds IBM Plex Sans and IBM Plex Mono, licensed under the SIL Open Font License 1.1 (notice).