This guide provides essential tutorials and examples for using GitCo effectively.
- Python 3.9+ installed
- Git installed and configured
- GitHub account with access to repositories
- LLM API key (OpenAI)
# Install GitCo
pip install gitco
# Initialize with interactive setup
gitco init --interactive
# Set up API keys
export OPENAI_API_KEY="your-openai-api-key"
export GITHUB_TOKEN="your-github-token"Edit ~/.gitco/config.yml:
repositories:
- name: django
fork: your-username/django
upstream: django/django
local_path: ~/code/django
skills: [python, web, orm]
settings:
llm_provider: openai
default_path: ~/code# Sync with a single repository
gitco sync --repo django
# Get AI analysis of changes
gitco analyze --repo django
# Find contribution opportunities
gitco discover# Quick sync of all repositories
gitco sync --batch --quiet
# Check repository health
gitco status --overview
# Find new opportunities
gitco discover --limit 3# Full sync with analysis
gitco sync --batch --analyze --export weekly-sync.json
# Activity analysis
gitco activity --detailed --export weekly-activity.json
# Contribution statistics
gitco contributions stats --days 7 --export weekly-stats.json# Find all opportunities
gitco discover
# Find Python-specific opportunities
gitco discover --skill python
# Find beginner-friendly issues
gitco discover --label "good first issue"# Sync your contribution history
gitco contributions sync-history --username yourusername
# Get personalized recommendations
gitco discover --personalized
# Show contribution history
gitco discover --show-history# Add to crontab (crontab -e)
# Sync repositories every 6 hours
0 */6 * * * /usr/bin/gitco sync --batch --quiet --log /var/log/gitco/sync.log
# Daily health check at 9 AM
0 9 * * * /usr/bin/gitco status --overview --quiet --export /var/log/gitco/daily-status.jsonCreate .github/workflows/gitco-maintenance.yml:
name: GitCo Maintenance
on:
schedule:
- cron: '0 9 * * *' # Daily at 9 AM
workflow_dispatch:
jobs:
gitco-sync:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install GitCo
run: pip install gitco
- name: Setup environment
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Sync repositories
run: gitco sync --batch --quiet --export sync-results.json
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: gitco-sync-results
path: sync-results.json# Validate configuration
gitco config validate
# Check configuration status
gitco config status# Check repository status
cd ~/code/django
git status
# Resolve conflicts manually
git merge --abort
git reset --hard HEAD
git clean -fd# Check rate limit status
gitco github rate-limit-status
# Wait for rate limit reset or use GitHub token# Check API key
echo $OPENAI_API_KEY
# Check API connection
curl -H "Authorization: Bearer $OPENAI_API_KEY" https://api.openai.com/v1/models# Enable verbose output
gitco sync --verbose
# Enable detailed logging
gitco sync --detailed-log --log-file debug.log- Use consistent naming conventions
- Group repositories by technology
- Tag repositories with relevant skills
- Regular maintenance and sync
- Keep configuration in version control
- Use environment variables for sensitive data
- Run configuration validation regularly
- Create backups of your configuration
- Start with a few repositories and expand gradually
- Monitor logs regularly for issues
- Set up alerts for sync failures
- Create regular backups
- Monitor API usage and performance
For more detailed examples and advanced workflows, see the Examples Guide and Workflows Guide.