npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@deckflow/cli

v0.4.0

Published

Deckflow CLI - File processing and conversion tools

Downloads

32

Readme

Deckflow CLI

Deckflow CLI helps you convert, extract, ocr from the command line.

Tests Coverage TypeScript Node

A powerful command-line tool for file processing, conversion, and task management.

✨ 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/cli

Or use without installing:

npx @deckflow/cli <command>

🚀 Quick Start

1. Configure Authentication

# Set your authentication token (required)
deckflow config set-token YOUR_TOKEN

# Optional: Set your workspace/space ID (defaults to 'UMYSELF')
deckflow config set-space YOUR_SPACE_ID

# Optional: Set custom API base URL
deckflow config set-api-base https://api.example.com

# View current configuration
deckflow config show

2. Basic Usage

# Compress a file
deckflow compress presentation.pptx

# Extract text from image (OCR)
deckflow ocr image.jpg --language en

# Convert PowerPoint to PDF
deckflow convert slides.pptx --to pdf

# List tasks
deckflow task list --limit 10

# Get task details
deckflow task get <task-id>

📖 Commands

Configuration Commands

deckflow config set-token <token>      # Set authentication token
deckflow config set-space <space-id>   # Set workspace ID
deckflow config set-api-base <url>     # Set API base URL
deckflow config show                    # Show current configuration

Task Management

deckflow task list                      # List all tasks
  --type <type>                         # Filter by task type
  --limit <n>                           # Maximum results (default: 50)
  --offset <n>                          # Pagination offset (default: 0)

deckflow task get <task-id>             # Get task details
deckflow task delete <task-id>          # Delete a task

Compress Files

deckflow compress <input-file>          # Compress a file
  --no-wait                             # Don't wait for completion
  --timeout <seconds>                   # Timeout in seconds (default: 300)

Supported formats:

  • Documents: ZIP, PPTX, KEY, DOCX, XLSX
  • Videos: MP4, AVI, MOV, MKV

OCR (Optical Character Recognition)

deckflow ocr <input-file>               # Extract text from images
  --language <lang>                     # OCR language (default: zh-hans)
  --no-wait                             # Don't wait for completion
  --timeout <seconds>                   # Timeout in seconds (default: 300)

Supported languages: zh-hans, zh-hant, en, ja, ko, ar, de, es, fr, it, pt, ru

Supported formats: JPG, JPEG, PNG

Extract Information

deckflow extract <input-file>           # Extract information from files
  --type <type>                         # Extract type: fonts, text-shapes
  --no-wait                             # Don't wait for completion
  --timeout <seconds>                   # Timeout in seconds (default: 300)

Extract types:

  • fonts - Font information (PPTX)
  • text-shapes - Text shapes (PPTX)

Convert Files

deckflow convert <input-file>           # Convert file format
  --to <format>                         # Required: output format
  --no-wait                             # Don't wait for completion
  --timeout <seconds>                   # Timeout in seconds (default: 300)

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...>   # Run task with explicit type
  --param <key=value>                       # Task parameters (repeatable)
  --no-wait                                 # Don't wait for completion
  --timeout <seconds>                       # Timeout in seconds (default: 300)

Example:

deckflow run convertor.ppt2pdf presentation.ppt --param quality=high

Interactive REPL

deckflow repl                           # Start interactive mode

# In REPL:
deckflow> config show
deckflow> compress presentation.pptx
deckflow> task list
deckflow> exit

🔧 Advanced Usage

JSON Output for Scripting

All commands support --json flag for machine-readable output:

# Get configuration as JSON
deckflow --json config show

# List tasks as JSON
deckflow --json task list | jq '.tasks[0].id'

# Compress and get result as JSON
deckflow --json compress file.zip

Batch Processing

# Process multiple files
for file in *.pptx; do
  deckflow compress "$file"
done

# Or use REPL mode
deckflow repl

Non-blocking Operations

# Start task without waiting
deckflow compress video.mp4 --no-wait

# Check task status later
deckflow task get <task-id>

🏗️ Development

Requirements

  • Node.js >= 18.0.0
  • npm or yarn

Setup

# Clone repository
git clone <repository-url>
cd nodejs-deckflow-cli

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run with coverage
npm run test:coverage

# Development mode
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

# Run all tests
npm test

# Run unit tests only
npm run test:unit

# Run E2E tests only
npm run test:e2e

# Run with coverage
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 (optional, default: UMYSELF)
  • apiBase - API base URL (default: https://app.deckflow.com/v1)
  • signURI - Sign-in URI (optional)

🐛 Troubleshooting

"Not configured" error

Make sure you've set your authentication token:

deckflow config set-token <your-token>

# Optionally set space ID (defaults to 'UMYSELF')
deckflow config set-space <your-space-id>

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