PHPackages                             indemnity83/book-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. indemnity83/book-tools

ActiveProject[CLI &amp; Console](/categories/cli)

indemnity83/book-tools
======================

Librarian CLI: A simple tool to organize and shelve audiobooks from import folders into a structured library.

0.0.2(1y ago)10[6 PRs](https://github.com/Indemnity83/book-tools/pulls)MITPHPPHP ^8.2.0CI passing

Since May 8Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/Indemnity83/book-tools)[ Packagist](https://packagist.org/packages/indemnity83/book-tools)[ Docs](https://github.com/indemnity83/book-tools)[ RSS](/packages/indemnity83-book-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (9)Used By (0)

📚 Book Tools (`librarian` CLI)
==============================

[](#-book-tools-librarian-cli)

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
----------

[](#-commands)

### `shelve`

[](#shelve)

Organizes and moves books from an import directory into a structured destination library.

```
php librarian shelve {importFolder} {destinationFolder?} {--dry-run} {--pretend}
```

#### Arguments

[](#arguments)

ArgumentDescription`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

[](#options)

OptionDescription`--dry-run`Shows what would be done without making any changes.`--pretend`Alias for `--dry-run`.---

📦 How it works
--------------

[](#-how-it-works)

The `shelve` command will:

1. Scan the `importFolder` for book subfolders.
2. Each book folder **must contain a `metadata.json` file** (produced by AudioBookShelf).
3. 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.

4. 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.

---

✅ Example
---------

[](#-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
----------------

[](#-future-roadmap)

This is version 1 (MVP) with only the `shelve` command. Future tools planned may include:

- `scan` → check library for missing metadata
- `rename` → force renaming of existing library to match patterns
- `cleanup` → remove orphaned or duplicate files

---

🧹 Development and testing
-------------------------

[](#-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
-----------------

[](#‍️-contributors)

Currently maintained by **indemnity83**. Pull requests welcome as the tool expands!

---

📜 License
---------

[](#-license)

MIT — do what you want, but please don’t sell it without adding value.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity2

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

376d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4130190042e11edc684bcaac2190409d96ef14b139c767bc25b279170e8376a9?d=identicon)[Indemnity83](/maintainers/Indemnity83)

---

Top Contributors

[![Indemnity83](https://avatars.githubusercontent.com/u/35218?v=4)](https://github.com/Indemnity83 "Indemnity83 (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

---

Tags

cliconsolelibraryOrganizerlibrarianaudiobooksshelving

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/indemnity83-book-tools/health.svg)

```
[![Health](https://phpackages.com/badges/indemnity83-book-tools/health.svg)](https://phpackages.com/packages/indemnity83-book-tools)
```

###  Alternatives

[eddiriarte/console-select

A fancy selection interface for symfony's console component.

117.2k2](/packages/eddiriarte-console-select)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
