Skip to content

Hossiy21/razify

Repository files navigation

Razify

Razify

The missing CLI tool for .env file management.

Diff, scan, validate, document, and audit your environment variables.
Offline. No cloud account. One binary. Every language.

Razify Demo

Go Version Go Report Card Awesome Go CI Env Validation License Built with Cobra PRs Welcome


⚡ Quick Start (60 Seconds)

  1. Install Razify

    go install github.com/Hossiy21/razify@latest
  2. Initialize your project

    razify init
  3. Protect your repository

    razify guard install
  4. Sync missing keys

    razify fix .env .env.example

The Problem

Every development team has lost hours to .env issues:

  • "It works on my machine" — environment inconsistencies across team members
  • "Which variables do I need?" — no documentation, no standard
  • "Did someone commit a secret?" — API keys and passwords leaked to version control
  • "What does this variable do?" — no one remembers, original author left the team

Razify solves all four problems with a single binary.


Features

Command What it does
razify diff Compare two .env files and show exactly what changed
razify scan Detect secret leaks, weak passwords, and exposed credentials
razify validate Ensure all required variables are present before deploying
razify docs Auto-generate markdown documentation from .env.example
razify audit Full health report with a score out of 100
razify fix Automatically sync missing keys from .env.example to .env
razify init Interactive wizard to bootstrap your .env.example file
razify version Check the current version and look for updates
razify guard Block git commits that contain exposed secrets

Installation

Homebrew (macOS/Linux)

Install via your own personal tap (replace Hossiy21 with your GitHub username if different):

brew tap Hossiy21/tap
brew install razify

Scoop (Windows)

scoop bucket add Hossiy21 https://github.com/Hossiy21/scoop-bucket
scoop install razify

Direct Go Install

go install github.com/Hossiy21/razify@latest

Verify:

razify version

Usage

razify diff — Compare environments

razify diff .env .env.staging
Comparing .env → .env.staging

  ✘  MISSING in .env.staging: API_KEY
  ✔  ADDED in .env.staging:   NEW_FEATURE
  ~  CHANGED: DB_HOST
      .env: localhost
      .env.staging: staging.server.com

7 difference(s) found.

razify scan — Secret leak detection

razify scan .env
razify scan .env --json
Scanning .env...

  ✘  [CRITICAL] Line 6: DB_PASSWORD
     Value : ch****me
     Reason: Weak or default value detected

  ⚠  [HIGH]     Line 5: AWS_ACCESS_KEY
     Value : AK****************LE
     Reason: Cloud provider credential

Summary: 1 CRITICAL  4 HIGH  1 MEDIUM

  ✘  ACTION REQUIRED: Never commit this file to git!

razify validate — Pre-deploy validation

razify validate .env .env.example
razify validate .env .env.example --json
Validating .env against .env.example...

  ✘  [MISSING]     STRIPE_KEY
      Required key not found in .env

  ~  [PLACEHOLDER] DB_HOST
      Value looks like it was never changed from example

  ✔  [OK]          API_KEY
  ✔  [OK]          JWT_TOKEN

Summary: 6 OK   1 MISSING   2 EMPTY/PLACEHOLDER

  ✘  ACTION REQUIRED: Add missing keys before deploying!

razify docs — Auto-generate documentation

razify docs .env.example
razify docs .env.example -o ENV_DOCS.md
| Variable       | Required  | Default     | Description                    |
|----------------|-----------|-------------|--------------------------------|
| `DB_HOST`      | No        | `localhost` | Primary database host          |
| `API_KEY`      | **Yes**   | —           | Main API key for external use  |
| `STRIPE_KEY`   | **Yes**   | —           | Stripe payment processing key  |

---

### `razify init` — Interactive bootstrap

```bash
razify init

The interactive wizard helps you create a professional .env.example from scratch, automatically adding validation tags like @required and @type based on your input.


razify fix — Sync environment files

razify fix .env .env.example
razify fix .env .env.example --dry-run
Fixing .env using template .env.example...

  + Added: STRIPE_KEY
  + Added: NEW_SERVICE_URL

✔ Successfully added 2 missing keys to .env!

razify audit — Full health report

razify audit .env .env.example
  ┌─────────────────────────────┐
  │     Razify Audit Report     │
  └─────────────────────────────┘

  ▸ Running scan...
  ▸ Running validate...
  ▸ Running diff...

  ┌─────────────────────────────┐
  │          Results            │
  └─────────────────────────────┘

  Scan        1 CRITICAL  4 HIGH  1 MEDIUM
  Validate    1 MISSING  2 PLACEHOLDER  6 OK
  Diff        7 difference(s) from .env.example

  ┌─────────────────────────────┐
  │        Health Score         │
  └─────────────────────────────┘

  5/100  Critical — needs immediate attention

  Recommendations:
  ✘  Rotate exposed credentials immediately
  ⚠  Add missing required variables before deploying
  ~  Replace placeholder values with real ones

razify guard — Git commit protection

razify guard install
razify guard status
razify guard uninstall
  ✔  Razify Guard installed successfully!
     Every git commit in this repo will now be scanned.
     Commits with exposed secrets will be blocked automatically.

CI/CD Integration

Razify is designed to be a "Security Gate" in your CI/CD pipeline. You can use it to audit your Staging or Production environment files before they are deployed.

Tip

Since .env is usually ignored by Git, use this to scan committed files like .env.staging or variables generated from GitHub Secrets.

This repository includes a dedicated GitHub Actions workflow (.github/workflows/env-validation.yml) that demonstrates CI integration by validating the demo environment files.

jobs:
  validate-env:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.25'

      - name: Install Razify
        run: go install github.com/Hossiy21/razify@latest

      - name: Scan Staging Environment
        run: razify scan .env.staging --json

      - name: Validate Template Integrity
        run: razify validate .env.staging .env.example --json

JSON Output

Every command supports --json for scripting and AI agent integration:

razify scan .env --json
{
  "file": ".env",
  "results": [
    {
      "line": 3,
      "key": "API_KEY",
      "value": "se*****23",
      "reason": "Looks like an API key",
      "risk": "HIGH"
    }
  ],
  "summary": {
    "critical": 1,
    "high": 4,
    "medium": 1,
    "total": 6
  }
}

Compatibility

Works with any project that uses .env files.

Framework Compatible
React / Next.js
Node.js
Python / Django / FastAPI
Go
Laravel (PHP)
Ruby on Rails

Roadmap

  • razify diff — Compare env files
  • razify scan — Secret leak detection
  • razify validate — Required variable enforcement
  • razify docs — Auto-generate documentation
  • razify audit — Full health report
  • razify guard — Git commit protection
  • razify fix — Auto-sync missing keys
  • razify init — Interactive setup wizard
  • --json flag — AI agent and script support
  • VS Code extension
  • Web dashboard

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines on how to get started.

git clone https://github.com/Hossiy21/razify.git
cd razify
go build .

License

MIT — free to use, modify, and distribute.


Made with ❤️ in Ethiopia by Hosaina

About

A developer CLI tool that manages .env files, detects secret leaks, syncs env drift across teammates, and validates environment parity between local/staging/prod all from your terminal. Written in Go.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages