@junjie-wu/lyric-timer-cli
v1.2.3
Published
A command-line focus timer available as Docker image, NPM package, and executables.
Downloads
375
Maintainers
Readme
LyricTimer CLI
A command-line focus timer, available as a Docker image for containerized usage, an NPM package for both CLI usage and library integration, and as platform-specific executables.
⭐ Quick Start
# Using Docker
docker run -it --rm junjiewu0/lyric-timer-cli
# Using NPM (with CLI)
npx @junjie-wu/lyric-timer-cli
# Using NPM (as library)
npm install @junjie-wu/lyric-timer-cli
📚 Usage
🐳 Docker
# Using Pre-built Image
docker pull junjiewu0/lyric-timer-cli
docker run -it --rm junjiewu0/lyric-timer-cli
# For ARM-based machines (Apple Silicon, etc.)
docker pull --platform linux/amd64 junjiewu0/lyric-timer-cli
docker run -it --rm --platform linux/amd64 junjiewu0/lyric-timer-cli
# Build and Run Locally
docker build -t lyric-timer-cli .
docker run -it --rm lyric-timer-cli
📦 NPM Package
CLI Usage
# Run with default settings (25 minutes, 15-second lyric intervals)
npx @junjie-wu/lyric-timer-cli
# Or install globally
npm install -g @junjie-wu/lyric-timer-cli
lyric-timer
Library Integration
import { createTimer } from '@junjie-wu/lyric-timer-cli';
await createTimer({
duration: 25,
lyricInterval: 10
});
🧪 Executables
Running Locally with Node.js
# Build uncompressed version
npm run build:exe
# Run it
npm run start:built
Platform-specific Builds (Standalone, no Node.js required):
# Build compressed executables for all platforms
npm run build:exe:compress
# Run based on your platform:
npm run start:mac-arm # For ARM-based machines (Apple Silicon, etc.)
npm run start:mac-intel # For Intel Macs
npm run start:linux # For Linux
# For Windows:
# After running build:exe:compress:
# 1. Find lyric-timer-win-x64.exe.gz in the executables folder
# 2. Extract using 7-Zip, WinRAR, or similar tool
# 3. Run the extracted lyric-timer-win-x64.exe
📋 Examples
For working examples, check out the examples directory:
git clone https://github.com/junjie-w/lyric-timer-cli.git
cd lyric-timer-cli/examples
# Try different examples
npm install
npm run start:lib # Library usage
npm run start:cli # CLI usage
npm run start:docker # Docker usage
npm run start:exe # Executable usage
🍄 Features
- ⏱️ Configurable timer duration
- 🔄 Adjustable lyric change intervals
- ⏸️ Pause/Resume functionality
- 🎨 Interactive CLI interface (built with @clack/prompts and chalk)
Configuration Options
| Option | Type | Default | Description |
|----------|--------|-------------| ------------|
| duration
| number | 25 | Timer duration in minutes |
| lyricInterval
| number | 15 | Interval between lyric changes in seconds |
🛠️ Development
# Install dependencies
npm install
# Start development
npm run dev
# Run tests
npm test
# Build
npm run build
# Run the built application
npm start
🤝 Contributing
Contributions, issues, and feature requests are welcome. Feel free to check issues page.
🚀 Distribution
- NPM Registry: @junjie-wu/lyric-timer-cli
- Docker Hub: junjiewu0/lyric-timer-cli
- Platform-specific executables (see Executables)
📄 License
MIT