@tometrove/cli
v0.0.1
Published
CLI tool for working with .tome files
Maintainers
Readme
@tometrove/cli
CLI tool for working with .tome files
Installation
npm install -g @tometrove/cliOr use with npx without installing:
npx @tometrove/cli <command>Usage
Create a .tome file from a directory
tome create <path-to-tome.json>This command takes a path to a tome.json file and creates a .tome file from the parent directory. The process:
- Validates that
tome.jsonexists at the specified path - Zips the entire parent directory (where
tome.jsonis located) - Renames the zip file to have a
.tomeextension
Example:
tome create /path/to/my-book/tome.json
# Creates: /path/to/my-book.tomeThe tome.json file must be in the root of the directory you want to package as a tome file.
Read a .tome file
tome read <file>Options:
-v, --verbose- Display verbose output
Example:
tome read mybook.tome
tome read mybook.tome --verboseDisplay file information
tome info <file>Example:
tome info mybook.tomeHelp
tome --help
tome <command> --helpCommands
create <tomeJsonPath>- Create a .tome file from a directory containing tome.jsonread <file>- Read and display information about a .tome fileinfo <file>- Display metadata about a .tome file
Development
Building
npm install
npm run buildTesting locally
npm run dev -- read test.tomeOr link globally:
npm link
tome read test.tomeIntegration with tome-trove library
This CLI is designed to work with the tome-trove library for reading .tome files. To add the library as a dependency:
npm install tome-troveThen update the CLI code to import and use the TomeReader from tome-trove.
License
ISC
