Skip to content

feat: Add CLI, restructure project, pip packaging#1043

Merged
WEIFENG2333 merged 5 commits intomasterfrom
feat/improve-ux-and-scripts
Mar 22, 2026
Merged

feat: Add CLI, restructure project, pip packaging#1043
WEIFENG2333 merged 5 commits intomasterfrom
feat/improve-ux-and-scripts

Conversation

@WEIFENG2333
Copy link
Copy Markdown
Owner

Summary

  • Project restructure: app/videocaptioner/ with clean three-layer architecture (core/ + cli/ + ui/)
  • New CLI: 6 commands — transcribe, subtitle, synthesize, process, download, config
  • pip packaging: pip install videocaptioner (CLI) / pip install videocaptioner[gui] (CLI+GUI)
  • Unified entry point: videocaptioner opens GUI if installed, otherwise shows CLI help
  • TOML config system: ~/.config/videocaptioner/config.toml with env var + CLI arg override
  • 50 CLI unit tests, 291 total tests passing
  • 13 core bug fixes (translation closure bug, cache corruption, shell injection, HTTPS, etc.)
  • PyPI trusted publishing via GitHub Actions
  • Claude Code Skill for AI agent integration
  • Docs rewritten: README (中文), CLI docs, CLAUDE.md

Breaking Changes

  • Package renamed from app to videocaptioner — all imports changed
  • main.py removed — use videocaptioner command or uv run videocaptioner instead
  • legacy-docs/ removed — content migrated to docs site

Test Plan

  • uv run ruff check videocaptioner/ — 0 errors
  • uv run pyright videocaptioner/cli/ — 0 errors
  • uv run pytest tests/test_cli/ — 50 passed
  • CLI end-to-end: bijian transcribe + bing translate verified
  • GUI launches via uv run videocaptioner (no args)
  • pip install -e . and pip install -e '.[gui]' verified

🤖 Generated with Claude Code

liangweifeng and others added 5 commits February 26, 2026 00:59
…ansion bugs

- run.sh: Add install_git(), install_ffmpeg() with Homebrew/apt/dnf/pacman support
- run.sh: Add BASH_SOURCE guard for curl|bash usage, add error trap, use shallow clone
- run.bat: Add install_git and install_ffmpeg via winget with PATH refresh
- run.bat: Fix %CD% -> !CD! delayed expansion bug inside if blocks
- run.bat: Unify %errorlevel% -> !errorlevel! for delayed expansion consistency

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…drop support

- platform_utils: Add reveal_in_explorer() to highlight file in system file manager
- subtitle_interface: Open and select file after saving subtitle
- subtitle_interface: Add delete rows via right-click menu and Delete key
- batch_process_interface: Support folder drag-drop with 3-level depth scanning
- batch_process_interface/log_window: Replace hardcoded open-folder logic with platform_utils

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…tor creation

- Add RetranslateThread for lightweight retranslation of selected subtitle rows
- Add right-click menu "重新翻译" (Ctrl+T) with concurrent operation protection
- Refactor SubtitleThread to use TranslatorFactory via create_translator_from_config()
- Save table edits back to file before starting full processing to preserve user changes
- Fix QAccessibleTable invalid index warning by clearing selection before model updates
- Suppress qfluentwidgets Pro advertisement on startup

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Introduced a progress signal in RetranslateThread to report translation progress as a percentage.
- Updated the translator creation to utilize a callback for progress updates.
- Enhanced the SubtitleInterface to connect the new progress signal to the optimization progress handler.

These changes improve user feedback during the subtitle retranslation process.
…aging

Major changes:
- Restructure: app/ → videocaptioner/ (core/ + cli/ + ui/ three-layer architecture)
- New CLI: 6 commands (transcribe, subtitle, synthesize, process, download, config)
- Packaging: pip install videocaptioner (CLI) / videocaptioner[gui] (CLI+GUI)
- Single entry: `videocaptioner` opens GUI if installed, otherwise shows CLI help
- Config: TOML-based (~/.config/videocaptioner/config.toml) with env var + CLI override
- Tests: 50 CLI unit tests, 291 total tests passing
- Docs: README rewritten, CLI docs (docs/cli.md), Claude Code Skill (skills/SKILL.md)
- CI: GitHub Actions workflow for PyPI trusted publishing
- Cleanup: removed legacy-docs/, CHANGELOG.md, main.py; .gitignore rewritten

Core bug fixes:
- Fix _parallel_translate closure bug (wrong chunk on error recovery)
- Fix LLM translator implicit None return being cached for 7 days
- Fix bilingual SRT detection hardcoded /50 denominator
- Fix merge_segments losing translated_text
- Fix Bing translator unbound response variable
- Fix shell injection in platform_utils (shell=True)
- Fix Google Translate using HTTP instead of HTTPS
- Fix ASS subtitle path escaping inconsistency
- Fix video_utils subtitle filter checking output extension instead of subtitle extension
- Fix MyVideoWidget _formatTime minutes overflow
- Fix datetime.utcnow() deprecation in jianying ASR
- Fix GPUtil hard import crashing CLI-only installs
- Fix diskcache deserialization crash on package rename (graceful degradation)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@claude
Copy link
Copy Markdown

claude bot commented Mar 22, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@WEIFENG2333 WEIFENG2333 merged commit 0da91eb into master Mar 22, 2026
1 check failed
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