|
1 | 1 | # dws-cli |
2 | 2 |
|
3 | | -CLI name: `dws` |
| 3 | +DWS CLI for the Nutrient Document Web Services (Processor API). This tool provides a local workflow for preflight checks, HTML‑to‑PDF conversion, benchmarking, reporting, and design skill packs. |
4 | 4 |
|
5 | | -Basic usage: |
| 5 | +> **Status:** This is an early scaffold. Several commands return **stub** outputs until API integration is wired in. |
| 6 | +
|
| 7 | +## Features |
| 8 | +- `dws setup` — store API key locally |
| 9 | +- `dws preflight` — validate HTML inputs (stub output) |
| 10 | +- `dws convert` — convert HTML → PDF (stub output) |
| 11 | +- `dws benchmark` — generate placeholder benchmark results |
| 12 | +- `dws report` — generate a markdown report from results |
| 13 | +- `dws skills` — manage design skill packs |
| 14 | + |
| 15 | +## Install |
| 16 | + |
| 17 | +```sh |
| 18 | +npm install |
| 19 | +npm run build |
6 | 20 | ``` |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +```sh |
7 | 25 | dws --help |
8 | 26 | ``` |
| 27 | + |
| 28 | +```sh |
| 29 | +dws setup --api-key <key> |
| 30 | +``` |
| 31 | + |
| 32 | +```sh |
| 33 | +dws preflight <htmlPath> |
| 34 | +``` |
| 35 | + |
| 36 | +```sh |
| 37 | +dws convert <htmlPath> --output output.pdf --deterministic |
| 38 | +``` |
| 39 | + |
| 40 | +```sh |
| 41 | +dws benchmark --suite W1-W6 --out results.json |
| 42 | +``` |
| 43 | + |
| 44 | +```sh |
| 45 | +dws report --in results.json --out report.md |
| 46 | +``` |
| 47 | + |
| 48 | +```sh |
| 49 | +dws skills list |
| 50 | +``` |
| 51 | + |
| 52 | +```sh |
| 53 | +dws skills add /path/to/skill |
| 54 | +``` |
| 55 | + |
| 56 | +## Configuration |
| 57 | +- API key can be supplied via `DWS_API_KEY` or stored in `~/.dws/config.json` using `dws setup`. |
| 58 | +- Config file is written with `0600` permissions. |
| 59 | + |
| 60 | +## Design Skill Packs |
| 61 | +A design skill pack is a folder containing a `design-skill.json` manifest, an entry HTML file, and assets (CSS/fonts/images). |
| 62 | + |
| 63 | +Example manifest: |
| 64 | +```json |
| 65 | +{ |
| 66 | + "name": "invoice-modern", |
| 67 | + "version": "0.1.0", |
| 68 | + "description": "Modern invoice template", |
| 69 | + "entry": "index.html", |
| 70 | + "assets": ["styles.css", "fonts/*"], |
| 71 | + "defaults": {"locale": "en-US", "paper": "A4"} |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +## Development |
| 76 | +- Node 18+ recommended |
| 77 | +- `npm run build` compiles to `dist/` |
| 78 | + |
| 79 | +## Release (manual) |
| 80 | +1. Update README/CHANGELOG and version in `package.json` |
| 81 | +2. `npm run build` |
| 82 | +3. `git tag vX.Y.Z` and `git push origin vX.Y.Z` |
| 83 | + |
| 84 | +## License |
| 85 | +Internal (PSPDFKit‑labs) |
0 commit comments