Skip to content

Add eko diff <id1> <id2> terminal file diff command #100

Description

@kavix

🎯 Goal

Add an eko diff subcommand that displays line-by-line unified colored diffs between two snapshot points directly in the terminal interface.

💡 Expected Usage

# Compare latest snapshot with predecessor
eko diff

# Compare specific snapshot with current workspace
eko diff 8c9d1a2f

# Compare two specific snapshots
eko diff 3b7f2a1e 8c9d1a2f

🛠️ Implementation Steps

  1. Create cmd/diff.go with Cobra command diffCmd.
  2. Integrate a lightweight Go diff algorithm (e.g. sergi/go-diff or stdlib text comparison).
  3. Print unified git-style + / - colored line diffs.
  4. Add unit tests in cmd/commands_test.go.

📖 See full details in GOOD_FIRST_ISSUES.md — Issue #6
🌟 Great for first-time contributors! Read CONTRIBUTING.md to get started.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions