Skip to main content

init

Initializes a new htmldocs project in the current directory.

login

Authenticates the CLI with the cloud. This allows you to publish your documents to the cloud.

dev

Starts a local development server that will watch your files and automatically rebuild your document template when you make changes. Login not required.
Options
string
default:"./documents"
Change the directory of your document templates.
string
default:"3000"
Port to run dev server on

publish <file>

Publishes the document to the cloud for API use. Must be authenticated.
Be sure to run this from the root of your project.
Options
string
required
The file path of the document to publish.

--help

Shows all available commands and options.
Options
boolean
Enable verbose logging
F.A.Q
You can define preview props for your document by adding a PreviewProps property to your default export. For example:
These props will be used when previewing the document in the development server.
To publish documents, you need to authenticate with the cloud service. Use the htmldocs login command to start the authentication process. This will open a browser window where you can select a team and complete the authentication. Once authenticated, your tokens will be securely stored for future use.
By default, built files are stored in a dist directory in your project root. You can customize this location by setting the NEXT_PUBLIC_USER_PROJECT_LOCATION environment variable.