Skip to content

feat(cli): add durationSeconds to project validate and inspect - #2556

Merged
richiemcilroy merged 3 commits into
CapSoftware:mainfrom
sloemo01:feat/cli-project-duration
Oct 21, 2026
Merged

richiemcilroy merged 3 commits into
CapSoftware:mainfrom
sloemo01:feat/cli-project-duration

Conversation

@sloemo01

@sloemo01 sloemo01 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2059.

Surfaces the project duration in the CLI and closes the two gaps from the issue: durationSeconds in the project JSON, and export-preview listed in cap guide.

Changes:

  • cap project validate and cap project inspect emit durationSeconds for Studio recordings, computed through the existing cap_rendering::get_duration. The field is omitted when the value can't be computed, like Instant recordings or unreadable media.
  • Text output for both commands gained a duration: <s>s line.
  • cap guide lists export-preview.

An earlier commit on this branch converted ProjectRecordingsMeta::new's panics on unreadable single-segment media into returned errors, so that validate could not abort on a damaged project. Main has since made the same change with more specific messages ("video / ...", "camera / ..."), so the rebase drops that commit and the PR is CLI-only now. The missing-media tests still pass against main's version.

Verification on the rebased head (cc38611):

  • cargo test -p cap --test cli project_: 12 passed, including the complete-project, missing-media, and unreadable-media cases.
  • cargo fmt --all --check clean.
  • Both commands run against a real ~8 minute Studio recording: durationSeconds: 473.137167.
  • cap guide --json includes export-preview.

Not included: the --frames-at / --out-dir frame-file mode from the issue, which can be a separate PR.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

Adds project duration to cap project validate and cap project inspect.

  • Project commands show the length of readable Studio recordings.
  • The CLI guide lists export-preview with its JSON output details.

Review used source checks; no tests were run.

Reviews (5) · Last reviewed commit: "fix(cli): report export-preview as alway..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@sloemo01 is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread apps/cli/src/guide.rs
Comment thread apps/cli/src/project.rs
@richiemcilroy

Copy link
Copy Markdown
Member

Thanks for the PR. Greptile currently has this at 4/5, and we only merge PRs once Greptile scores the current head 5/5. Please address the remaining Greptile feedback, then comment @greptileai to request a re-review, and repeat until it reaches 5/5.

@sloemo01

Copy link
Copy Markdown
Contributor Author

Thanks for the PR. Greptile currently has this at 4/5, and we only merge PRs once Greptile scores the current head 5/5. Please address the remaining Greptile feedback, then comment @greptileai to request a re-review, and repeat until it reaches 5/5.

Working on it brother 🫡
Might as well do a bit more im kind of enjoying it lol

@sloemo01

Copy link
Copy Markdown
Contributor Author

@greptileai

@sloemo01
sloemo01 force-pushed the feat/cli-project-duration branch from 503c647 to 6dc25be Compare October 14, 2026 07:13
@sloemo01

Copy link
Copy Markdown
Contributor Author

@greptileai

@sloemo01

Copy link
Copy Markdown
Contributor Author

@richiemcilroy the red Windows check is sorted: it compares against the PR's stored base commit, which had gone stale, so I rebased onto main. Greptile re-reviewed the new head at 5/5, and the re-run is queued at the approval gate. Ready for another look when you get a chance.

Emits durationSeconds for studio recordings in project validate/inspect
JSON and text output, and lists export-preview in cap guide.

Part of CapSoftware#2059
The guide listed export-preview as SingleJson even though the command always writes JSON, and no test checked durationSeconds, so duration reporting could break silently. The entry now uses AlwaysJson.

New CLI tests encode a one-second fixture and assert the reported durationSeconds on both validate and inspect, plus that unreadable media omits the field.
@sloemo01
sloemo01 force-pushed the feat/cli-project-duration branch from 6dc25be to cc38611 Compare October 19, 2026 17:30
@sloemo01

Copy link
Copy Markdown
Contributor Author

Rebased onto current main, head is cc38611.

The only conflict was the panic fix in ProjectRecordingsMeta::new, and main already landed the same change with more specific messages ("video / ...", "camera / ..."). So that commit drops out and this PR is CLI-only now. The missing-media tests pass against main's version.

On the new head: cargo test -p cap --test cli project_ 12 passed, cargo fmt --all --check clean.

Runs are parked at the approval gate again, and Greptile is re-reviewing this head.

@sloemo01

Copy link
Copy Markdown
Contributor Author

@greptileai

1 similar comment
@sloemo01

Copy link
Copy Markdown
Contributor Author

@greptileai

@sloemo01

Copy link
Copy Markdown
Contributor Author

@richiemcilroy rebased onto today's main, head is cc38611, Greptile 5/5 on the new head. The runs are parked at the approval gate and need a click before they run. Otherwise this one is ready.

@sloemo01

Copy link
Copy Markdown
Contributor Author

Rebased yesterday evening and Greptile is 5/5 on cc38611. The checks are still sitting at the approval gate, so nothing has run yet and they need a click from you. Nothing else outstanding on my side.

@sloemo01

Copy link
Copy Markdown
Contributor Author

Quick nudge: main has moved three times since the rebase (#2583, #2533, #2535), and cc38611 still merges clean with Greptile 5/5 on it. All five checks are still parked at the approval gate, so nothing has actually run on this head yet. A click on the runs and they're off.

@richiemcilroy
richiemcilroy merged commit 4cacde7 into CapSoftware:main Oct 21, 2026
99 of 113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants