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

Overview

Edgit can be configured through:
  1. Environment variables - For API keys and global settings
  2. Component registry - For component-specific metadata
  3. Git config - For user-specific preferences

Environment Variables

AI Configuration

OPENAI_API_KEY
string
OpenAI API key for AI-powered commit messages.
export OPENAI_API_KEY=sk-proj-...
Required for: AI commit message generationWhere to get: OpenAI Platform
OPENAI_MODEL
string
default:"gpt-4"
OpenAI model to use for commit message generation.
export OPENAI_MODEL=gpt-4-turbo
Options: gpt-4, gpt-4-turbo, gpt-3.5-turbo
OPENAI_MAX_TOKENS
number
default:"150"
Maximum tokens for AI-generated commit messages.
export OPENAI_MAX_TOKENS=200

Git Configuration

EDGIT_DIR
string
default:".edgit"
Directory name for Edgit metadata.
export EDGIT_DIR=.edgit
Note: Changing this requires re-initialization
GIT_TAG_PREFIX
string
default:""
Prefix for Git tags created by Edgit.
export GIT_TAG_PREFIX=release/
# Creates tags like: release/component-v1.0.0

Debug and Logging

EDGIT_DEBUG
boolean
default:"false"
Enable debug logging.
export EDGIT_DEBUG=true
edgit commit  # Shows detailed debug information
EDGIT_LOG_LEVEL
string
default:"info"
Set logging level.
export EDGIT_LOG_LEVEL=debug
Options: error, warn, info, debug

Configuration Files

Component Registry (.edgit/components.json)

The component registry is the primary configuration file:
{
  "version": "1.0",
  "components": {
    "functions": {
      "email-processor": {
        "type": "function",
        "path": "src/functions/email.ts",
        "description": "Processes incoming emails",
        "dependencies": ["queue-manager"],
        "metadata": {
          "runtime": "node18",
          "memory": "256MB",
          "timeout": "30s"
        }
      }
    },
    "agents": {
      "support-agent": {
        "type": "agent",
        "path": "src/agents/support.ts",
        "description": "Customer support automation",
        "metadata": {
          "provider": "openai",
          "model": "gpt-4"
        }
      }
    },
    "configs": {
      "app-config": {
        "type": "config",
        "path": "config/app.json",
        "description": "Application configuration"
      }
    }
  }
}

Component Properties

type
string
required
Component type: function, agent, config, or custom type
path
string
required
Relative path from repository root to component file
description
string
Human-readable description of component purpose
dependencies
string[]
Array of component names this component depends on
"dependencies": ["queue-manager", "logger"]
metadata
object
Custom metadata specific to your use case
"metadata": {
  "runtime": "node18",
  "memory": "256MB",
  "any": "custom-field"
}

Environment-Specific Configuration

Use .env files for environment-specific settings:
OPENAI_API_KEY=sk-dev-...
EDGIT_DEBUG=true
EDGIT_LOG_LEVEL=debug
Load with:
# Development
source .env.development
edgit commit

# Production
source .env.production
edgit deploy component v1.0.0 --to production

Git Configuration

User-Specific Settings

Configure Edgit behavior in Git config:
# Set default component type
git config edgit.defaultType function

# Set AI provider
git config edgit.aiProvider openai

# Enable AI by default
git config edgit.aiEnabled true

# View all edgit config
git config --list | grep edgit

Repository-Specific Settings

# In repository root
cd /path/to/project

# Configure for this repo only
git config --local edgit.defaultType agent
git config --local edgit.tagPrefix release/

# View repo-specific config
git config --local --list | grep edgit

Component Type Configuration

Built-in Types

Edgit provides these built-in component types:
  • function
  • agent
  • config
For serverless functions, utilities, and callable code.
edgit add function process-payment src/functions/payment.ts
Common metadata:
{
  "runtime": "node18",
  "memory": "256MB",
  "timeout": "30s",
  "triggers": ["http", "queue"]
}

Custom Types

Add custom component types by using them in edgit add:
# Add custom type
edgit add workflow order-processing workflows/order.yaml

# The type is automatically recognized
edgit components list
# Output includes: workflow/order-processing
Custom types appear in the registry:
{
  "components": {
    "workflows": {
      "order-processing": {
        "type": "workflow",
        "path": "workflows/order.yaml",
        "description": "Order processing workflow"
      }
    }
  }
}

AI Provider Configuration

OpenAI (Default)

export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-4
export OPENAI_MAX_TOKENS=150

Custom Providers (Coming Soon)

Support for additional providers planned:
# Anthropic Claude
export AI_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...

# Azure OpenAI
export AI_PROVIDER=azure
export AZURE_OPENAI_KEY=...
export AZURE_OPENAI_ENDPOINT=https://...

Advanced Configuration

Deployment Environments

Define deployment environments in your registry:
{
  "version": "1.0",
  "environments": {
    "development": {
      "description": "Local development",
      "url": "http://localhost:3000"
    },
    "staging": {
      "description": "Staging environment",
      "url": "https://staging.example.com"
    },
    "production": {
      "description": "Production environment",
      "url": "https://example.com"
    }
  },
  "components": { ... }
}
Use with deployment commands:
edgit deploy component v1.0.0 --to staging
edgit deploy component v1.0.0 --to production

Component Dependencies

Define component dependencies to track relationships:
{
  "components": {
    "functions": {
      "email-processor": {
        "type": "function",
        "path": "src/functions/email.ts",
        "dependencies": ["queue-manager", "logger"]
      },
      "queue-manager": {
        "type": "function",
        "path": "src/utils/queue.ts"
      },
      "logger": {
        "type": "function",
        "path": "src/utils/logger.ts"
      }
    }
  }
}
View dependency tree:
edgit components show email-processor
# Output:
# Component: email-processor
# Dependencies:
#   - queue-manager (v2.0.0)
#   - logger (v1.5.0)

Configuration Best Practices

DO:
  • Use environment variables for API keys
  • Add .env to .gitignore
  • Use different keys for dev/staging/production
  • Rotate keys regularly
DON’T:
  • Commit API keys to Git
  • Share keys in plain text
  • Use production keys in development
DO:
  • Group related components
  • Use clear, descriptive names
  • Document component purpose
  • Keep paths relative to repo root
DON’T:
  • Use abbreviations without context
  • Mix different naming conventions
  • Include absolute paths
  • Leave descriptions empty
DO:
  • Follow semantic versioning
  • Tag stable releases
  • Document breaking changes
  • Use consistent tag format
DON’T:
  • Skip versions
  • Reuse version numbers
  • Delete published tags
  • Use non-semantic versions

Example Configurations

{
  "version": "1.0",
  "components": {
    "functions": {
      "auth": {
        "type": "function",
        "path": "packages/auth/src/index.ts",
        "description": "Authentication service",
        "metadata": {
          "runtime": "node18",
          "memory": "256MB"
        }
      },
      "payments": {
        "type": "function",
        "path": "packages/payments/src/index.ts",
        "description": "Payment processing",
        "dependencies": ["auth"],
        "metadata": {
          "runtime": "node18",
          "memory": "512MB"
        }
      }
    }
  }
}

Next Steps