Manage books (works) and their editions through the command line. These commands provide full control over your library from the terminal.
Overview
Works represent the abstract concept of a book, while editions represent specific published versions. A single work can have multiple editions in different formats (EPUB, MOBI, PDF) or from different publishers.
colibri works add
Add a new work from a local ebook file.
colibri works add <file> [options]Arguments
| Argument | Type | Description |
|---|---|---|
file | path | Path to the ebook file (EPUB, MOBI, or PDF) |
Options
| Option | Short | Type | Description |
|---|---|---|---|
--title | -t | string | Override the extracted title |
--author | -a | string | Override the extracted author |
--isbn | -i | string | Set ISBN for metadata lookup |
--publisher | -p | string | Override the publisher |
--language | -l | string | Set language (ISO 639-1 code) |
--enrich | -e | boolean | Automatically enrich with external metadata |
--collection | -c | string | Add to collection (by ID or name) |
--series | -s | string | Add to series (format: “Series Name:Position”) |
--tags | string | Comma-separated tags | |
--dry-run | boolean | Preview without importing | |
--skip-duplicates | boolean | Skip if duplicate detected | |
--json | boolean | Output results as JSON |
Examples
Basic upload:
colibri works add "The Great Gatsby.epub"Upload with metadata override:
colibri works add book.epub
--title "The Correct Title"
--author "Author Name"
--isbn "9780743273565"Upload and auto-enrich:
colibri works add book.epub --enrichThis will:
- Extract metadata from the file
- Search 14+ external providers for additional metadata
- Merge and reconcile the results
- Apply high-confidence metadata automatically
Upload to a collection:
colibri works add book.epub --collection "To Read"Upload to a series:
colibri works add "book-01.epub" --series "My Series:1"Bulk import with wildcard:
for file in *.epub; do
colibri works add "$file" --enrich --skip-duplicates
donePreview without importing:
colibri works add book.epub --dry-run --jsonOutput
Success:
✓ Extracted metadata from The Great Gatsby.epub
✓ Found ISBN: 9780743273565
✓ Enriching metadata from 4 providers...
✓ Created work: The Great Gatsby (work_abc123)
✓ Created edition: First Scribner trade paperback edition (edition_def456)
✓ Uploaded asset: the-great-gatsby.epub (5.2 MB)
Confidence: 95% (Exceptional)
Sources: WikiData, Open Library, Library of CongressJSON Output:
{
"status": "success",
"work": {
"id": "work_abc123",
"title": "The Great Gatsby",
"authors": ["F. Scott Fitzgerald"],
"publicationDate": "1925-04-10"
},
"edition": { "id": "edition_def456", "format": "epub", "fileSize": 5242880 },
"enrichment": { "confidence": 0.95, "sources": ["WikiData", "OpenLibrary", "LoC"] }
}colibri works list
List works in your library with filtering and sorting.
colibri works list [options]Options
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--limit | -n | number | 20 | Number of results to show |
--offset | number | 0 | Pagination offset | |
--author | -a | string | Filter by author name | |
--publisher | -p | string | Filter by publisher | |
--collection | -c | string | Filter by collection | |
--series | -s | string | Filter by series | |
--language | -l | string | Filter by language code | |
--year | -y | number | Filter by publication year | |
--tag | -t | string | Filter by tag | |
--format | -f | string | Filter by format (epub, mobi, pdf) | |
--sort | string | title | Sort by: title, author, date, updated | |
--order | string | asc | Sort order: asc or desc | |
--json | boolean | false | Output as JSON | |
--csv | boolean | false | Output as CSV |
Examples
List first 20 works:
colibri works listList works by a specific author:
colibri works list --author "Jane Austen"List works in a collection:
colibri works list --collection "Science Fiction"List works in a series:
colibri works list --series "Harry Potter"List with multiple filters:
colibri works list
--author "Tolkien"
--language "en"
--year 1954Export to JSON:
colibri works list --limit 100 --json > library.jsonExport to CSV:
colibri works list --csv > library.csvSort by date added (newest first):
colibri works list --sort date --order desc --limit 10Output
Table format (default):
ID Title Author Published Format
work_123 The Great Gatsby F. Scott Fitzgerald 1925 epub
work_456 To Kill a Mockingbird Harper Lee 1960 epub, pdf
work_789 1984 George Orwell 1949 mobi
...
Showing 20 of 1,234 worksJSON format:
{
"works": [
{
"id": "work_123",
"title": "The Great Gatsby",
"authors": ["F. Scott Fitzgerald"],
"published": "1925-04-10",
"formats": ["epub"],
"series": null,
"tags": ["fiction", "american literature", "classics"]
},
...
],
"total": 1234,
"limit": 20,
"offset": 0
}colibri works inspect
View detailed information about a specific work or ebook file.
colibri works inspect <identifier> [options]Arguments
| Argument | Type | Description |
|---|---|---|
identifier | string | Work ID or path to ebook file |
Options
| Option | Type | Description |
|---|---|---|
--json | boolean | Output as JSON |
--show-metadata | boolean | Show all metadata fields |
--show-editions | boolean | List all editions |
--show-assets | boolean | List all file assets |
Examples
Inspect a work by ID:
colibri works inspect work_abc123Inspect an ebook file before importing:
colibri works inspect "book.epub"Show all editions:
colibri works inspect work_abc123 --show-editionsGet full metadata as JSON:
colibri works inspect work_abc123 --json --show-metadata > work.jsonOutput
Work inspection:
Work: The Great Gatsby
ID: work_abc123
Authors:
- F. Scott Fitzgerald (Author)
Publisher: Scribner
Published: April 10, 1925
Language: English (en)
Pages: 180
Synopsis:
The Great Gatsby is a 1925 novel by American writer F. Scott Fitzgerald.
Set in the Jazz Age on Long Island, the novel depicts narrator Nick
Carraway's interactions with mysterious millionaire Jay Gatsby...
Identifiers:
ISBN-13: 9780743273565
ISBN-10: 0743273567
LCCN: 25007822
Series: None
Tags: fiction, american literature, classics, jazz age, 1920s
Editions: 2
- First Scribner trade paperback edition (epub, 5.2 MB)
- Kindle edition (mobi, 4.8 MB)
Added: 2024-01-15 10:30:00
Updated: 2024-01-20 14:45:00File inspection:
File: The Great Gatsby.epub
Format: EPUB 3.0
Size: 5.2 MB
Checksum: a1b2c3d4e5f6...
Extracted Metadata:
Title: The Great Gatsby
Subtitle: None
Author: F. Scott Fitzgerald
Publisher: Scribner
Published: 2004-09-30 (reprint)
Language: en
ISBN: 9780743273565
Pages: 180
Cover: Yes (embedded)
Table of Contents: Yes
Chapters: 9
DRM: None
Encryption: Nonecolibri works import
Bulk import ebooks from a directory.
colibri works import <directory> [options]Arguments
| Argument | Type | Description |
|---|---|---|
directory | path | Directory containing ebook files |
Options
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--recursive | -r | boolean | false | Include subdirectories |
--pattern | -p | string | *.{epub,mobi,pdf} | File pattern to match |
--enrich | -e | boolean | false | Enrich all imports with external metadata |
--collection | -c | string | Add all to this collection | |
--dry-run | boolean | false | Preview without importing | |
--skip-duplicates | boolean | true | Skip files that already exist | |
--parallel | number | 1 | Number of parallel imports | |
--quiet | -q | boolean | false | Suppress progress output |
--json | boolean | false | Output results as JSON |
Examples
Import all ebooks from a folder:
colibri works import ./ebooks/Recursive import with enrichment:
colibri works import ./library/ --recursive --enrichImport only EPUB files:
colibri works import ./books/ --pattern "*.epub"Preview import (dry run):
colibri works import ./books/ --dry-runImport with parallel processing:
colibri works import ./library/ --recursive --parallel 4Import into a collection:
colibri works import ./sci-fi/ --collection "Science Fiction"Import from Calibre library structure:
colibri works import ~/Calibre Library/ --recursive --skip-duplicatesOutput
Progress:
Scanning directory: /Users/me/library
Found 150 ebook files
Importing (4 parallel workers):
[====================================] 100% (150/150)
✓ 145 imported successfully
✗ 3 failed (see errors below)
⊘ 2 skipped (duplicates)
Errors:
- book-corrupt.epub: Invalid EPUB structure
- book-drm.epub: DRM protected, cannot read
- book-empty.mobi: File appears to be empty
Time: 12m 34sJSON Output:
{
"summary": {
"total": 150,
"imported": 145,
"failed": 3,
"skipped": 2
},
"imported": [
{
"file": "The Great Gatsby.epub",
"work": "work_abc123",
"status": "success"
},
...
],
"errors": [
{
"file": "book-corrupt.epub",
"error": "Invalid EPUB structure"
},
...
]
}colibri works update
Update metadata for an existing work.
colibri works update <work-id> [options]Options
| Option | Type | Description |
|---|---|---|
--title | string | Update title |
--author | string | Update author (replaces all) |
--publisher | string | Update publisher |
--published | string | Update publication date (YYYY-MM-DD) |
--language | string | Update language code |
--synopsis | string | Update description |
--isbn | string | Add/update ISBN |
--tags | string | Update tags (comma-separated) |
--series | string | Update series (format: “Name:Position”) |
--enrich | boolean | Re-fetch metadata from external sources |
--json | boolean | Output results as JSON |
Examples
# Update title
colibri works update work_abc123 --title "New Title"
# Re-enrich metadata
colibri works update work_abc123 --enrich
# Update multiple fields
colibri works update work_abc123
--title "The Great Gatsby"
--author "F. Scott Fitzgerald"
--published "1925-04-10"colibri works delete
Delete a work and all its editions.
colibri works delete <work-id> [options]Options
| Option | Type | Description |
|---|---|---|
--force | boolean | Skip confirmation |
--keep-files | boolean | Delete metadata but keep ebook files |
--json | boolean | Output results as JSON |
Examples
# Delete with confirmation
colibri works delete work_abc123
# Force delete without confirmation
colibri works delete work_abc123 --force
# Delete metadata but keep files
colibri works delete work_abc123 --keep-filesEnvironment Variables
Configure CLI behavior with environment variables:
| Variable | Description | Default |
|---|---|---|
COLIBRI_API_URL | Colibri instance URL | http://localhost:3000 |
COLIBRI_API_TOKEN | Authentication token | (from login) |
COLIBRI_IMPORT_PARALLEL | Default parallel workers | 1 |
COLIBRI_ENRICH_DEFAULT | Auto-enrich by default | false |
Best Practices
Bulk Imports
For large imports:
- Start with a dry run to check for issues
- Use parallel workers (
--parallel 4) for speed - Enable
--skip-duplicatesto avoid re-importing - Import to a collection first, review, then move to main library
- Run enrichment as a separate step if it’s slow
Metadata Quality
To maintain high-quality metadata:
- Always use
--enrichfor books with ISBNs - Review auto-imported metadata before accepting
- Manually fix titles in ALL CAPS or incorrect casing
- Verify author names match existing creators
- Add appropriate tags during import
Performance
- Use
--parallelfor bulk imports (2-4 workers recommended) - Avoid enriching large batches (API rate limits)
- Use
--jsonfor scripting and post-processing - Cache frequently used queries
Troubleshooting
Import Fails with “Duplicate detected”
Solution: Use --skip-duplicates or review and delete the existing work first.
Enrichment Takes Too Long
Solution: Enrich in smaller batches or as a background job:
colibri works list --format epub --limit 100 --json |
jq -r '.[].id' |
xargs -I{} colibri works update {} --enrichFile Not Recognized
Solution: Check file format is supported (EPUB, MOBI, PDF). Verify file isn’t corrupted:
colibri works inspect file.epubRelated Documentation
- CLI Overview - Introduction to the CLI
- Creators Commands - Manage authors and contributors
- Publishers Commands - Manage publishers
- Storage Commands - Manage file storage