rstoner (1.5.0)
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add rstoner@1.5.0 --registry forgejoAbout this package
rstoner
A CLI tool for generating metadata tagging commands for audiobooks.
Overview
rstoner generates shell commands for the tone audiobook metadata tagging tool and the m4b-tool for creating M4B audiobook files.
It processes audiobook directories and outputs ready-to-run commands that can be executed manually or saved to a script.
Installation
From Releases (Recommended)
Download the latest static binary from the releases page:
# Download the binary
curl -LO "https://git.desord.re/eofredj/rstoner/releases/download/v0.7.0/rstoner-x86_64"
# Verify checksum
sha256sum -c rstoner-x86_64.sha256
# Make executable and move to PATH
chmod +x rstoner-x86_64
mv rstoner-x86_64 /usr/local/bin/rstoner
From crates.io
cargo install rstoner
Build from Source
git clone https://git.desord.re/eofredj/rstoner.git
cd rstoner
cargo build --release
Configuration
rstoner supports a configuration file at ~/.config/rstoner/config.toml for default values:
author = "Default Author"
narrator = "Default Narrator"
CLI arguments always override config file values. Environment variables are also supported (see Options table).
Usage
rstoner [OPTIONS] --author <AUTHOR> --narrator <NARRATOR> [PATH]...
Options
| Short | Long | Env Variable | Description |
|---|---|---|---|
-a |
--author |
RSTONER_AUTHOR |
Author's name (required for processing) |
-n |
--narrator |
RSTONER_NARRATOR |
Narrator's name (required for processing) |
-g |
--genre |
RSTONER_GENRE |
Book genre (default: "Audiobook") |
-s |
--serie |
- | Process books as a series |
-y |
--assume-yes |
- | Assume yes to prompts |
-v |
--verbose |
- | Enable verbose output |
-x |
--no-dry-run |
- | Execute commands (disable dry-run mode) |
-o |
--output-dir |
RSTONER_OUTPUT_DIR |
Output directory for merged files |
-O |
--output-file |
- | Save commands to shell script |
| - | --force |
- | Overwrite existing output file |
| - | --check |
- | Verify tone and m4b-tool are installed |
Examples
Standalone audiobook:
rstoner -a "Author Name" -n "Narrator Name" /path/to/audiobook
Book series:
rstoner -a "Author Name" -n "Narrator Name" -s /path/to/series
With custom genre:
rstoner -a "Author Name" -n "Narrator Name" -g "Fantasy" /path/to/audiobook
With custom output directory:
rstoner -a "Author Name" -n "Narrator Name" -o "/custom/output" /path/to/audiobook
With verbose output:
rstoner -a "Author Name" -n "Narrator Name" -v /path/to/audiobook
Multiple audiobooks:
rstoner -a "Author Name" -n "Narrator Name" /path/to/book1 /path/to/book2
Save commands to script:
rstoner -a "Author Name" -n "Narrator Name" -O output.sh /path/to/audiobook
Check tool availability:
rstoner --check
Output
The tool outputs two types of commands:
tone tagcommands - for tagging audio files with metadatam4b-tool mergecommands - for creating M4B audiobook files
Metadata Tags
For standalone books:
--meta-artist- Author--meta-composer- Narrator--meta-album-artist- Author--meta-narrator- Narrator--meta-genre- Genre--meta-album- Book title
For series books (additional):
--meta-group- Series name--meta-movement-name- Series name--meta-part- Book number--meta-movement- Book number--meta-album- Book title (without number)
Directory Structure
Standalone Audiobook
/path/to/audiobook/
├── chapter1.mp3
├── chapter2.mp3
└── cover.jpg
Book Series
/path/to/series/
├── 01. Book One/
│ ├── chapter1.mp3
│ └── cover.jpg
├── 02. Book Two/
│ ├── chapter1.mp3
│ └── cover.jpg
└── ...
Requirements
Security
All user-provided values are properly shell-escaped using the shell-escape crate to prevent command injection attacks. Special characters, quotes, and shell metacharacters are safely handled.
Development
# Build
cargo build --release
# Run tests (135 tests)
cargo test
# Run with arguments
cargo run -- -a "Author" -n "Narrator" /path
Release Artifacts
Each release includes the following artifacts:
| Artifact | Description |
|---|---|
rstoner-x86_64 |
Static binary (x86_64-linux-musl) |
rstoner-x86_64.sha256 |
SHA256 checksum |
rstoner-x86_64.sbom.json |
Software Bill of Materials |
Building from Source
Prerequisites
Install the required targets for static builds:
rustup target add x86_64-unknown-linux-musl
Build Commands
# Default build (x86_64)
mise run build
# Static musl build
mise run build-musl
Output
Built binaries are placed in the dist/ directory:
| Binary | Architecture |
|---|---|
dist/rstoner-x86_64 |
x86_64 (desktop, server) |
The binary is fully static and will run on any Linux system without requiring glibc.
Changelog
This project uses git-cliff for changelog generation. The changelog is automatically generated from conventional commits.
To regenerate the changelog:
git cliff --config cliff.toml --bump --offline -o CHANGELOG.md
Conventional Commits
This project follows the Conventional Commits specification. Release notes are automatically grouped by commit type:
| Type | Description | Example |
|---|---|---|
feat: |
New features | feat: add support for MP4 files |
fix: |
Bug fixes | fix: resolve path handling issue |
docs: |
Documentation | docs: update README examples |
refactor: |
Code refactoring | refactor: simplify error handling |
perf: |
Performance | perf: optimize file scanning |
test: |
Tests | test: add unit tests for series |
chore: |
Maintenance | chore: update dependencies |
Breaking changes: Add ! after the type or include BREAKING CHANGE: in the commit body:
feat!: remove deprecated --input-dir option
BREAKING CHANGE: The --input-dir option has been removed. Use positional arguments instead.
License
LGPL-3.0
Dependencies
| ID | Version |
|---|---|
| clap | ^4.6.1 |
| colored | ^3.1.1 |
| crossterm | ^0.29 |
| dirs | ^6.0.0 |
| ratatui | ^0.30.2 |
| regex | ^1.13.0 |
| serde | ^1.0 |
| serde_json | ^1.0.150 |
| shell-escape | ^0.1 |
| thiserror | ^2.0 |
| toml | ^1.1.2 |
| which | ^8.0.4 |
| insta | ^1.42 |
| tempfile | ^3.27.0 |