README
ΒΆ
π¬ Movie CLI
Personal movie & TV show library manager β from the terminal
Scan folders, clean filenames, fetch TMDb metadata, organize files, and track your collection.
Quick Start
Install latest release
Picks up whatever is currently tagged latest on GitHub β and if no release has been published yet, automatically falls back to a source-build from main so you still end up with a working binary.
Windows (PowerShell)
irm https://raw.githubusercontent.com/alimtvnetwork/movie-cli-v6/main/get.ps1 | iex
Linux / macOS
curl -fsSL https://raw.githubusercontent.com/alimtvnetwork/movie-cli-v6/main/get.sh | bash
get.ps1/get.shfirst probereleases/latest/download/install.{ps1,sh}. If that returns 200 it installs the pre-built binary. If it 404s (no release published yet) it transparently falls back to cloning + building from source viainstall.{ps1,sh}onmain. Either way you get a clear message telling you which path was taken and what to do next.
Install a specific version (pinned)
Installs exactly the version in the URL β never auto-upgrades. Use this for CI pipelines, Dockerfiles, reproducible setups, or when you need to roll back. Replace v2.130.0 with the release tag you want.
Windows (PowerShell)
irm https://github.com/alimtvnetwork/movie-cli-v6/releases/download/v2.130.0/install.ps1 | iex
Linux / macOS
curl -fsSL https://github.com/alimtvnetwork/movie-cli-v6/releases/download/v2.130.0/install.sh | bash
Which one should I use? Use latest for personal machines so you stay current. Use pinned anywhere reproducibility matters β the pinned script is hard-locked to the version in the URL and will install that exact tag forever, even after newer releases ship. (contract spec)
Set up & scan
movie config set tmdb_api_key YOUR_KEY
movie scan ~/Downloads
movie ls
Search & discover
movie search "Inception"
movie suggest 5
Every command supports --help or -h for detailed usage.
π₯ Demo
π Scanning a Folder
$ movie scan ~/Downloads
π Scanning: /home/user/Downloads
βββββββββββββββββββββββββββββββββββ
Found 12 video files
[1/12] Scream.2022.1080p.WEBRip.x264-RARBG.mkv
β Title: Scream (2022)
β TMDb: β
6.8 | Horror, Mystery, Thriller
β Poster saved: thumbnails/scream-2022/scream-2022.jpg
β
Saved to database
[2/12] The.Batman.2022.2160p.BluRay.x265.mkv
β Title: The Batman (2022)
β TMDb: β
7.7 | Crime, Mystery, Thriller
β Poster saved: thumbnails/the-batman-2022/the-batman-2022.jpg
β
Saved to database
...
β
Done β 12 items scanned, 11 new, 1 updated
β Replace with actual recording
π Browsing Your Library
$ movie ls
π¬ Library β Page 1 of 3 (20 per page)
βββββββββββββββββββββββββββββββββββββββββββββββββββ
# Title Year Type Rating
βββ ββββββββββββββββββββββββββββββ ββββββ βββββββ ββββββ
1 Scream 2022 π¬ β
6.8
2 The Batman 2022 π¬ β
7.7
3 Everything Everywhere All... 2022 π¬ β
7.8
4 Breaking Bad 2008 πΊ β
8.9
5 Severance 2022 πΊ β
8.4
...
[N]ext [P]rev [1-9] Detail [Q]uit
β Replace with actual recording
π― Getting Suggestions
$ movie suggest 5
π― Movie Suggest
βββββββββββββββββββββββββββββββββββ
Select category:
1. π¬ Movie
2. πΊ TV
3. π² Random
Choose: 1
π½οΈ Recommendations based on your library:
# Title Year Rating Genre
βββ ββββββββββββββββββββββββββββββ ββββββ ββββββββ ββββββββββββββββ
1 Nope 2022 β
6.8 Horror, Sci-Fi
2 X 2022 β
6.6 Horror, Mystery
3 Pearl 2022 β
7.0 Drama, Horror
4 Bodies Bodies Bodies 2022 β
6.5 Comedy, Horror
5 Barbarian 2022 β
7.0 Horror, Thriller
π₯ Trending This Week:
1 Oppenheimer 2023 β
8.1 Drama, History
2 Killers of the Flower Moon 2023 β
7.5 Crime, Drama
3 Poor Things 2023 β
7.9 Comedy, Drama
β Replace with actual recording
πΉ Recording your own demos: Use VHS or asciinema to record terminal sessions as GIFs.
# VHS (recommended β deterministic, scriptable) vhs docs/screenshots/scan.tape # asciinema + agg (manual recording) asciinema rec demo.cast agg demo.cast docs/screenshots/demo-scan.gif
Installation
One-Liner Install (recommended)
Two flavours β pick based on whether you want auto-updates or a frozen version.
Latest release (auto-tracks newest)
Windows (PowerShell)
irm https://raw.githubusercontent.com/alimtvnetwork/movie-cli-v6/main/get.ps1 | iex
Linux / macOS (Bash)
curl -fsSL https://raw.githubusercontent.com/alimtvnetwork/movie-cli-v6/main/get.sh | bash
get.{ps1,sh} first checks releases/latest/download/install.{ps1,sh}. If a release is published it installs the pre-built binary; otherwise it falls back to a source-build from main, prints exactly which path it took, and tells the maintainer how to publish a release so future installs skip the build step.
Pinned to a specific release
Windows (PowerShell)
irm https://github.com/alimtvnetwork/movie-cli-v6/releases/download/v2.130.0/install.ps1 | iex
Linux / macOS (Bash)
curl -fsSL https://github.com/alimtvnetwork/movie-cli-v6/releases/download/v2.130.0/install.sh | bash
The script attached to each release has the version baked in (PINNED_VERSION="v2.130.0") and will install exactly that tag β it never falls back to "latest" and never delegates to the bootstrap scripts. Replace v2.130.0 with any published release.
When to use which
- Latest β personal machines, demos, "just give me the newest one"
- Pinned β CI pipelines, Dockerfiles, onboarding docs, reproducing a bug on a specific version, controlled rollbacks
Both URLs point at installer assets attached to the GitHub Release. The repo-root
install.ps1andinstall.share unrelated source bootstrap scripts for building locally.
Installer Options
Windows (PowerShell):
| Flag | Description | Example |
|---|---|---|
-InstallDir |
Custom install directory | -InstallDir C:\tools\movie |
-Arch |
Force architecture (amd64, arm64) |
-Arch arm64 |
-NoPath |
Skip adding to user PATH | -NoPath |
Linux / macOS (Bash):
| Flag | Description | Example |
|---|---|---|
--dir |
Custom install directory | --dir ~/bin |
--arch |
Force architecture (amd64, arm64) |
--arch arm64 |
--no-path |
Skip adding to PATH | --no-path |
Clone & Build (Development)
Prerequisites:
| Requirement | Minimum | Check |
|---|---|---|
| Go | 1.22+ | go version |
| Git | 2.x | git --version |
| PowerShell | 5.1+ (Win) / 7+ (Unix) | $PSVersionTable.PSVersion |
git clone https://github.com/alimtvnetwork/movie-cli-v6.git
cd movie-cli-v6
pwsh run.ps1
Using the bootstrap installer:
pwsh install.ps1 # Fresh install (clone + build + deploy)
pwsh install.ps1 -DeployPath ~/bin # Custom deploy path
Verify
movie version
# v1.0.0 (commit: abc1234, built: 2026-04-09)
# Go: go1.22.0
# OS: linux/amd64
Tip: If
movieis not found, add the deploy path to yourPATH. Default:E:\bin-run(Windows) or/usr/local/bin(Unix) for source builds.
What It Does
A portable CLI that manages your personal movie and TV show library entirely from the terminal. Every scan produces:
- Database β structured metadata in SQLite (WAL mode)
- Thumbnails β poster images downloaded from TMDb
- JSON β per-file metadata written to
./data/json/ - Clean filenames β
Scream.2022.1080p.WEBRip.x264.mkvβScream (2022).mkv
All data lives in ./data/ at the project root.
Command Reference
Scanning & Library
| Command | Description |
|---|---|
movie scan [folder] |
Scan folder β DB + TMDb metadata |
movie rescan |
Re-fetch TMDb metadata for entries with missing data |
movie ls |
Paginated interactive library browser |
movie search <name> |
Live TMDb search β save to DB |
movie info <id|title> |
Detail view (local DB β TMDb fallback) |
movie scan ~/Downloads # scan folder, fetch metadata + posters
movie rescan # re-fetch missing genres/ratings from TMDb
movie ls # browse library with pagination
movie search "Inception" # search TMDb and save result
movie info 1 # show details for media ID 1
movie info "The Batman" # search by title
File Management
| Command | Description |
|---|---|
movie move [directory] |
Browse, select, move with clean name |
movie move --all |
Batch move all files (auto-route by type) |
movie rename |
Batch rename to clean format |
movie popout [directory] |
Extract video files from subfolders to root |
movie play <id> |
Open with default video player |
movie cd [folder-name] |
Print path of a scanned folder for quick nav |
movie move ~/Downloads # interactive single-file move
movie move --all ~/Downloads # batch move all files
movie rename # clean all filenames
movie popout ~/Downloads # flatten nested subfolders
movie play 1 # play with system player
cd $(movie cd Movies) # navigate to scanned folder
History & Undo
| Command | Description |
|---|---|
movie undo |
Revert last move/rename/delete/scan operation |
movie undo --list |
Show recent undoable actions |
movie undo --batch |
Undo the entire last batch (e.g. a full scan) |
movie undo --id <id> |
Undo a specific action by ID |
movie redo |
Re-apply the last undone operation |
movie history |
Show history of all tracked operations |
movie undo # revert most recent operation
movie undo --list # see what can be undone
movie undo --batch # undo entire last scan batch
movie undo --id 42 # undo specific action
movie redo # re-apply last undone operation
movie history # view full operation history
Discovery & Organization
| Command | Description |
|---|---|
movie suggest [N] |
Genre-based recommendations + trending |
movie discover [genre] |
Browse TMDb by genre (interactive picker or direct) |
movie tag add <id> <tag> |
Add a tag to a media item |
movie tag remove <id> <tag> |
Remove a tag |
movie tag list [id] |
List tags (per item or all) |
movie watch add <id> |
Add a library item to your watchlist |
movie watch done <id> |
Mark a title as watched |
movie watch undo <id> |
Revert a title back to to-watch |
movie watch rm <id> |
Remove a title from your watchlist |
movie watch ls |
List your watchlist |
movie watch export |
Export watchlist as JSON for backup |
movie watch import <file> |
Import watchlist from JSON |
movie stats |
Counts, storage, genre chart, avg ratings |
movie duplicates |
Detect duplicate media entries |
movie suggest 5 # get 5 recommendations
movie discover # interactive genre picker
movie discover Action # discover Action movies from TMDb
movie discover Comedy --type tv # discover Comedy TV shows
movie discover Horror --page 2 # page 2 of Horror movies
movie tag add 1 favorite # tag media #1 as favorite
movie tag list # list all tags
movie watch add 3 # add media #3 to watchlist
movie watch done 3 # mark as watched
movie watch ls # view watchlist
movie stats # library statistics
movie duplicates # find duplicate entries
Maintenance & Debugging
| Command | Description |
|---|---|
movie cleanup |
Find stale entries where files no longer exist |
movie cleanup --remove |
Delete stale entries (not just preview) |
movie db |
Show resolved database path and status |
movie logs |
Display recent error logs from the database |
movie rest |
Start a local REST API server for the library |
movie rest --open |
Start server and open in browser |
movie export [-o path] |
Dump media table as JSON |
movie cleanup # dry run β show stale entries
movie cleanup --remove # actually remove stale entries
movie db # check database location
movie logs # view recent error/warning logs
movie rest # start REST API on localhost
movie rest --open # start and open browser
movie export -o ~/library.json # export full library as JSON
Configuration & System
| Command | Description |
|---|---|
movie config |
Show all configuration |
movie config set <key> <val> |
Set a config value |
movie version |
Version, commit, build date, Go, OS/arch |
movie update |
Pull latest, rebuild, and deploy (copy-and-handoff) |
movie update-cleanup |
Remove leftover temp binaries and .bak backups |
movie changelog [--latest] |
Show release notes |
movie config set movies_dir ~/Movies
movie config set tmdb_api_key YOUR_KEY
movie update # full self-update: pull β build β deploy
movie update-cleanup # remove temp update artifacts
movie changelog --latest
Config keys:
| Key | Default | Purpose |
|---|---|---|
movies_dir |
~/Movies |
Movie file destination |
tv_dir |
~/TVShows |
TV show destination |
archive_dir |
~/Archive |
Archive destination |
scan_dir |
~/Downloads |
Default scan source |
tmdb_api_key |
(none) | TMDb API key |
page_size |
20 |
Items per page in ls |
Command Tree
movie
βββ hello # Greeting with version
βββ version # Version, commit, build date, Go, OS/arch
βββ changelog [--latest] # Show changelog (full or latest version)
βββ update # Pull β rebuild β deploy (copy-and-handoff)
βββ update-cleanup # Remove temp update artifacts
βββ config [get|set] [key] # View/set configuration
βββ scan [folder] # Scan folder β DB + TMDb metadata
βββ rescan # Re-fetch missing TMDb metadata
βββ ls # Paginated library list (file-backed only)
βββ search <name> # Live TMDb search β save to DB
βββ info <id|title> # Detail view (local DB β TMDb fallback)
βββ suggest [N] # Recommendations + trending
βββ discover [genre] # Browse TMDb by genre
βββ move [directory] # Browse, select, move with clean name
βββ rename # Batch rename to clean format
βββ popout [directory] # Extract videos from subfolders
βββ undo [--list|--batch|--id] # Revert operations (move/delete/scan)
βββ redo # Re-apply last undone operation
βββ history # Show all tracked operations
βββ play <id> # Open with default video player
βββ stats # Counts, storage, genre chart, avg ratings
βββ duplicates # Detect duplicate media entries
βββ cleanup [--remove] # Find/remove stale entries
βββ tag [add|remove|list] # Manage user-defined tags
βββ watch [add|done|undo|rm|ls|export|import] # Manage watchlist + sync
βββ cd [folder-name] # Print scanned folder path
βββ export [-o path] # Dump media table as JSON
βββ db # Show database path and status
βββ logs # View error/warning logs
βββ rest [--open] # Start local REST API server
Build & Deploy
Makefile Targets
| Target | Description |
|---|---|
make build |
Compile for current platform |
make build-all |
Cross-compile all 6 targets into dist/ |
make build-windows |
Windows amd64 (with embedded icon) |
make build-windows-arm |
Windows arm64 (with embedded icon) |
make build-mac-arm |
macOS ARM64 |
make build-mac-intel |
macOS amd64 |
make build-linux |
Linux amd64 |
make build-linux-arm |
Linux arm64 |
make install |
Build + copy to /usr/local/bin |
Build via run.ps1
.\run.ps1 # Full pipeline: pull, build, deploy
.\run.ps1 -NoPull # Skip git pull
.\run.ps1 -NoPull -NoDeploy # Build only
.\run.ps1 -R movie scan D:\movies # Build + run scan
.\run.ps1 -t # Run all unit tests
.\run.ps1 -ForcePull # CI mode: discard changes + pull
| Flag | Description |
|---|---|
-NoPull |
Skip git pull |
-NoDeploy |
Skip deploy step |
-R |
Run movie after build (trailing args forwarded) |
-t |
Run all unit tests |
-ForcePull |
CI mode: discard changes + pull |
See spec/03-general/04-run-guide.md for the full usage guide.
Release Workflow
Releases are fully automated via GitHub Actions. Pushing to a release/** branch or a v* tag triggers:
- Cross-compilation β 6 binaries (Windows/Linux/macOS Γ amd64/arm64)
- Packaging β
.zip(Windows) and.tar.gz(Unix) - SHA256 checksums β
checksums.txtwith all artifact hashes - Install scripts β version-pinned
install.ps1andinstall.sh - GitHub Release β formatted page with changelog, checksums, and install instructions
Creating a Release
# Option A: Push a release branch
git checkout -b release/v1.3.0
git push origin release/v1.3.0
# Option B: Tag directly
git tag v1.3.0
git push origin v1.3.0
Both trigger the same pipeline. Version is resolved from the ref name.
CI Pipeline: Pushing a
release/*branch orv*tag triggers GitHub Actions to cross-compile 6 targets, generate checksums, and create a GitHub release with changelog and install instructions.
See spec/12-ci-cd-pipeline/02-release-pipeline.md for the full pipeline spec.
Project Structure
movie-cli-v6/
βββ main.go # Entry point
βββ cmd/ # Cobra commands (one file per command)
β βββ root.go # Root command, registers subcommands
β βββ movie_config.go # config get/set
β βββ movie_scan.go # scan folder
β βββ movie_rescan.go # re-fetch missing metadata
β βββ movie_ls.go # paginated list
β βββ movie_search.go # TMDb search
β βββ movie_info.go # detail view + shared fetch helpers
β βββ movie_suggest.go # recommendations
β βββ movie_move.go # interactive move
β βββ movie_rename.go # batch rename
β βββ movie_popout.go # extract from subfolders
β βββ movie_undo.go # undo operations
β βββ movie_redo.go # redo undone operations
β βββ movie_history.go # operation history
β βββ movie_play.go # play with system player
β βββ movie_stats.go # library statistics
β βββ movie_duplicates.go # duplicate detection
β βββ movie_cleanup.go # stale entry cleanup
β βββ movie_tag.go # tag management
β βββ movie_watch.go # watchlist management
β βββ movie_cd.go # folder navigation helper
β βββ movie_export.go # JSON export
β βββ movie_db.go # database path/status
β βββ movie_logs.go # error log viewer
β βββ movie_rest.go # REST API server
β βββ movie_resolve.go # shared ID/title resolver
βββ cleaner/cleaner.go # Filename cleaning + slug generation
βββ tmdb/client.go # TMDb API client
βββ db/ # SQLite database layer
β βββ db.go # Connection + migrations
β βββ media.go # Media CRUD operations
β βββ config.go # Config get/set
β βββ history.go # Move + scan history
βββ errlog/ # Centralized error/warning logging
β βββ errlog.go # File + DB logging with stack traces
βββ updater/ # Copy-and-handoff self-update
β βββ run.go # Entry points: Run() + RunWorker()
β βββ repo.go # Repo path resolution
β βββ handoff.go # Binary copy + foreground launch
β βββ script.go # PowerShell script generation
β βββ cleanup.go # Temp artifact removal
βββ version/version.go # Build-time version variables
βββ .github/
β βββ workflows/
β βββ ci.yml # Lint + test + vulncheck + cross-build
β βββ release.yml # Cross-compile + GitHub Release
β βββ vulncheck.yml # Weekly vulnerability scan
βββ run.ps1 # PowerShell build + deploy pipeline
βββ install.ps1 # Bootstrap installer
βββ CHANGELOG.md # Release notes
βββ spec/ # Detailed specifications
Data Storage
All data lives in ./data/:
./data/
βββ movie.db # SQLite database (WAL mode)
βββ thumbnails/ # Downloaded poster images
βββ json/
βββ movie/ # Per-movie JSON metadata
βββ tv/ # Per-show JSON metadata
βββ history/ # Move operation logs (RFC3339)
Dependencies
| Package | Purpose |
|---|---|
github.com/spf13/cobra |
CLI framework |
modernc.org/sqlite |
Pure-Go SQLite driver (no CGo) |
π€ Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a branch for your feature or fix:
git checkout -b feature/my-feature - Follow the coding guidelines in
spec/01-coding-guidelines/ - Keep files small β one file per command, max ~200 lines
- Run tests before submitting:
make tidy go test ./... -v - Open a Pull Request against
mainwith a clear description
Development Setup
git clone https://github.com/alimtvnetwork/movie-cli-v6.git
cd movie-cli-v6
make tidy
make build
See the Install Guide for full setup instructions.
Code Style
- Go standard formatting (
gofmt) - Descriptive variable names, no abbreviations
- Error messages start lowercase, no trailing punctuation
- All new code must pass
go vetandgolangci-lint
π Code of Conduct
We are committed to providing a welcoming and inclusive experience for everyone.
Our Standards:
- Be respectful, constructive, and empathetic
- Welcome newcomers and help them get started
- Accept constructive criticism gracefully
- Focus on what's best for the project and community
Unacceptable Behavior:
- Harassment, trolling, or personal attacks
- Publishing others' private information
- Any conduct that would be considered inappropriate in a professional setting
Enforcement: Project maintainers may remove, edit, or reject contributions that violate this code. Repeated violations may result in a temporary or permanent ban.
This Code of Conduct is adapted from the Contributor Covenant v2.1.
A system architect with 20+ years of professional software engineering experience across enterprise, fintech, and distributed systems. His technology stack spans .NET/C# (18+ years), JavaScript (10+ years), TypeScript (6+ years), and Golang (4+ years).
Recognized as a top 1% talent at Crossover and one of the top software architects globally. He is also the Chief Software Engineer of Riseup Asia LLC and maintains an active presence on Stack Overflow (2,452+ reputation, member since 2010) and LinkedIn (12,500+ followers).
| Website | alimkarim.com Β· my.alimkarim.com |
| linkedin.com/in/alimkarim | |
| Stack Overflow | stackoverflow.com/users/361646/alim-ul-karim |
| Alim Ul Karim | |
| Role | Chief Software Engineer, Riseup Asia LLC |
Riseup Asia LLC
Top Leading Software Company in WY (2026)
| Website | riseup-asia.com |
| riseupasia.talent | |
| Riseup Asia | |
| YouTube | @riseup-asia |
License
Private project.
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
Package apperror provides standardized error wrapping for the CLI.
|
Package apperror provides standardized error wrapping for the CLI. |
|
Package cleaner handles filename cleaning and metadata extraction from file names.
|
Package cleaner handles filename cleaning and metadata extraction from file names. |
|
changelog.go β implements the `movie changelog` command.
|
changelog.go β implements the `movie changelog` command. |
|
action_history.go β ActionHistory table: types and helpers.
|
action_history.go β ActionHistory table: types and helpers. |
|
checks.go β individual diagnostic checks.
|
checks.go β individual diagnostic checks. |
|
Package errlog provides centralized error logging to both file and database.
|
Package errlog provides centralized error logging to both file and database. |
|
Package templates provides embedded HTML templates for the movie CLI.
|
Package templates provides embedded HTML templates for the movie CLI. |
|
Package tmdb provides a client for The Movie Database (TMDb) API.
|
Package tmdb provides a client for The Movie Database (TMDb) API. |
|
Package updater implements the copy-and-handoff self-update mechanism.
|
Package updater implements the copy-and-handoff self-update mechanism. |
|
Package version holds the three build-time variables that describe exactly which binary is running.
|
Package version holds the three build-time variables that describe exactly which binary is running. |