Skip to content

Add eko size command to report snapshot disk usage #108

Description

@kavix

🎯 Goal

Implement an eko size command that walks .eko/snapshots/ and reports disk usage per snapshot (in KB/MB/GB) as well as a grand total, so developers can understand how much storage their history is consuming.

💡 Expected Output

$ eko size
ID         Created              Size
8c9d1a2f   2026-08-08 20:11    42.3 MB
3b7f2a1e   2026-08-07 14:32    40.1 MB
1f4a9b0c   2026-08-06 10:05    39.8 MB
──────────────────────────────────────
Total: 3 snapshots · 122.2 MB

🛠️ Implementation Steps

  1. Create cmd/size.go with a Cobra command sizeCmd.
  2. Walk .eko/snapshots/<id>/ using filepath.WalkDir and sum file sizes.
  3. Format sizes with human-readable units (KB, MB, GB).
  4. Support --json flag for machine-readable output.
  5. Add unit tests in cmd/commands_test.go.

📖 See full details in GOOD_FIRST_ISSUES.md — Issue #14
🌟 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