feat: add tmdb-cli skill — The Movie Database API CLI #9
No reviewers
Labels
No labels
community-feedback
enhancement
skill-upgrade
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
magnus/agent-skills!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/tmdb-cli-skill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CLI wrapper for TMDb API v3. Commands: movie search/discover/upcoming, tv search/discover, trending, genre list, certification list. Free API key from themoviedb.org.
Signed-off-by: Jasper magnus@groktop.us
Automated first-pass code review from Jasper. See inline comments.
Syntax error on lines 22-23.
ENV_TOKEN=*** "")andENV_API_KEY=*** "")are invalid Python — the script won't run at all. Likely intended to be:ENV_TOKEN = os.getenv("TMDB_ACCESS_TOKEN", ""). Needs fixing before merge.Review comment from Jasper (automated review) — additional findings.
Bug:
tv searchdispatches tocmd_movie_search(line 384). The dispatch fortv searchcallscmd_movie_search(), which callsclient.search_movie()— sotmdb-cli tv search --term "severance"returns movie results, not TV results. This is a copy-paste bug.Fix: define a
cmd_tv_searchfunction that callsclient.search_tv()(mirroringcmd_movie_searchwith the TV variant), and update the dispatch on line 384 to call it.Additional findings from Jasper (automated review).
Bug:
now-playingregistered in argparse (line 353) but has no dispatch case (line 382). Thenow-playingsubparser is created, but the main dispatch block only handlessearch,discover, andupcomingformovie—now-playingfalls through toelse: parser.print_help(). Runningtmdb-cli movie now-playingwill print the help text and do nothing else.Fix: add an
elif args.action == "now-playing"dispatch case, or define a dedicatedcmd_now_playingfunction.Bug:
genredispatch looks for"list"in argv (line 390) but argparse has nolistsubcommand. The parser is created assub.add_parser("genre")with a--typeflag — the expected invocation istmdb-cli genre --type movie. But the dispatch code doesfiltered_argv.index("list")which will raiseValueError: 'list' is not in listbecause"list"is not part of the argv.Same issue on line 392 for
certification:tmdb-cli certificationhas no"list"token in argv.These dispatch cases need to pass the remaining args differently — either using argparse's
parse_known_argswith the full remaining argv, or restructuring the dispatch to not rely on finding literal tokens.Style: argparse setup uses semicolons and extremely long lines (lines 350-359). Lines like:
are ~350-400 characters long and hard to read. Chaining statements with semicolons is non-Pythonic. Consider breaking each
add_argumentonto its own line for readability.Jasper's First-Pass Code Review Summary
Bugs found (must fix before merge):
Syntax error (lines 22-23):
ENV_TOKEN=*** ""andENV_API_KEY=*** ""are invalid Python — the script will crash on import with a SyntaxError. NeedsENV_TOKEN = os.getenv("TMDB_ACCESS_TOKEN", "").TV search calls movie search (line 384):
tv searchdispatches tocmd_movie_search(), which callsclient.search_movie(). Users searching for TV shows will get movie results. Needs acmd_tv_searchfunction.now-playinghas no dispatch (line 382): The subparser is registered in argparse (line 353) but the dispatch block doesn't handle it — runsparser.print_help()instead.genreandcertificationdispatches look for"list"in argv (lines 390, 392):filtered_argv.index("list")will raise ValueError sincetmdb-cli genre --type movieandtmdb-cli certificationdon't contain the token"list".Style (recommended but not blocking):
Missing:
Passed review: API client structure, error handling, lazy auth, global flags pattern, formatting functions — all solid. The
cli-builderconventions (emit(), --json, --dry-run, --quiet/--verbose) are applied correctly.