examples/team-workflow/README.md
This example demonstrates how to use beads for team collaboration with shared repositories.
When working as a team on a shared repository, you want to:
Use bd init --team to set up team collaboration with automatic sync and optional protected branch support.
# In your shared repository
cd my-project
# Run the team setup wizard
bd init --team
The wizard will:
If your main branch is protected (GitHub/GitLab), the wizard will:
beads-metadata branch for issue updatesOther team members just need to:
# Clone the repository
git clone https://github.com/org/project.git
cd project
# Initialize beads (auto-imports existing issues)
bd init
# Start working!
bd ready
If main isn't protected:
# Create issue
bd create "Implement feature X" -p 1
# Dolt server auto-commits to main
# (or run 'bd dolt push' manually)
# Pull to see team's issues
git pull
bd list
If main is protected:
# Create issue
bd create "Implement feature X" -p 1
# Auto-commits to beads-metadata branch
# (or run 'bd dolt push' manually)
# Push beads-metadata
git push origin beads-metadata
# Periodically: merge beads-metadata to main via PR
The wizard configures:
team:
enabled: true
sync_branch: beads-metadata # or main if not protected
dolt:
auto-commit: on
# Enable team mode
bd config set team.enabled true
# Set sync branch
bd config set team.sync_branch beads-metadata
# Enable auto-commit
bd config set dolt.auto-commit on
# Alice creates an issue
bd create "Fix authentication bug" -p 1
# Auto-commits and pushes to main
# (auto-sync enabled)
# Bob pulls changes
git pull
bd list # Sees Alice's issue
# Bob claims it
bd update bd-abc --claim
# Auto-commits Bob's update
# Alice pulls and sees Bob is working on it
# Alice creates an issue
bd create "Add new API endpoint" -p 1
# Auto-commits to beads-metadata
git push origin beads-metadata
# Bob pulls beads-metadata
git pull origin beads-metadata
bd list # Sees Alice's issue
# Later: merge beads-metadata to main via PR
git checkout main
git pull origin main
git merge beads-metadata
# Create PR, get approval, merge
# See what everyone's working on
bd list --status in_progress
# See what's ready for work
bd ready
# See recently closed issues
bd list --status closed --limit 10
# Create sprint issues
bd create "Implement user auth" -p 1
bd create "Add profile page" -p 1
bd create "Fix responsive layout" -p 2
# Assign to team members
bd update bd-abc --assignee alice
bd update bd-def --assignee bob
# Track dependencies
bd dep add bd-def bd-abc --type blocks
# Create issue for PR work
bd create "Refactor auth module" -p 1
# Work on it
bd update bd-abc --claim
# Open PR with issue reference
git push origin feature-branch
# PR title: "feat: refactor auth module (bd-abc)"
# Close when PR merges
bd close bd-abc --reason "PR #123 merged"
The Dolt server commits and pushes automatically when auto-commit is enabled:
bd config set dolt.auto-commit on
bd dolt start
Benefits:
Push and pull when you want:
bd dolt push # Push local changes to remote
bd dolt pull # Pull remote changes locally
Benefits:
Hash-based IDs prevent most conflicts. Dolt handles merges natively using three-way merge, similar to git. If conflicts occur during bd dolt pull:
# View conflicts
bd sql "SELECT * FROM dolt_conflicts"
# Resolve by accepting ours or theirs
bd sql "CALL dolt_conflicts_resolve('--ours')"
# OR
bd sql "CALL dolt_conflicts_resolve('--theirs')"
# Complete the sync
bd dolt push
Create beads-metadata branch
git checkout -b beads-metadata
git push origin beads-metadata
Configure protection rules
Periodic PR workflow
# Once per day/sprint
git checkout main
git pull origin main
git checkout beads-metadata
git pull origin beads-metadata
git checkout main
git merge beads-metadata
# Create PR, get approval, merge
Keep beads-metadata clean
# After PR merges
git checkout beads-metadata
git rebase main
git push origin beads-metadata --force-with-lease
A: Issues are stored in Dolt, which supports distributed sync. Use bd dolt pull to fetch and bd dolt push to share changes.
bd dolt pull
bd list # See everyone's issues
A: Hash-based IDs prevent collisions. Even if created simultaneously, they get different IDs.
A: Turn it off:
bd config set dolt.auto-commit off
# Sync manually
bd dolt push
bd dolt pull
A: Not recommended. Use a single shared branch for consistency. If needed:
bd config set sync.branch my-custom-branch
A: Add to your CI pipeline:
# In .github/workflows/main.yml
- name: Sync beads issues
run: |
bd dolt push
git push origin beads-metadata
Check server status:
bd doctor
Verify config:
bd config get dolt.auto-commit
Restart Dolt server:
bd dolt stop
bd dolt start
Dolt handles merges natively. If conflicts occur during sync:
bd sql "SELECT * FROM dolt_conflicts"
bd sql "CALL dolt_conflicts_resolve('--ours')"
bd dolt push
See GIT_INTEGRATION.md for details.
Manually sync:
bd dolt push
bd dolt pull
Check for conflicts:
git status
bd validate --checks=conflicts