Summary
The tail command can be consolidated into peek --follow by adding a single missing feature: --interval. This would simplify the codebase and provide a more consistent API.
Current State
| Feature |
tail |
peek --follow |
| Live updates |
✅ |
✅ |
| Custom interval |
✅ --interval <ms> |
❌ Hardcoded 1000ms |
| Network filter |
✅ --network |
✅ --network |
| Console filter |
✅ --console |
✅ --console |
| DOM filter |
❌ |
✅ --dom |
| Type filter |
❌ |
✅ --type |
Key difference: tail allows --interval 100 to --interval 60000 for custom update frequency.
Proposed Changes
Phase 1: Add --interval to peek --follow
// In peek.ts
.option('--interval <ms>', 'Update interval in milliseconds (only with --follow)', '1000')
Validation: 100ms min, 60000ms max (same as tail)
Phase 2: Deprecate tail with warning
$ bdg tail
⚠️ Deprecation: "bdg tail" is deprecated. Use "bdg peek --follow" instead.
# Continue working normally
Phase 3: Remove tail (next major version)
Remove tail.ts entirely. Users have had warning period.
Benefits
- Simpler codebase - Remove ~130 lines of duplicate logic in
tail.ts
- Consistent patterns -
peek uses runCommand, tail doesn't
- Better discoverability - One command with options vs two similar commands
- Feature parity -
peek --follow gains --interval, users get --dom and --type filters they didn't have with tail
Migration Path
# Before
bdg tail --interval 500 --network
# After
bdg peek --follow --interval 500 --network
Checklist
Labels
refactor
enhancement
good first issue (Phase 1 only)
Summary
The
tailcommand can be consolidated intopeek --followby adding a single missing feature:--interval. This would simplify the codebase and provide a more consistent API.Current State
tailpeek --follow--interval <ms>--network--network--console--console--dom--typeKey difference:
tailallows--interval 100to--interval 60000for custom update frequency.Proposed Changes
Phase 1: Add
--intervaltopeek --followValidation: 100ms min, 60000ms max (same as tail)
Phase 2: Deprecate
tailwith warningPhase 3: Remove
tail(next major version)Remove
tail.tsentirely. Users have had warning period.Benefits
tail.tspeekusesrunCommand,taildoesn'tpeek --followgains--interval, users get--domand--typefilters they didn't have withtailMigration Path
Checklist
--interval <ms>option topeekcommand (only active with--follow)setupFollowModeto accept interval parametertailcommandpeek --followtailin next major versionLabels
refactorenhancementgood first issue(Phase 1 only)