Skip to main content
Product: Edgit Version: v1.0.0 Last Updated: 2025-11-01

Prerequisites

Before installing Edgit, ensure you have:
  • Node.js v18.0.0 or higher
  • npm v8.0.0 or higher (comes with Node.js)
  • Git v2.30.0 or higher
  • A Unix-like shell (bash, zsh) or Windows PowerShell

Check Prerequisites

# Check Node.js version
node --version
# Required: v18.0.0 or higher

# Check npm version
npm --version
# Required: v8.0.0 or higher

# Check Git version
git --version
# Required: v2.30.0 or higher

Installation Methods

  • npm (Global)
  • npm (Project-Local)
  • From Source
Install Edgit globally to use it across all projects:
npm install -g @ensemble/edgit
Verify installation:
edgit --version
# Output: edgit v1.0.0
Recommended for: Individual developers and most use cases

Platform-Specific Setup

Using Homebrew (Coming Soon)

brew tap ensemble-edge/tap
brew install edgit

Using npm

npm install -g @ensemble/edgit

Troubleshooting

If you encounter permission errors:
# Option 1: Use nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
npm install -g @ensemble/edgit

# Option 2: Fix npm permissions
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
npm install -g @ensemble/edgit

Using npm

npm install -g @ensemble/edgit

Using snap (Coming Soon)

snap install edgit --classic

Troubleshooting

If you encounter permission errors:
# Option 1: Use nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
npm install -g @ensemble/edgit

# Option 2: Use sudo (not recommended)
sudo npm install -g @ensemble/edgit

Using npm (PowerShell)

npm install -g @ensemble/edgit

Using scoop (Coming Soon)

scoop bucket add ensemble https://github.com/ensemble-edge/scoop-bucket
scoop install edgit

Troubleshooting

If you encounter errors related to git commands:
  1. Ensure Git is installed: git-scm.com
  2. Restart your terminal after installing Git
  3. Verify Git is in PATH: git --version
If you encounter permission errors:
# Run PowerShell as Administrator, then:
npm install -g @ensemble/edgit

Initial Setup

After installation, initialize Edgit in your repository:
1

Navigate to your repository

cd /path/to/your/project
If you don’t have a Git repository yet:
git init
git add .
git commit -m "Initial commit"
2

Initialize Edgit

edgit init
This creates .edgit/components.json:
{
  "version": "1.0",
  "components": {
    "functions": {},
    "agents": {},
    "configs": {}
  }
}
3

Commit the registry

git add .edgit/
git commit -m "chore: initialize edgit"
4

Verify setup

edgit components list
# Output: No components registered yet

Optional: AI Configuration

To enable AI-powered commit messages, configure an OpenAI API key:
  • Environment Variable
  • .env File
  • Per-Command
# Add to ~/.zshrc, ~/.bashrc, or ~/.bash_profile
export OPENAI_API_KEY=sk-...

# Reload shell
source ~/.zshrc  # or ~/.bashrc
Test AI integration:
# Make a change
echo "export const test = () => 'hello'" > src/test.ts
edgit add function test src/test.ts
git add .

# Let AI generate commit message
edgit commit
# Output: "feat(test): add test function"

Updating Edgit

  • Global Installation
  • Project Installation
  • From Source
npm update -g @ensemble/edgit
Check current version:
edgit --version

Uninstalling

  • Global Installation
  • Project Installation
  • From Source
npm uninstall -g @ensemble/edgit
To completely remove Edgit from a project:
# Remove registry
rm -rf .edgit/

# Remove tags (optional - only if you want to remove all version history)
git tag -l "*-v*" | xargs git tag -d

Verification

After installation, verify everything works:
# Check version
edgit --version

# View help
edgit --help

# Initialize test repository
mkdir edgit-test && cd edgit-test
git init
edgit init

# Add test component
echo "export const test = () => 'hello'" > test.ts
edgit add function test test.ts

# List components
edgit components list

# Cleanup
cd .. && rm -rf edgit-test

Troubleshooting

Problem: Shell can’t find edgit commandSolutions:
  1. Verify installation: npm list -g @ensemble/edgit
  2. Check npm global bin path: npm config get prefix
  3. Add to PATH:
    export PATH="$(npm config get prefix)/bin:$PATH"
    
  4. Restart terminal
Problem: No permission to install globallySolutions:
  1. Use nvm (recommended):
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    nvm install 18
    
  2. Fix npm permissions:
    mkdir ~/.npm-global
    npm config set prefix '~/.npm-global'
    echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
    
  3. Use project-local installation instead
Problem: Edgit can’t find GitSolutions:
  1. Install Git: git-scm.com
  2. Verify installation: git --version
  3. Restart terminal
  4. Check PATH includes Git
Problem: AI commit messages failingSolutions:
  1. Verify API key: echo $OPENAI_API_KEY
  2. Check key format: Should start with sk-
  3. Test API key:
    curl https://api.openai.com/v1/models \
      -H "Authorization: Bearer $OPENAI_API_KEY"
    
  4. Check for .env file in project root

Next Steps