https://github.com/shadowslayer03/greenlight-cli
https://github.com/shadowslayer03/greenlight-cli
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shadowslayer03/greenlight-cli
- Owner: ShadowSlayer03
- Created: 2025-08-07T17:56:54.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-07T18:50:03.000Z (11 months ago)
- Last Synced: 2025-08-07T19:00:26.102Z (11 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **🟢 GreenLight CLI**
Smart preflight checker for lint, build, test, and component validation — built for speed and precision.

## **✨ Features**
* ✅ Runs **lint**, **build**, **unit tests**, and **component tests** smartly
* 📂 Detects **impacted files** based on Git diffs
* 🚀 Optimized for **CI** and **pre-push hooks**
* 📊 Generates markdown reports
* 🧠 Smart targeting of Cypress component tests
* 🔐 No org needed — works for solo and team developers
## **📦 Installation**
```bash
npm install -g greenlight
```
## **🚀 Usage**
Run all preflight checks:
```bash
greenlight --smart
```
Only run specific checks:
```bash
greenlight --only lint
greenlight --only build
greenlight --only test
greenlight --only component
```
Multiple:
```bash
greenlight --only lint,test
```
## **💡 Example Workflow**
Add to a Husky pre-push hook:
```bash
#!/bin/sh
# Return early if we're in Jenkins
[ -n "$JENKINS_URL" ] && exit 0
. "$(dirname "$0")/_/husky.sh"
# Redirect stdout/stderr for Windows compatibility
if [ -t 2 ]; then
exec >/dev/tty 2>&1
fi
echo "🟢 Running GreenLight Smart Pre-Push Checks..."
# Run greenlight with smart detection
npx greenlight --smart --secure --report
STATUS=$?
if [ $STATUS -ne 0 ]; then
echo "🔴 GreenLight check failed. Push aborted."
exit 1
fi
echo "✅ All pre-push checks passed. Proceeding with push."
exit 0
```
## **📁 Project Structure**
```
greenlight/
├── bin/
│ └── greenlight.js # CLI entry
├── core/
│ ├── dependencyGraph.js
│ ├── impactAnalyzer.js
│ ├── mdReportGenerator.js
│ ├── reporter.js
│ ├── runChecks.js
│ ├── securityChecks.js
│ └── updateCypressTargets.js
└── package.json
```
## **🙌 Note **
This project is maintained by ShadowSlayer03. Please feel free to open a new issue or submit a pull request on the repository. For direct inquiries, you can reach out at sslayer441@gmail.com.
If you find this tool helpful, please consider giving it a star on GitHub!