LIT Commands Reference
Purpose
Complete command-line reference for all LIT (eBook) format operations. This document provides detailed syntax, options, and examples for the 3 LIT commands.
Concepts
LIT commands operate on Microsoft Reader eBook files with LZX compression. Commands handle DRM detection and operate only on unencrypted files.
Command Overview
| Command | Purpose |
|---|---|
Extract files from LIT eBook | |
Create LIT eBook file | |
Show LIT file information |
lit-extract - Extract LIT Files
Extract all files from a Microsoft Reader LIT eBook file.
Parameters
FILE-
(required) Path to the LIT file to extract
OUTPUT_DIR-
(optional) Directory to extract files to (default: current directory)
Options
--output, -o-
Output directory (alternative to positional argument)
--verbose, -v-
Show extraction progress for each file
Returns
-
Exit code 0 on success
-
Exit code 1 on error (including DRM-encrypted files)
-
Exit code 3 if file not found
-
Exit code 4 if permission denied
Description
The lit-extract command extracts all files from a LIT eBook archive. Files compressed with LZX are automatically decompressed. DRM-encrypted files cannot be extracted and will result in an error.
Examples
cabriolet lit-extract book.litExtracted 15 file(s) to .cabriolet lit-extract book.lit output/cabriolet lit-extract --verbose book.lit extracted/Extracting 15 files from book.lit
content.html (524,288 bytes, LZX)... OK
chapter01.html (65,536 bytes, LZX)... OK
chapter02.html (65,536 bytes, LZX)... OK
style.css (2,048 bytes, LZX)... OK
metadata.xml (1,024 bytes, LZX)... OK
cover.jpg (32,768 bytes, uncompressed)... OK
image01.png (16,384 bytes, uncompressed)... OK
...
Extracted 15 file(s) to extracted/cabriolet lit-extract encrypted-book.litError: LIT file is DRM-encrypted. Decryption not yet supported.cabriolet lit-extract -o ebook-content/ book.litCommon Errors
-
LIT file is DRM-encrypted: File has DRM protection, decryption not supported
-
Invalid LIT signature: File is not a valid LIT file
-
LZX decompression failed: Compressed content is corrupted
-
Cannot create output directory: Verify write permissions
lit-create - Create LIT File
Create a new Microsoft Reader LIT eBook file from HTML and resources.
Parameters
OUTPUT-
(required) Path for the new LIT file
FILES…-
(required) One or more files to add (HTML, images, etc.)
Options
--compress-
Compress files with LZX (default: true)
--no-compress-
Do not compress files
--verbose, -v-
Show creation progress
Returns
-
Exit code 0 on success
-
Exit code 1 on error
-
Exit code 2 if no files specified
-
Exit code 3 if source files not found
-
Exit code 4 if permission denied
Description
The lit-create command builds a new LIT eBook file from HTML content and resources. HTML and text files are compressed with LZX by default, while images and media remain uncompressed.
Examples
cabriolet lit-create book.lit content.html cover.jpg style.cssCreated book.lit (128,512 bytes, 3 files)cabriolet lit-create --no-compress book.lit content.htmlcabriolet lit-create --verbose book.lit *.html *.css cover.jpgCreating book.lit with 5 file(s)
Adding files:
content.html -> content.html (compressed)
Original: 524,288 bytes
Compressed: 131,072 bytes
Ratio: 75.0%
chapter01.html -> chapter01.html (compressed)
Original: 65,536 bytes
Compressed: 16,384 bytes
Ratio: 75.0%
style.css -> style.css (compressed)
Original: 2,048 bytes
Compressed: 512 bytes
Ratio: 75.0%
cover.jpg -> cover.jpg (uncompressed)
Size: 32,768 bytes
metadata.xml -> metadata.xml (compressed)
Original: 1,024 bytes
Compressed: 256 bytes
Ratio: 75.0%
Writing LIT structure...
Header: 96 bytes
Manifest: 2,048 bytes
Content streams: 180,224 bytes
Created book.lit (182,368 bytes, 5 files)
Overall compression: 71.2%cabriolet lit-create mybook.lit chapters/*.html images/*.pnglit-info - Show LIT Information
Display detailed information about a Microsoft Reader LIT file.
Description
The lit-info command displays metadata about a LIT file, including version, encryption status, file count, and individual file information.
Examples
cabriolet lit-info book.litLIT File Information
==================================================
Filename: book.lit
Version: 1
Encrypted: No
Files: 15
Files:
content.html
Size: 524,288 bytes
Compression: LZX
cover.jpg
Size: 32,768 bytes
Compression: none
metadata.xml
Size: 1,024 bytes
Compression: LZXcabriolet lit-info encrypted-book.litLIT File Information
==================================================
Filename: encrypted-book.lit
Version: 1
Encrypted: Yes (DES)
Files: 20
WARNING: This file is DRM-encrypted.
Decryption is not supported.
Files:
content.html
Size: 524,288 bytes
Compression: LZX [encrypted]
cover.jpg
Size: 32,768 bytes
Compression: none [encrypted]
...cabriolet lit-info --verbose book.litLIT File Information
==================================================
Filename: book.lit
Version: 1
Encrypted: No
Total files: 15
File Statistics:
Compressed (LZX): 12 files
Uncompressed: 3 files
Files:
content.html
Size: 524,288 bytes
Compression: LZX
Compressed size: 131,072 bytes
Compression ratio: 75.0%
chapter01.html
Size: 65,536 bytes
Compression: LZX
Compressed size: 16,384 bytes
Compression ratio: 75.0%
style.css
Size: 2,048 bytes
Compression: LZX
Compressed size: 512 bytes
Compression ratio: 75.0%
cover.jpg
Size: 32,768 bytes
Compression: none
Format: JPEG
image01.png
Size: 16,384 bytes
Compression: none
Format: PNG
Overall Statistics:
Total uncompressed: 626,688 bytes
Total compressed: 180,224 bytes
Overall compression: 71.2%for file in ebooks/*.lit; do
echo "=== $file ==="
cabriolet lit-info "$file"
echo
doneGlobal Options
All LIT commands support these global options:
--verbose, -v-
Enable verbose output with detailed progress
--help, -h-
Display command help
--version-
Show Cabriolet version
See Global Options for complete details.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error (including DRM-encrypted files) |
2 | Invalid arguments |
3 | File not found |
4 | Permission denied |
5 | Corrupt file |
6 | Unsupported format |
DRM Limitations
| Cabriolet cannot decrypt DRM-protected LIT files. DRM decryption requires: |
-
Original Microsoft Reader installation
-
Valid activation key
-
Owner-specific decryption key
Always check encryption status with lit-info before attempting extraction.
Common Workflows
Check for DRM Before Extraction
# Safely extract only non-DRM books
for file in ebooks/*.lit; do
if cabriolet lit-info "$file" | grep -q "Encrypted: No"; then
echo "Extracting $file (no DRM)"
cabriolet lit-extract "$file" "extracted/$(basename "$file" .lit)"
else
echo "Skipping $file (DRM-encrypted)"
fi
doneConvert LIT to Other Formats
# Extract LIT and convert to EPUB/HTML
for file in *.lit; do
base=$(basename "$file" .lit)
# Check for DRM
if cabriolet lit-info "$file" | grep -q "Encrypted: Yes"; then
echo "Cannot convert $file: DRM-encrypted"
continue
fi
# Extract
cabriolet lit-extract "$file" "temp/$base"
# Convert HTML to other format (using external tools)
# pandoc "temp/$base/content.html" -o "$base.epub"
echo "Converted: $file -> $base.epub"
doneCreate eBook Collection
# Create LIT eBooks from HTML chapters
for book_dir in content/*/; do
book_name=$(basename "$book_dir")
# Gather files
html_files=("$book_dir"chapters/*.html)
images=("$book_dir"images/*)
# Create LIT file
cabriolet lit-create \
"ebooks/$book_name.lit" \
"${html_files[@]}" \
"${images[@]}"
echo "Created: $book_name.lit"
doneValidate eBook Library
# Validate all LIT files in library
echo "eBook Library Validation Report" > report.txt
echo "===============================" >> report.txt
echo >> report.txt
total=0
encrypted=0
corrupted=0
for file in library/*.lit; do
total=$((total + 1))
if ! cabriolet lit-info "$file" > /dev/null 2>&1; then
echo "CORRUPTED: $file" >> report.txt
corrupted=$((corrupted + 1))
elif cabriolet lit-info "$file" | grep -q "Encrypted: Yes"; then
echo "DRM: $file" >> report.txt
encrypted=$((encrypted + 1))
else
echo "OK: $file" >> report.txt
fi
done
echo >> report.txt
echo "Summary:" >> report.txt
echo " Total: $total" >> report.txt
echo " DRM-encrypted: $encrypted" >> report.txt
echo " Corrupted: $corrupted" >> report.txt
echo " Valid unencrypted: $((total - encrypted - corrupted))" >> report.txt
cat report.txtNext steps
-
Review Basic Usage Guide for usage examples
-
Study Ruby API Reference for Ruby integration
-
Learn about LZX compression
-
Understand DRM limitations