Skip to content

Rewrite the CLI in Rust with the shared youtubei crate and native FFmpeg - #8

Merged
meoyawn merged 6 commits into
masterfrom
codex/rewrite-cli-rust
Sep 24, 2026
Merged

meoyawn merged 6 commits into
masterfrom
codex/rewrite-cli-rust

Conversation

@meoyawn

@meoyawn meoyawn commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Rewrite the CLI in Rust/Cargo while retaining browser authorization, shows/artwork, episodes, resumable uploads, membership, and RSS/YouTube imports. Oasmith generates the public API client and CLIConfig; production defaults are compiled into the binary, and E2Es use validated YAML overrides.

YouTube extraction uses the shared listenbox/youtubei crate pinned to a394160a92d3809bde4d4376d480373bc44ae82e. Rust owns playlist traversal, format selection, HTTP transport and cancellation. The crate downloads the published YouTube.js 18.1.0 CF-worker bundle from its npm archive, verifies both SHA-256 values, and embeds it through QuickJS. Generated JavaScript stays in Cargo's ignored output directory.

The CLI repository has no TypeScript sources, JavaScript package manifests/lockfiles, Nub/Bun dependencies, or bundling tasks. Python's standard library prepares checksum-verified FFmpeg 9.0.2; ffmpeg-the-third statically links its libraries. Building or running the CLI requires no JavaScript toolchain or external FFmpeg/FFprobe executable.

Benchmark rerun on 2026-09-24: Go 3d0f569 versus Rust 637e7c2, including the shared youtubei crate and published YouTube.js 18.1.0 CF-worker bundle.

Metric Go Rust Rust vs. Go
Wall time, including startup 350 ms 484 ms +38.2%
CPU time (user + system) 200 ms 313 ms +56.5%
CPU utilization 56.3% 65.6% +9.2 pp
Peak RAM (RSS) 30.1 MiB 34.0 MiB +12.8%
Binary size 21.6 MiB 19.9 MiB -7.8%

Each runtime figure is the median of 20 complete imports after four warmups per build, with balanced Go/Rust/Rust/Go order. Both are stripped release builds with static FFmpeg 9.0.2, on the same eight-vCPU Linux x86-64 host. The local fixture exercises 1080p AVC + Opus download, AAC transcoding, MP4/HLS packaging, upload and successful publication; all 48 imports passed publication and Opus-download checks. Wall time includes startup. CPU and peak RSS cover only the CLI process, excluding backend services; 100% CPU utilization means one occupied core. Deltas use unrounded medians; pp means percentage points. This short local fixture does not measure live YouTube latency, signature challenges or long-video memory use.

Methodology and reproduction · Raw samples and binary hashes · Host and build details.

Validation:

  • cli:check: formatting, Clippy, unit tests, debug smoke test, release build and package passed.
  • API integration: 64 CLI tests/subtests passed, including playlist imports, AVC/Opus conversion, quota rejection, partial-upload cleanup, interruption after admission, and lost completion acknowledgements. All six YouTube scenarios finished in under ten seconds.
  • Fresh standalone checkout with no native/Cargo outputs: cli:smoke and cli:test passed with Node, Nub, Bun and esbuild blocked on PATH.
  • Shared crate: 15 runtime tests and Clippy passed; Git and Cargo package contents exclude the bundle. Workflow actionlint passed.

Full workspace verification was not rerun; the previously reported RSS import deadlock is outside this change. Tests use local fixtures, without live YouTube or cross-platform release validation.

Related: workspace integration #88, Oasmith Rust generation #14, and Mazit shared dependency #2. The Go baseline from #7 is already merged.

@meoyawn
meoyawn changed the base branch from codex/go-cli-astiav to master September 24, 2026 16:47
@meoyawn meoyawn changed the title Rewrite the CLI in Rust with embedded YouTube.js and FFmpeg Rewrite the CLI in Rust with the shared youtubei crate and native FFmpeg Sep 24, 2026
@meoyawn
meoyawn merged commit b5f0986 into master Sep 24, 2026
1 check passed
@meoyawn
meoyawn deleted the codex/rewrite-cli-rust branch September 27, 2026 01:54
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