Metadata-Version: 2.4
Name: ciforge-cli
Version: 2.0.1
Summary: A zero-dependency CI tool replacing multiple CI services.
Project-URL: Homepage, https://github.com/Tahiram32/ciforge
Project-URL: Source Code, https://github.com/Tahiram32/ciforge
Project-URL: Repository, https://github.com/Tahiram32/ciforge
Project-URL: Bug Tracker, https://github.com/Tahiram32/ciforge/issues
Keywords: ci,github-actions,code-quality,coverage,linting
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Security
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ciforge

[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-ea4aaa?logo=github-sponsors)](https://github.com/sponsors/Tahiram32)
[![PyPI](https://img.shields.io/pypi/v/ciforge-cli)](https://pypi.org/project/ciforge-cli/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPLv3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

**ciforge** is a zero-dependency CLI and GitHub Action that replaces 20 CI services with one robust tool. Run your complete CI pipeline 100% locally or natively within your actions, faster and with zero external dependencies.

## Features

- **Code Quality**: Intelligent linting and AST-based complexity analysis (cyclomatic complexity, long functions).
- **Test Coverage Analysis**: Deep inspection of test coverage gaps.
- **Secret Detection**: Catch hardcoded credentials before they reach your repository.
- **Config Validation**: Native parsing and validation for JSON, YAML, ENV, TOML, and XML files.
- **PR Metrics & Velocity Tracking**: Analyze pull request size, churn, and time span metrics.
- **Multi-Model AI Review**: Integrates with OpenAI, Anthropic, or Ollama to find logic flaws and missing edge cases.
- **Localization Sync**: Finds missing translation keys by comparing localization files against a base en.json.
- **Git Hooks Installer**: Easily install pre-commit hooks to run ciforge before committing.
- **Auto-Generated Badges**: Generate dynamic SVG badges reflecting repository health.
- **HTML Reports**: Export beautiful standalone HTML reports.
- **Contributor Welcome Module**: Automatically greet first-time contributors.
- **Auto-Fixer (`--fix`)**: Automatically resolves low-hanging issues like debug statements and bad formatting.
- **Custom Ignore Rules**: Whitelist files and dummy secrets via `.ciforge-ignore`.
- **Auto-Changelog Generator**: Generate `CHANGELOG.md` from git log using conventional commits.
- **Dead Code Detector**: Find unreferenced functions and classes.
- **Deployment Health Check**: Verify production deployments after CI runs.
- **Config Drift Detection**: Detect out-of-sync environment files (e.g. `.env.production` vs `.env.staging`).
- **Architecture Diagram Generator**: Auto-generate Mermaid dependency diagrams.
- **Auto PR Descriptions**: Generate rich markdown PR descriptions from git diffs.
- **Mobile Config Linter**: Catch errors in `pubspec.yaml`, `build.gradle`, and `Podfile`.

## Installation

```bash
pip install ciforge-cli
```

## Usage

**Run locally and print to terminal:**
```bash
ciforge --repo . --base-ref origin/main --format markdown --fail-on high
```

**Generate a beautiful HTML dashboard:**
```bash
ciforge --repo . --format html --badge
```

**Run the auto-fixer:**
```bash
ciforge --repo . --fix
```

**Generate a CHANGELOG.md:**
```bash
ciforge --repo . --changelog
```

**Check for config drift:**
```bash
ciforge --repo . --drift
```

**Run deployment health check:**
```bash
ciforge --repo . --deploy-check https://your-production-url.com
```

**Generate architecture diagram:**
```bash
ciforge --repo . --arch-diagram
```

**Auto-generate PR description:**
```bash
ciforge --repo . --pr-describe
```

**Install local pre-commit hook (blocks bad commits):**
```bash
ciforge --install-hook
```

## GitHub Action Usage

Use `ciforge` directly in your workflows to comment on PRs and enforce standards:

```yaml
steps:
  - uses: actions/checkout@v4
  - name: Run CI Forge
    uses: Tahiram32/ciforge@v2.0.0
    with:
      repo: '.'
      base-ref: 'origin/main'
      format: 'markdown'
      fail-on: 'high'
      post-comment: 'true'
      badge: 'true'
      openai-key: ${{ secrets.OPENAI_API_KEY }} # Optional: enables AI Reviewer
```

## ❤️ Sponsorship & Commercial Licenses

`ciforge` is licensed under the strict **GNU AGPLv3** license. It is 100% free and open source for individual developers and open-source projects.

### Commercial Dual License
If your company wants to use `ciforge` in a proprietary or closed-source commercial product without being bound by the AGPLv3 restrictions (the "cloud loophole"), you must purchase a Commercial License by sponsoring the project.

[![Sponsor ciforge](https://img.shields.io/badge/Sponsor%20ciforge-%E2%9D%A4-ea4aaa?logo=github-sponsors&style=for-the-badge)](https://github.com/sponsors/Tahiram32)

Every commercial sponsor helps fund:
- 🚀 New features and integrations
- 🐛 Bug fixes and maintenance
- 📖 Documentation and examples
- 🔒 Security research and improvements
