Deckflow CLI
TypeScript/Node.js implementation of deckflow-cli - File processing and conversion tools

A powerful command-line tool for file processing, conversion, and task management. This is a complete TypeScript port of the Python deckflow-cli, maintaining 100% feature parity while leveraging Node.js ecosystem best practices.
✨ Features
- 🚀 Fast File Processing - Compress, extract, and convert files with ease
- 🔄 Real-time Updates - Server-Sent Events (SSE) for live task progress
- 📦 Smart Uploads - Multi-part concurrent uploads with automatic deduplication
- 🎯 Type-Safe - Full TypeScript implementation with comprehensive type definitions
- 🔁 Auto-Retry - Automatic retry logic for network failures (429/5xx errors)
- 📊 JSON Output - Machine-readable output for scripting and automation
- 💬 Interactive REPL - REPL mode for batch operations
- 🌈 Beautiful UI - Progress indicators and colored output
📦 Installation
npm install -g deckflow
Or use without installing:
npx deckflow <command>
🚀 Quick Start
1. Configure Authentication
deckflow config set-token YOUR_TOKEN
deckflow config set-space YOUR_SPACE_ID
deckflow config set-api-base https://api.example.com
deckflow config show
2. Basic Usage
deckflow compress presentation.pptx
deckflow extract image.jpg --type ocr --language en
deckflow render slides.pptx --format pdf
deckflow file upload document.pdf
deckflow task list --limit 10
deckflow task get <task-id>
📖 Commands
Configuration Commands
deckflow config set-token <token>
deckflow config set-space <space-id>
deckflow config set-api-base <url>
deckflow config show
File Operations
deckflow file upload <path>
--no-progress
Task Management
deckflow task list
--type <type>
--limit <n>
--offset <n>
deckflow task get <task-id>
deckflow task delete <task-id>
Compress Files
deckflow compress <input-file>
--no-wait
--timeout <seconds>
Supported formats:
- Documents: ZIP, PPTX, KEY, DOCX, XLSX
- Videos: MP4, AVI, MOV, MKV
deckflow extract <input-file>
--type <type>
--language <lang>
--no-wait
--timeout <seconds>
Extract types:
ocr - Optical Character Recognition (images)
fonts - Font information (PPTX)
text-shapes - Text shapes (PPTX)
OCR Languages:
zh-hans, zh-hant, en, ja, ko, ar, de, es, fr, it, pt, ru
Render/Convert Files
deckflow render <input-file>
--format <format>
--no-wait
--timeout <seconds>
Output formats:
image - Convert to images (PPT, PPTX, PDF, KEY)
pdf - Convert to PDF (PPT, PPTX, DOC, DOCX, KEY)
video - Convert to video (PPT, PPTX)
html - Convert to HTML (KEY)
png - Convert to PNG (HTML, MD)
pptx - Convert to PPTX (PPT, HTML)
webp - Convert to WebP (JPG, JPEG, PNG)
Run Custom Tasks
deckflow run <task-type> <input-files...>
--param <key=value>
--no-wait
--timeout <seconds>
Example:
deckflow run convertor.ppt2pdf presentation.ppt --param quality=high
Interactive REPL
deckflow repl
deckflow> config show
deckflow> file upload test.pdf
deckflow> task list
deckflow> exit
🔧 Advanced Usage
JSON Output for Scripting
All commands support --json flag for machine-readable output:
deckflow --json config show
deckflow --json task list | jq '.tasks[0].id'
deckflow --json compress file.zip
Batch Processing
for file in *.pdf; do
deckflow file upload "$file"
done
deckflow repl
Progress Tracking
deckflow file upload large-file.mp4
deckflow file upload large-file.mp4 --no-progress
Non-blocking Operations
deckflow compress video.mp4 --no-wait
deckflow task get <task-id>
🏗️ Development
Requirements
- Node.js >= 18.0.0
- npm or yarn
Setup
git clone <repository-url>
cd nodejs-deckflow-cli
npm install
npm run build
npm test
npm run test:coverage
npm run dev
Project Structure
nodejs-deckflow-cli/
├── src/
│ ├── core/ # Core modules
│ │ ├── config.ts # Configuration management
│ │ ├── api-client.ts # API client with SSE
│ │ └── file-uploader.ts # File upload logic
│ ├── commands/ # CLI commands
│ ├── types/ # TypeScript types
│ ├── utils/ # Utilities
│ ├── context.ts # CLI context
│ └── cli.ts # Main entry
├── tests/
│ ├── unit/ # Unit tests
│ └── e2e/ # E2E tests
└── dist/ # Build output
Testing
npm test
npm run test:unit
npm run test:e2e
npm run test:coverage
Test Coverage:
- Config: 8 tests (100% coverage)
- API Client: 12 tests (100% coverage)
- File Uploader: 5 tests (100% coverage)
- E2E: 19 tests
- Total: 44 tests, all passing
🔑 Configuration
Configuration is stored in ~/.deckflow/config.json:
{
"token": "your-auth-token",
"spaceId": "your-space-id",
"apiBase": "https://api.example.com/v1"
}
Configuration options:
token - Authentication token (required)
spaceId - Workspace/space ID (required)
apiBase - API base URL (default: https://app.deckflow.com/v1)
signURI - Sign-in URI (optional)
🐛 Troubleshooting
"Not configured" error
Make sure you've set both token and space ID:
deckflow config set-token <your-token>
deckflow config set-space <your-space-id>
File upload fails
Check file exists and you have read permissions:
ls -l <file-path>
Task timeout
Increase timeout for large files:
deckflow compress large-file.mp4 --timeout 600
📄 License
MIT
🙏 Acknowledgments
This is a TypeScript port of the Python deckflow-cli, maintaining 100% feature compatibility while leveraging the Node.js ecosystem.
🔗 Links