indemnity83 / book-tools
Librarian CLI: A simple tool to organize and shelve audiobooks from import folders into a structured library.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:project
pkg:composer/indemnity83/book-tools
Requires
- php: ^8.2.0
- laravel-zero/framework: ^11.36.1
- laravel-zero/phar-updater: ^1.4
Requires (Dev)
- captainhook/captainhook-phar: ^5.25
- laravel/pint: ^1.18.3
- marcocesarato/php-conventional-changelog: ^1.17
- mockery/mockery: ^1.6.12
- pestphp/pest: ^3.7.1
- ramsey/conventional-commits: ^1.6
- dev-main
- 0.0.2
- v0.0.1
- dev-dependabot/composer/main/laravel-zero/framework-12.0.2
- dev-dependabot/composer/main/laravel/pint-1.25.1
- dev-dependabot/composer/main/laravel-zero/framework-12.0.1
- dev-dependabot/composer/main/pestphp/pest-3.8.3
- dev-dependabot/composer/main/captainhook/captainhook-phar-5.25.11
- dev-dependabot/github_actions/main/actions/checkout-5
This package is auto-updated.
Last update: 2025-10-06 19:21:41 UTC
README
A simple command-line tool for managing audiobook files and organizing them into a clean, structured library.
Perfect for post-processing audiobooks prepared via AudioBookShelf or similar apps.
Command name:
librarian
Folder / repo name:book-tools
Current available command:shelve
π Commands
shelve
Organizes and moves books from an import directory into a structured destination library.
php librarian shelve {importFolder} {destinationFolder?} {--dry-run} {--pretend}
Arguments
| Argument | Description |
|---|---|
importFolder |
(Required) Path to the import folder. This folder should contain subfolders for each book with metadata and files. |
destinationFolder |
(Optional) Path to the destination library root. Defaults to the current working directory if not provided. |
Options
| Option | Description |
|---|---|
--dry-run |
Shows what would be done without making any changes. |
--pretend |
Alias for --dry-run. |
π¦ How it works
The shelve command will:
- Scan the
importFolderfor book subfolders. - Each book folder must contain a
metadata.jsonfile (produced by AudioBookShelf). - Files will be moved into:
[Author]/
[Series]/
[Series #] - [Title]/
Title, Book [#] of [Series] by [Author].m4b
cover.jpg
metadata.json
- If no series β simpler path without series folder.
- If multiple audio files β filenames will include
Part 1,Part 2, etc.
-
After processing:
- If in
--dry-runβ no files will be moved, only output shown. - If real mode β files are moved, extra files (cover, metadata) copied, and original import folder removed if empty.
- If in
β Example
php librarian shelve ~/audiobooks/_import ~/audiobooks
Will scan _import folder and move books to the main audiobooks library, cleaning up the import folder after.
php librarian shelve ~/audiobooks/_import ~/audiobooks --dry-run
Will show exactly what would happen, but not move anything.
π Future roadmap
This is version 1 (MVP) with only the shelve command.
Future tools planned may include:
scanβ check library for missing metadatarenameβ force renaming of existing library to match patternscleanupβ remove orphaned or duplicate files
π§Ή Development and testing
Feature and unit tests are provided using PestPHP. To run tests:
vendor/bin/pest
You can also test the CLI directly:
php librarian shelve --help
π·ββοΈ Contributors
Currently maintained by indemnity83. Pull requests welcome as the tool expands!
π License
MIT β do what you want, but please donβt sell it without adding value.