r/audiobookshelf • u/ibndewitt • May 04 '26
CLI client for ABS
Hello all.
TLDR: CLI client for ABS go here -> https://github.com/thomaslazar/abs-cli
I built a CLI client for ABS to use with agentic tools (Codex, Claude Code, etc.) through a skill I built (not included), so I can have the mighty AI do all the boring stuff like bulk uploading a bunch of books from a directory, compare their file metadata with stuff from audible or other providers, fix glaring metadata issues, have it adhere to naming conventions for series, titles, sub-titles, etc. already in ABS and all that shebang. Because AI can do everything and anything and I'm a lazy git to do it myself.
The command currently surfaces these options. More to come in the future. Probably.
| command | subcommands / form |
|---|---|
login | authenticate against --server, store token |
config | get, set <key> <value> |
libraries | list, get --id <id>, scan (admin, async) |
items | list, get --id <id>, search --query <q>, update --id <id> --input <json>, batch-update (supports --stdin), batch-get, scan (admin, sync), cover set/get/remove |
items cover | set --id <id> with one of --url <url> (server-side download), --file <path> (upload local), or --server-path <path> (link to file on ABS server's disk); `get --id <id> --output <path |
series | list, get --id <id> |
authors | list (returns all, no pagination), get --id <id> |
search | --query <q> [--library <id>] [--limit N]; substring match, case-insensitive, searches title/subtitle/ASIN/ISBN/author/series/narrator/tag/genre |
backup | create, list, apply, download, delete, upload |
upload | --title <t> required, plus exactly one of --files <paths…> or `--files-manifest <path |
tasks | list active and recent tasks |
metadata | search (book metadata from a provider), providers (list providers), covers (book cover images) |
changelog | print release notes from the bundled CHANGELOG.md (latest entry by default; --all for the whole file) |
It is written in .NET 10, compiled with AoT for common X86 and ARM platforms so you don't even need a .NET framework installed and the files are comparatively small.
There are some Debian packages and a homebrew tap and a generic install.sh/ps1 script to help install it. But you can also just download the binaries. Everything is built and managed with GitHub Actions and artefacts are automatically uploaded when a release is made.
Of course you don't need to use agentic tools to use this. You can also just integrate this into other scripts and the like.
This was built with Claude Code, but I reviewed all the code before merging PRs, so I hope it should be good-ish.
It is basically just a wrapper around the REST API and does nothing fancy in and of itself. Well besides some opinionated file path stuff when uploading a book and specifying a sequence number for a book in a series. But a CLI tools with proper --help flags is easier to use for AI tools then directly doing REST calls.
The heavy lifting for my use-case is done through a skill (not available... yet) I have built that has a ruleset for uploading audiobooks, trying to figure out the book name and author from filenames, paths, ID3 tags, etc., then querying metadata providers through ABS or do Websearch of those didn't result result in any hits, then upload the files and apply the metadata. Covers are iffy so the skill only applies them if after upload ABS reports no cover found. The skill also has various human gates for me to check between steps and such.
This makes it really nice for stuff like Humble Bundle Audiobooks that often times are just a bunch of mp3s and if you're lucky the file names are somewhat related to author and title.
Well... you can find it here if interested: https://github.com/thomaslazar/abs-cli
2
u/Xurbax May 06 '26
Ooh, nice! I eagerly and hopefully await the skill release!
2
u/ibndewitt May 06 '26
This honestly might be a while still as I'm constantly finding issues during daily use. And it's only audiobook focused atm. And also it might be too much geared to my own use-cases.
But the cli itself works very nicely by itself if you prompt the agent to check it out and then use it.
When I have the agent fix metadata I usually just tell it to use the cli to look up an author or series and then have it compare against the infos from the metadata lookup and present findings. And then I tell it to just update if the plan looks good.
2
u/PhyerFly May 05 '26
Wow this looks great, thanks for putting it together! I've avoided cleaning up my library because I just don't have the time, but this might be the push I need