deckops
v0.4.2
Published
Deck operate CLI tool - File processing and conversion tools
Maintainers
Readme
Deckops CLI
Deckops CLI is a TypeScript command-line tool for Deckflow file processing workflows (create, translate, compress, convert, extract, OCR, and task management).
Features
- File upload + task creation for Deckflow backend
- Built-in task polling with timeout and non-blocking mode
- Browser-based login flow with local callback server
- Auto re-login on 401 and checkout flow on 402
- JSON output mode (
--json) for automation scripts - Interactive REPL mode for repeated operations
Installation
Install globally:
npm install -g deckopsOr run from source in this repository:
npm install
npm run build
node dist/cli.js --helpCLI executable name from this package is
deckops.
Quick Start
1) Login (recommended)
deckops loginThis command opens a browser, receives the callback at http://localhost:3737, and saves credentials into local config.
2) Basic usage
# Compress
deckops compress presentation.pptx
# OCR
deckops ocr image.jpg --language en
# Convert PPTX to PDF
deckops convert slides.pptx --to pdf
# Generate with text prompt only
deckops create --input-text "请写一份产品发布会方案"
# Translate document (model is required)
deckops translate handbook.docx --from zh --to en --model Standard
# Join multiple PPTX files in order
deckops join part1.pptx part2.pptx part3.pptx
# List recent tasks
deckops task list --limit 10Commands
Global options
deckops --json <command>--json: machine-readable JSON output
Login
deckops login [--port <port>]- Default callback port:
3737
Config
deckops config set-token <token>
deckops config set-space <space-id>
deckops config set-api-base <url>
deckops config showTask management
deckops task list [--type <type>] [--limit <n>] [--offset <n>]
deckops task get <task-id>
deckops task delete <task-id>Compress
deckops compress <input-file> [--no-wait] [--timeout <seconds>]Supported input extensions:
- Document/archive:
.zip,.pptx,.key,.docx,.xlsx - Video:
.mp4,.avi,.mov,.mkv
OCR
deckops ocr <input-file> [--language <lang>] [--no-wait] [--timeout <seconds>]- Default language:
zh-hans - Supported languages:
zh-hans,zh-hant,en,ja,ko,ar,de,es,fr,it,pt,ru - Supported input extensions:
.jpg,.jpeg,.png
Extract
deckops extract <input-file> [--type <type>] [--no-wait] [--timeout <seconds>]- Extract types:
fonts->pptx.getFontInfotext-shapes->pptx.getTextShapes
- Auto-detection currently supports
.pptx(defaults topptx.getFontInfo)
Convert
deckops convert <input-files...> --to <format> [--width <number>] [--height <number>] [--need-embed-fonts [boolean]] [--no-wait] [--timeout <seconds>]Supported output formats:
image:.ppt,.pptx,.pdf,.keypdf:.ppt,.pptx,.doc,.docx,.keyvideo:.ppt,.pptxhtml:.keypng:.html,.mdpptx:.ppt,.htmlwebp:.jpg,.jpeg,.png
Notes:
--width/--heightonly apply to HTML -> PPTX and HTML -> PNG conversion (.html --to pptx/.html --to png) and will be sent to the backend as task params.--need-embed-fontsonly applies to HTML -> PPTX conversion and maps to task paramneedEmbedFonts(default:false).- Multiple input files are currently supported only for HTML -> PPTX conversion.
Create
deckops create [input-files...] [--input-text <text>] [--enable-search [boolean]] [--advanced-model [boolean]] [--fast-mode [boolean]] [--intent <intent>] [--audience <audience>] [--page-count <number>] [--author <name>] [--no-wait] [--timeout <seconds>]Rules:
- At least one of
--input-textor input files is required. - Up to 2 reference files are allowed.
- Supported file extensions:
.html,.pdf,.docx,.pptx,.txt,.md,.mm,.xmind,.ipynb
Example:
deckops create --input-text "写一份面向开发者的 API 设计文档"
deckops create refs.md refs.pdf --input-text "根据参考资料输出总结" --audience "工程团队" --page-count 6Translate
deckops translate <input-file> --from <language> --to <language> --model <Standard|Pro> [--use-glossary [boolean]] [--image-translate [boolean]] [--no-wait] [--timeout <seconds>]Rules:
- Exactly one input file is required.
- Supported file extensions:
.docx,.pptx,.pdf,.xlsx,.key --modelis required and must be one of:Standard,Pro
Example:
deckops translate report.docx --from zh --to en --model Standard
deckops translate slides.pdf --from ja --to zh-hans --model ProJoin (pptx)
deckops join <input-files...> [--name <name>] [--no-wait] [--timeout <seconds>]Merges multiple .pptx files into a single deck using the pptx.join task. Files are merged in the order given on the command line, so the first file becomes the start of the merged deck.
- Requires at least 2
.pptxfiles - All inputs must have the
.pptxextension --nameoverrides the task name (defaults to the first input file's base name)
Example:
deckops join cover.pptx chapter-1.pptx chapter-2.pptx appendix.pptx
deckops join a.pptx b.pptx --name combined-deck --timeout 600Run explicit task type
deckops run <task-type> <input-files...> [--param <key=value>] [--no-wait] [--timeout <seconds>]--param can be repeated and values are parsed as JSON when possible.
Example:
deckops run convertor.ppt2pdf demo.ppt --param quality="high"
deckops run some.task input.pdf --param retries=3 --param debug=trueREPL
deckops replInside REPL:
deckflow> config show
deckflow> task list
deckflow> exitAuthentication behavior
- If
tokenorspaceIdis missing, most API commands will trigger login flow automatically. - On backend
401, client will auto prompt login and retry. - On backend
402, client will open browser checkout flow, then continue.
Configuration
Config file path:
~/.deckops/config.json
Common fields:
token: auth tokenspaceId: workspace/space identifierapiBase: API base URL (default:https://app.deckflow.com/v1)signURI: optional sign-in URI field
Example:
{
"token": "your-auth-token",
"spaceId": "your-space-id",
"apiBase": "https://app.deckflow.com/v1"
}Development
Requirements:
- Node.js >= 18
Setup:
npm install
npm run build
npm run typecheck
npm run lint
npm testUseful scripts:
npm run buildnpm run devnpm run testnpm run test:unitnpm run test:e2enpm run test:coveragenpm run lintnpm run formatnpm run typecheck
License
MIT
