Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thank you for your interest in contributing!
## Development Setup

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/revenueholdings.git`
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/devforge-cli.git`
3. Create a virtual environment: `python -m venv venv`
4. Install dev dependencies: `pip install -e ".[dev]"`

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated by Agent B — Lint & Type Scripts
.PHONY: lint test format typecheck format-check
.PHONY: lint test format typecheck format-check clean

lint:
ruff check src/ tests/
Expand All @@ -15,3 +15,7 @@ typecheck:

test:
pytest -q

clean:
rm -rf build/ dist/ *.egg-info/ .pytest_cache/ __pycache__/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
236 changes: 118 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
# DevForge CLI

[![GitHub stars](https://img.shields.io/github/stars/Coding-Dev-Tools/devforge?style=social)](https://github.com/Coding-Dev-Tools/devforge/stargazers)

**The `devforge` command — one install, ten developer CLI tools.**

[![PyPI](https://img.shields.io/pypi/v/devforge)](https://pypi.org/project/devforge/)
[![Python Versions](https://img.shields.io/pypi/pyversions/devforge)](https://pypi.org/project/devforge/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Ten production-ready CLI tools for API contracts, SQL generation, infrastructure diffs, config drift, API mocking, key management, env syncing, schema conversion, MCP servers, and dead code removal — in a single package. Install one meta-package and get immediate access to all tools via the unified `devforge` command.

---

[🏠 Landing Page](https://coding-dev-tools.github.io/devforge/) · [📝 Blog](https://coding-dev-tools.github.io/devforge/blog.html) · [🐛 Report a Bug](https://github.com/Coding-Dev-Tools/devforge/issues)

---

## Why the Suite?

Instead of installing ten separate tools and learning ten different CLIs, `pip install devforge[all]` gives you:

- **Single CLI** (`devforge`) to invoke any tool — no context switching
- **Consistent flags, output formats, and help** across all tools
- **Shared configuration** — one install, all tools

## Installation

```bash
# Install everything (recommended)
pip install devforge[all]

# Or install individual tools
pip install devforge[guard] # API Contract Guardian
pip install devforge[sql] # json2sql
pip install devforge[deploy] # DeployDiff
pip install devforge[drift] # ConfigDrift
pip install devforge[ghost] # APIGhost
pip install devforge[auth] # APIAuth
pip install devforge[envault] # Envault
pip install devforge[schema] # SchemaForge
pip install devforge[mcp] # click-to-mcp
pip install devforge[deadcode] # DeadCode
```

## Usage

```bash
devforge --version # Show version info
devforge tools # List all available tools
devforge tools guard # Show details about a specific tool
devforge versions # Show installed tool versions
```

Run any tool directly through `devforge`:

```bash
# API Contract Guardian — detect OpenAPI breaking changes
devforge guard check spec-v1.yaml spec-v2.yaml

# json2sql — convert JSON to SQL INSERT statements
devforge sql convert data.json --dialect postgres

# DeployDiff — preview infrastructure changes with cost estimates
devforge deploy preview plan.json

# ConfigDrift — catch config drift between environments
devforge drift check dev.yaml prod.yaml

# APIGhost — spawn mock API server from OpenAPI spec
devforge ghost serve openapi.yaml

# APIAuth — generate API keys and JWTs
devforge auth generate --type api-key

# Envault — sync .env files across environments
devforge envault diff .env.dev .env.prod

# SchemaForge — convert between ORM formats
devforge schema convert schema.prisma --to drizzle

# click-to-mcp — wrap CLI as MCP server
devforge mcp wrap my-cli --transport http

# DeadCode — find unused exports in React/Next.js
devforge deadcode scan src/
```

## Tools

| Command | Package | Description |
|---------|---------|-------------|
| `guard` | api-contract-guardian | Detect breaking API changes, generate migration guides, gate CI pipelines on contract violations |
| `sql` | json2sql | Convert JSON datasets to SQL with smart type inference across PostgreSQL, MySQL, and SQLite |
| `deploy` | deploydiff | Preview infra changes with cost estimates and automatic rollback commands for Terraform, CloudFormation, and Pulumi |
| `drift` | configdrift | Compare configs across environments, flag missing keys, deprecated values, and compliance violations |
| `ghost` | apighost | Mock API server from OpenAPI specs with VCR cassette recording and realistic fake data |
| `auth` | apiauth | API key and JWT lifecycle management with AES-256-GCM encrypted local store |
| `envault` | envault | Env variable syncing, diffing, and secret rotation with Vault/AWS SSM/Doppler/1Password support |
| `schema` | schemaforge | Bidirectional ORM schema converter — 11 formats with zero-loss roundtripping |
| `mcp` | click-to-mcp | Auto-wrap any Click/typer CLI as an MCP server — zero code changes |
| `deadcode` | deadcode | Detect unused exports, dead routes, orphaned CSS in TypeScript/React/Next.js projects |

## Links

- [Landing Page](https://coding-dev-tools.github.io/devforge/)
- [GitHub Organization](https://github.com/Coding-Dev-Tools)
- [Report an Issue](https://github.com/Coding-Dev-Tools/devforge/issues)

## License

MIT — see [LICENSE](LICENSE) for details.

## Test

```bash
pytest -q
```
# DevForge CLI
[![GitHub stars](https://img.shields.io/github/stars/Coding-Dev-Tools/devforge?style=social)](https://github.com/Coding-Dev-Tools/devforge/stargazers)
**The `devforge` command — one install, ten developer CLI tools.**
[![PyPI](https://img.shields.io/pypi/v/devforge)](https://pypi.org/project/devforge/)
[![Python Versions](https://img.shields.io/pypi/pyversions/devforge)](https://pypi.org/project/devforge/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
Ten production-ready CLI tools for API contracts, SQL generation, infrastructure diffs, config drift, API mocking, key management, env syncing, schema conversion, MCP servers, and dead code removal — in a single package. Install one meta-package and get immediate access to all tools via the unified `devforge` command.
---
[🏠 Landing Page](https://coding-dev-tools.github.io/devforge/) · [📝 Blog](https://coding-dev-tools.github.io/devforge/blog.html) · [🐛 Report a Bug](https://github.com/Coding-Dev-Tools/devforge/issues)
---
## Why the Suite?
Instead of installing ten separate tools and learning ten different CLIs, `pip install devforge[all]` gives you:
- **Single CLI** (`devforge`) to invoke any tool — no context switching
- **Consistent flags, output formats, and help** across all tools
- **Shared configuration** — one install, all tools
## Installation
```bash
# Install everything (recommended)
pip install devforge[all]
# Or install individual tools
pip install devforge[guard] # API Contract Guardian
pip install devforge[sql] # json2sql
pip install devforge[deploy] # DeployDiff
pip install devforge[drift] # ConfigDrift
pip install devforge[ghost] # APIGhost
pip install devforge[auth] # APIAuth
pip install devforge[envault] # Envault
pip install devforge[schema] # SchemaForge
pip install devforge[mcp] # click-to-mcp
pip install devforge[deadcode] # DeadCode
```
## Usage
```bash
devforge --version # Show version info
devforge tools # List all available tools
devforge tools guard # Show details about a specific tool
devforge versions # Show installed tool versions
```
Run any tool directly through `devforge`:
```bash
# API Contract Guardian — detect OpenAPI breaking changes
devforge guard check spec-v1.yaml spec-v2.yaml
# json2sql — convert JSON to SQL INSERT statements
devforge sql convert data.json --dialect postgres
# DeployDiff — preview infrastructure changes with cost estimates
devforge deploy preview plan.json
# ConfigDrift — catch config drift between environments
devforge drift check dev.yaml prod.yaml
# APIGhost — spawn mock API server from OpenAPI spec
devforge ghost serve openapi.yaml
# APIAuth — generate API keys and JWTs
devforge auth generate --type api-key
# Envault — sync .env files across environments
devforge envault diff .env.dev .env.prod
# SchemaForge — convert between ORM formats
devforge schema convert schema.prisma --to drizzle
# click-to-mcp — wrap CLI as MCP server
devforge mcp wrap my-cli --transport http
# DeadCode — find unused exports in React/Next.js
devforge deadcode scan src/
```
## Tools
| Command | Package | Description |
|---------|---------|-------------|
| `guard` | api-contract-guardian | Detect breaking API changes, generate migration guides, gate CI pipelines on contract violations |
| `sql` | json2sql | Convert JSON datasets to SQL with smart type inference across PostgreSQL, MySQL, and SQLite |
| `deploy` | deploydiff | Preview infra changes with cost estimates and automatic rollback commands for Terraform, CloudFormation, and Pulumi |
| `drift` | configdrift | Compare configs across environments, flag missing keys, deprecated values, and compliance violations |
| `ghost` | apighost | Mock API server from OpenAPI specs with VCR cassette recording and realistic fake data |
| `auth` | apiauth | API key and JWT lifecycle management with AES-256-GCM encrypted local store |
| `envault` | envault | Env variable syncing, diffing, and secret rotation with Vault/AWS SSM/Doppler/1Password support |
| `schema` | schemaforge | Bidirectional ORM schema converter — 11 formats with zero-loss roundtripping |
| `mcp` | click-to-mcp | Auto-wrap any Click/typer CLI as an MCP server — zero code changes |
| `deadcode` | deadcode | Detect unused exports, dead routes, orphaned CSS in TypeScript/React/Next.js projects |
## Links
- [Landing Page](https://coding-dev-tools.github.io/devforge/)
- [GitHub Organization](https://github.com/Coding-Dev-Tools)
- [Report an Issue](https://github.com/Coding-Dev-Tools/devforge/issues)
## License
MIT — see [LICENSE](LICENSE) for details.
## Test
```bash
pytest -q
```
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies = [
"rich>=13.0.0",
]

# Optional groups — install with: pip install devforge[all]
# Optional groups install with: pip install devforge[all]
[project.optional-dependencies]
guard = ["api-contract-guardian>=0.1.0"]
sql = ["json2sql>=0.1.0"]
Expand All @@ -53,9 +53,9 @@ all = [
dev = ["pytest>=7.0.0", "pyright>=1.1.300"]

[project.urls]
Homepage = "https://github.com/Coding-Dev-Tools/devforge"
Repository = "https://github.com/Coding-Dev-Tools/devforge"
Issues = "https://github.com/Coding-Dev-Tools/devforge/issues"
Homepage = "https://github.com/Coding-Dev-Tools/devforge-cli"
Repository = "https://github.com/Coding-Dev-Tools/devforge-cli"
Issues = "https://github.com/Coding-Dev-Tools/devforge-cli/issues"

[project.scripts]
devforge = "devforge.cli:app"
Expand All @@ -66,6 +66,7 @@ where = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --tb=short"
pythonpath = ["src"]
[tool.ruff]
target-version = "py310"
line-length = 120
Expand Down
27 changes: 23 additions & 4 deletions src/devforge/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""DevForge unified CLI entry point."""

import builtins as _builtins
import subprocess
import sys
import typer
Expand Down Expand Up @@ -86,7 +85,7 @@ def install(
):
"""Install a DevForge tool."""
if tool == "all":
targets = _builtins.list(TOOLS.keys())
targets = list(TOOLS.keys())
extras = ",".join(TOOLS.keys())
elif tool in TOOLS:
targets = [tool]
Expand Down Expand Up @@ -119,7 +118,7 @@ def show_versions(
console.print(f"[red]Unknown tool: {tool}[/red]")
console.print(f"Available: {', '.join(TOOLS.keys())}")
raise typer.Exit(code=1)
targets = [tool] if tool else _builtins.list(TOOLS.keys())
targets = [tool] if tool else list(TOOLS.keys())

for t in targets:
info = TOOLS[t]
Expand Down Expand Up @@ -156,15 +155,35 @@ def dispatch(
try:
result = subprocess.run(
[sys.executable, "-m", info["package"].replace("-", "_")] + (args or []),
capture_output=False,
capture_output=True,
text=True,
)
if result.returncode == 0:
sys.stdout.write(result.stdout)
if result.stderr:
sys.stderr.write(result.stderr)
sys.exit(0)
# Module not found — show friendly install message
if "No module named" in result.stderr:
console.print(
f"[red]Tool '{tool_name}' not installed.[/red]\n"
f"Install with: [green]pip install devforge[{tool_name}][/green]"
)
raise typer.Exit(code=1) from None
# Tool ran but failed — show its output and propagate exit code
sys.stdout.write(result.stdout)
sys.stderr.write(result.stderr)
sys.exit(result.returncode)
except FileNotFoundError:
# Only reached if sys.executable itself is missing (extremely rare)
console.print(
f"[red]Tool '{tool_name}' not installed.[/red]\n"
f"Install with: [green]pip install devforge[{tool_name}][/green]"
)
raise typer.Exit(code=1) from None
except Exception as e:
console.print(f"[red]Unexpected error running '{tool_name}': {e}[/red]")
raise typer.Exit(code=1) from e

dispatch.__name__ = tool_name
dispatch.__doc__ = f"Run `{pkg}` commands via the {tool_name} subcommand."
Expand Down