Skip to content

moq-cli: rename --output to --format, --name to --broadcast, add accept subcommand#1395

Open
kixelated wants to merge 2 commits into
mainfrom
moq-cli-args-cleanup
Open

moq-cli: rename --output to --format, --name to --broadcast, add accept subcommand#1395
kixelated wants to merge 2 commits into
mainfrom
moq-cli-args-cleanup

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

@kixelated kixelated commented May 9, 2026

Summary

  • Rename --output--format on subscribe for symmetry with publish. OutputFormat enum becomes SubscribeFormat.
  • Rename --name--broadcast on every subcommand; the old --name is kept as a hidden alias for backwards compatibility.
  • --max-latency now accepts humantime durations (500ms, 1s) instead of a bare millisecond integer.
  • Add a new accept subcommand: the server-side counterpart of subscribe. Runs a relay and writes the first incoming broadcast's media to stdout.
  • Add doc comments to every Command variant so --help no longer leaks the flattened struct's about text on serve / publish.
  • Update the README, which was several releases out of date.

CLI surface now:

```
moq-cli serve --broadcast N [--dir D] <fmp4|avc3|hls --playlist P>
moq-cli accept --broadcast N [--dir D] --format fmp4 [--max-latency 500ms]
moq-cli publish --url U --broadcast N <fmp4|avc3|hls --playlist P>
moq-cli subscribe --url U --broadcast N --format fmp4 [--max-latency 500ms]
```

Manual patch bump to `0.7.22` since release-plz uses cargo-semver-checks, which only inspects library API. Binary CLI surface changes aren't auto-detected, so the bump won't happen on its own.

Test plan

  • `just check` passes
  • `--help` text reads cleanly on all four subcommands (no leaked "Configuration for the MoQ ..." about text)
  • `subscribe --name foo --format fmp4 --url https://...` parses (`--name` alias still works); log shows `broadcast=foo`
  • `--max-latency 500ms` parses
  • Smoke test `accept` against a live publisher locally

🤖 Generated with Claude Code

…pt subcommand

- Rename `--output` to `--format` on subscribe for symmetry with publish; OutputFormat enum becomes SubscribeFormat
- Rename `--name` to `--broadcast` on every subcommand; old `--name` kept as a hidden alias for backwards compatibility
- `--max-latency` now accepts humantime durations (e.g. `500ms`, `1s`) instead of bare millisecond integers
- Add new `accept` subcommand: server-side counterpart of `subscribe`. Runs a relay and writes the first incoming broadcast's media to stdout
- Add doc comments to every Command variant so `--help` no longer leaks the flattened struct's about text
- Update README to match the actual CLI surface (was several releases out of date)

Bumped moq-cli to 0.8.0 since the flag rename and parser change are breaking. release-plz uses cargo-semver-checks which only inspects library API, so binary CLI surface changes need a manual minor bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0bf22c03-8ac7-41b2-a9eb-c15fb27c51aa

📥 Commits

Reviewing files that changed from the base of the PR and between 561258f and 440c334.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • rs/moq-cli/Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • rs/moq-cli/Cargo.toml

Walkthrough

This PR releases moq-cli version 0.8.0 with three major changes: a new Accept subcommand that accepts inbound MoQ sessions, a refactored subscribe latency configuration from millisecond integers to human-readable Duration strings (default 500ms), and a standardized broadcast identifier argument (--broadcast with --name alias) across all commands. The humantime 2.3 dependency is added to support duration string parsing. Documentation is updated with examples for all modes: publish/subscribe to remote relays, and self-hosted serve/accept workflows.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: renaming CLI flags (--output to --format, --name to --broadcast) and adding the accept subcommand.
Description check ✅ Passed The description is well-related to the changeset, providing detailed explanations of the flag renames, new subcommand, duration parsing changes, and updated documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch moq-cli-args-cleanup
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch moq-cli-args-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rs/moq-cli/src/main.rs`:
- Around line 52-53: Update the doc comment for the Accept enum variant so it
accurately describes current behavior: state that it runs a relay and writes the
media of the first incoming broadcast that matches the name provided via
--broadcast to stdout (rather than any "first incoming broadcast"); edit the
comment on the Accept variant in main.rs to mention the --broadcast filter
explicitly and that it waits for the specified broadcast name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18f310ba-993d-4ae0-91fd-038fd4827f32

📥 Commits

Reviewing files that changed from the base of the PR and between 6adf3c3 and 561258f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • rs/moq-cli/Cargo.toml
  • rs/moq-cli/README.md
  • rs/moq-cli/src/main.rs
  • rs/moq-cli/src/server.rs
  • rs/moq-cli/src/subscribe.rs

Comment thread rs/moq-cli/src/main.rs
Comment on lines +52 to +53
/// Run a relay and write the first incoming broadcast's media to stdout.
Accept {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify accept help text to reflect --broadcast filtering.

The current text says "first incoming broadcast", but runtime behavior waits for the broadcast named by --broadcast. Please make that explicit to avoid misleading --help output.

Proposed wording update
-	/// Run a relay and write the first incoming broadcast's media to stdout.
+	/// Run a relay and write media for the incoming `--broadcast` to stdout.

As per coding guidelines, "Comments must reflect the current state of the code, not its history. Don't write historical context; describe what the code does today or delete the comment."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// Run a relay and write the first incoming broadcast's media to stdout.
Accept {
/// Run a relay and write media for the incoming `--broadcast` to stdout.
Accept {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rs/moq-cli/src/main.rs` around lines 52 - 53, Update the doc comment for the
Accept enum variant so it accurately describes current behavior: state that it
runs a relay and writes the media of the first incoming broadcast that matches
the name provided via --broadcast to stdout (rather than any "first incoming
broadcast"); edit the comment on the Accept variant in main.rs to mention the
--broadcast filter explicitly and that it waits for the specified broadcast
name.

Patch bump only, matching the project's existing version policy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant