Welcome to GitGenie! This guide will help you understand the project structure and set up your local development environment correctly.
GitGenie consists of two distinct parts:
- Location: Root directory (
/app,/components,/lib, etc.) - Purpose: Marketing site and documentation for GitGenie
- Technology: Next.js (App Router), React, TypeScript, Tailwind CSS
- Package Manager: pnpm
⚠️
- Location:
/clidirectory - Purpose: The actual GitGenie command-line tool (
ggcommand) - Technology: Node.js CLI application
- Package Manager: npm or pnpm
Important: These are separate projects with different setup requirements. Follow the instructions for the part you want to contribute to.
The website uses pnpm for package management. Using npm or yarn will cause lockfile conflicts and deployment issues.
- Node.js
>= 18 - pnpm (install globally if needed):
npm install -g pnpm
-
Fork and clone the repository:
git clone https://github.com/<your-username>/GitGenie.git cd GitGenie
-
Install dependencies (
⚠️ use pnpm, not npm):pnpm install
-
Start the development server:
pnpm dev
-
Open in browser:
- Navigate to http://localhost:3000
pnpm dev # Start dev server
pnpm build # Build for production
pnpm start # Run production build
pnpm lint # Run linter# ❌ WRONG - Do not do this in the root directory
npm install
npm run dev
# ✅ CORRECT - Always use pnpm for the website
pnpm install
pnpm devWhy? Using npm will:
- Create a conflicting
package-lock.jsonalongsidepnpm-lock.yaml - Cause version inconsistencies
- Break CI/CD deployments
- Create merge conflicts
The CLI tool is a separate Node.js application located in the /cli directory.
- Node.js
>= 18 - npm (comes with Node.js) or pnpm
-
Navigate to the CLI directory:
cd cli -
Install dependencies:
npm install # or pnpm install -
Run the CLI locally:
node index.js # or use the local binary ./bin/gg.js -
Test CLI commands:
node index.js --help node index.js --version
npm install # Install dependencies
npm test # Run tests (if available)
node index.js # Run CLI locally- The main entry point is
index.jsorbin/gg.js - For CLI-specific contribution guidelines, see
cli/CONTRIBUTING.md - Test your changes with various Git repositories before submitting
# ❌ WRONG
cd GitGenie
npm install
# ✅ CORRECT
cd GitGenie
pnpm install# ❌ WRONG - Running website commands in CLI directory
cd cli
pnpm dev # The CLI has no dev server
# ✅ CORRECT - Use appropriate commands for each part
cd cli
node index.js/package.json→ Website dependencies/cli/package.json→ CLI dependencies- Make sure you're editing the right file for your contribution
- Never commit both
package-lock.jsonandpnpm-lock.yamlin the root - The root should only have
pnpm-lock.yaml
# ❌ WRONG - Installing website deps from CLI folder
cd cli
pnpm install # This installs CLI deps, not website deps
# ✅ CORRECT - Install from the correct directory
cd GitGenie # For website
pnpm install
cd GitGenie/cli # For CLI
npm install- Stay in the root directory
- Use pnpm for all commands
- Run
pnpm devto start - Read
CONTRIBUTING.mdfor guidelines
- Navigate to
/clidirectory - Use npm or pnpm
- Run
node index.jsto test - Read
cli/CONTRIBUTING.mdfor guidelines
- Website Contributing Guide:
CONTRIBUTING.md - CLI Contributing Guide:
cli/CONTRIBUTING.md - CLI Documentation:
cli/README.md - Issue Tracker: GitHub Issues
If you encounter issues during setup:
- Check that you're using the correct package manager (pnpm for website, npm/pnpm for CLI)
- Verify you're in the correct directory
- Ensure Node.js version is >= 18
- Open an issue on GitHub with details about your setup problem