Skip to main content
Use this page when you want to change DocWriter itself. If you only want to write in DocWriter, follow the installation guide instead. Use a separate folder for your test documents so you can edit the application code and your writing independently.

Install the project

Use Node 22.22.2, the version in .nvmrc. If you use nvm, clone the repository and install the packages with:
If you don’t have that Node version installed, run nvm install once.

Run the development version

From the repository root, run:
You will have DocWriter open in your browser at http://127.0.0.1:5173, with ~/writing/docwriter-test as your writing workspace. The application code is from your local checkout; your documents are in the folder you specified. You can use an existing folder, or choose a new folder that will be created for you. You can also use the equivalent npm command:
Keep the terminal open while you work. Edit a Svelte component, stylesheet, or other application code in your checkout, then save; you will see the change in the browser through Vite’s automatic updates. You do not need to run npm run build after each edit. To run from another directory, use the full path to the development script:
Add --no-open if you want to open the browser yourself, or --port 5174 to choose another app port. The document sync connection is on port 3001 by default; you still need that port free when you choose another app port. Use npm run dev from the repository root if you want the repository itself as your writing workspace. Open http://localhost:5173 after starting it. You can edit documents without a provider credential. Follow Connect a provider when you want to test the agent.

When to restart or rebuild

Stop with Control+C, then run the development command again after changing environment variables, the launcher in bin/, or the document sync server in src/lib/server/ws-server.ts. The live document server is retained during automatic updates, so restart to test changes to that server. After changing dependencies, run npm install before restarting. Use node bin/docwriter-dev.js while changing the application code. With node bin/docwriter.js or the linked docwriter command, you use the compiled application in build/; run npm run build and restart to try new code through those commands. With their --watch option, you can see changes to workspace documents, but you still need to rebuild after changing application code.

Check your change

Run these checks in another terminal from the repository root before you open a pull request:
Use npm run check for TypeScript and Svelte checks, npm run test:unit for unit tests, and npm run build to check the production build. For provider smoke tests in e2e/, you need credentials for the provider you test. Before you finish, open a document from your test workspace and save a small UI change in your checkout. Confirm that you can see the change in the browser, and that you have no errors from the checks above.

Choose the next page