Skip to content
Docxcelerate

CLI

Commands

Every dxcl command, with the flags that matter.

The CLI is dxcl, and it ships inside the docxcelerate package. Run it one-off with npx docxcelerate <command>, or install the package and call dxcl directly — see Start Here.

dxcl init

Creates a workspace and installs its dependencies.

dxcl init my-documents
dxcl init my-documents --dir workspaces
dxcl init my-documents --blank

Run it with no arguments for a guided setup that asks for the template and the API endpoint.

FlagEffect
--dir <path>Create the workspace inside <path>
--blankSkip the example document
--official-serverPoint upload.endpoint at the official engine
--api-endpoint <url>Point upload.endpoint at your own service
--no-api-endpointLeave upload.endpoint empty

dxcl document new

Creates a document project inside a workspace.

dxcl document new tenancy-renewal --title "Tenancy Renewal"

Writes documents/tenancy-renewal/ with document.project.ts, document.tsx, document-style.ts, preview-data.ts, types.ts, and derivers/ and nodes/ directories. See document projects for what each file is for.

dxcl document node

Generates a node component and registers it.

dxcl document node documents/tenancy-renewal next-steps --type paragraph
dxcl document node documents/tenancy-renewal signature  --type image
dxcl document node documents/tenancy-renewal rent-trend --type graph
FlagValues
--typeparagraph, image, graph

The generator writes nodes/<name>.node.tsx and updates nodes/index.ts. It does not place the node in your template — add it to document.tsx at the point in the document where it belongs.

The node it writes starts with its content. What makes a node generated is setting prompts on it, which a component decides with data in hand — so there is nothing to choose here. See writing nodes.

dxcl list

Prints the registry: every theme and every prebuilt component the package ships.

dxcl list
dxcl list themes
dxcl list components

The same catalog is browsable at themes and components, where each entry carries a preview rendered by the renderer the CLI ships.

dxcl show

Prints one entry in full — what it is, what it reads, and where its files land.

dxcl show slate-report
dxcl show payment-summary

dxcl add

Installs themes and components into a document project.

dxcl add slate-report
dxcl add letterhead signature-block
dxcl add payment-summary --project documents/arrears-notice
FlagEffect
--project <dir>The document project to install into
--forceOverwrite files that are already there

With no --project, the command uses the document project you are standing in, or the only one under documents/. Where there are several and none is implied, it says so rather than guessing.

A component is copied in as source — nodes/<name>.node.tsx — and re-exported from nodes/index.ts. It is then your file: it has no version, it is never upgraded behind you, and editing it is the expected next step rather than a fork. What it does not do is edit your data type, so the fields the component reads are printed for you to add. Placing it in document.tsx is yours too, for the same reason the node generator leaves that alone.

A theme is written out as the project’s document-style.ts, which document.project.ts already passes through — so the next preview is themed. The file imports the theme and spreads it, so overriding one margin is a line rather than a fork:

export const documentStyle: DocumentStyle = themeStyle(slateReportTheme, {
  page: { margins: { topMm: 20 } },
});

Installing a second theme replaces a document-style.ts that nothing has touched. Once you have written into it, replacing it needs --force — the point of the file is that it is yours.


Edit this page on GitHub ↗ Read this page as Markdown