Skip to content

refactor: Deprecate tail command in favor of peek --follow #115

@szymdzum

Description

@szymdzum

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

  1. Simpler codebase - Remove ~130 lines of duplicate logic in tail.ts
  2. Consistent patterns - peek uses runCommand, tail doesn't
  3. Better discoverability - One command with options vs two similar commands
  4. 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

  • Add --interval <ms> option to peek command (only active with --follow)
  • Update setupFollowMode to accept interval parameter
  • Add deprecation warning to tail command
  • Update documentation (CLI_REFERENCE.md, CLAUDE.md)
  • Update task mappings to point to peek --follow
  • Remove tail in next major version

Labels

  • refactor
  • enhancement
  • good first issue (Phase 1 only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersrefactorCode improvement without new features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions