Start Here
Start Here
Install the CLI, scaffold a workspace, and open your first document in the browser.
Docxcelerate needs Node.js 20 or newer and nothing else. Authoring, preview and DOCX packing all run locally — there is no account to create and no service to reach before you see a document.
Scaffold a workspace
npx docxcelerate init my-letters
cd my-letters
npm run dev
dxcl init creates a self-contained Vite workspace and installs its
dependencies. npm run dev opens the preview site, where you can pick a document,
resolve it against preview data, pack it into a real .docx in the browser, and
read it back with docx-preview.
Run dxcl init with no arguments for a guided setup that asks for the template
and the API endpoint.
Installing it properly
The command is npx docxcelerate, not npx dxcl — npx resolves the package
name, and the binary inside it is called dxcl.
To get dxcl on your path so you can use it directly:
npm install -g docxcelerate
dxcl init my-letters
Or add it to an existing project, where npx dxcl then resolves locally:
npm install --save-dev docxcelerate
npx dxcl init my-letters
What you get
my-letters/
docxcelerate.config.json
index.html
package.json
preview/
main.ts
styles.css
vite.config.ts
tsconfig.json
letters/
docxcelerate.config.json holds named presets for build and upload behaviour.
Everything else is an ordinary Vite project — you can open it in your editor and
it will behave like one.
Create a document
dxcl letter new tenancy-renewal --title "Tenancy Renewal"
That writes a document project under letters/tenancy-renewal/, with the template,
preview data, styles and types kept in separate files:
letters/tenancy-renewal/
letter.project.ts
letter-style.ts
letter.tsx
preview-data.ts
types.ts
nodes/
index.ts
Add a node
dxcl letter node letters/tenancy-renewal next-steps --type paragraph --mode dynamic
The generator writes nodes/next-steps.node.ts and updates nodes/index.ts.
Placement is left to you on purpose — add the generated component to
letter.tsx at the point in the document where it belongs.
/** @jsxImportSource docxcelerate/template */
import { Document, Section, template } from "docxcelerate/template";
import { Greeting, NextSteps } from "./nodes/index.ts";
import type { LetterData } from "./types.ts";
export const letterTemplate = template<LetterData>(
<Document id="tenancy-renewal" title="Tenancy Renewal">
<Section id="opening" title="Opening">
<Greeting />
</Section>
<Section id="closing" title="Closing">
<NextSteps />
</Section>
</Document>,
);
Save, and the preview reloads with the new node in place.
Where to go next
- Documents and nodes — the component model
- The node model — every node type, with previews of each
- Static and dynamic — what runs locally, what needs an endpoint
- Package entrypoints — everything importable