Card
Two lines at most.
This page explains how to run the Niko docs on your computer, how to write a page that reads like the rest of the site, and which components and diagrams you can use.
The short version: write for a busy person who has never seen Niko's code. Lead with the answer. Use short sentences, "you", and a diagram whenever something moves between parts.
The docs are an Astro Starlight site in the docs folder. It has its own lockfile, like desktop.
For a documentation-only change, use Node.js 24.21.0 or newer and pnpm 10.34.5. You do not need the app dependencies, Docker, a running Niko instance, or a model connection.
Install the docs dependencies.
pnpm --dir docs install --frozen-lockfileStart the dev server. It reloads when you save a page.
pnpm --dir docs devOpen http://localhost:4321/docs/ in your browser.
Before you open a pull request, build the site. The build fails on a broken link or a missing heading anchor.
pnpm --dir docs buildOn every pull request that changes the site, the Docs workflow builds it as it ships to niko.neoskyai.com, checks every internal link, and attaches the built site to the run as the niko-site artifact.
The niko Cloudflare Worker serves niko.neoskyai.com and niko.neosky.ai as static assets: the landing page, src/pages/next.astro, at the root and these docs under /docs/. The build puts the docs under /docs/, then copies the landing page and the 404 page to the root. docs/wrangler.jsonc names the Worker, points it at the built site folder and serves 404.html for unknown addresses. The custom domains are set on the Worker in Cloudflare, not in that file.
Every push to main that changes the site runs the Docs workflow, which builds the site and deploys it. To redeploy without a change, run the workflow on main from the Actions tab. The deploy job runs wrangler deploy in the niko-site GitHub environment, which only main can use, and reads its CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN secrets. The token needs Workers Scripts: Edit on the account. That permission covers every Worker in the account, so keep the token in that environment only.
To deploy by hand, build the site as the workflow does, put it in a site folder at the repository root, then run npx wrangler login and npx wrangler deploy --config docs/wrangler.jsonc.
docs/public/_headers sets the response headers for the landing page and docs. docs/public/_redirects sends /terms and /privacy, the addresses the app and landing page link to, to the legal pages under /docs/legal/. The workflow copies both files to the site root, where the Worker applies them.
The headers set HSTS for one year, block framing, prevent content type guessing, and disable camera, microphone, location, payment, and USB access. The Content Security Policy limits scripts, connections, fonts, and frames to the site and required services. Images can load from HTTPS addresses. Inline scripts, inline styles, and eval() remain allowed for the current pages and tag manager consent variables. This also permits WebAssembly for docs search. These exceptions limit protection against script injection.
When you add a script, font, embed, or external request, update the policy only for the source it needs. Check the built site in a browser for blocked resources. After deployment, use curl -sI https://niko.neoskyai.com/ and curl -sI https://niko.neoskyai.com/docs/ to check the headers. Cloudflare zone settings can change the final response. Check that HSTS has max-age=31536000 or a longer lifetime.
docs/public/.well-known/security.txt lists the private reporting route. The workflow publishes it at /.well-known/security.txt and /security.txt. The site artifact includes hidden files so the .well-known folder reaches the deploy job. Keep the reporting links current and renew Expires before it passes, with a date less than one year ahead.
Each folder under src/content/docs is one sidebar section. The file name becomes the URL, so trust/payments.md is published at /trust/payments/. Set the order inside a section with sidebar.order in the front matter.
Use .md for most pages. Use .mdx only when the page needs a component such as <Steps> or <Tabs>.
---title: Do the thingdescription: One sentence that says what this page helps you do. Search engines and link previews show it.sidebar: order: 3---
One sentence that answers the question this page is about.
A short paragraph with the context a newcomer needs.
## Do the thing
1. Open **Settings → Example**.2. Turn on **Example**.
## How it works
A diagram, then two or three short paragraphs.
## Related resources
- [Parent page](/use/chat/)- [Sibling page](/use/tasks/)Niko's docs follow the n8n docs style, which builds on the Microsoft Writing Style Guide.
| Avoid | Use instead |
|---|---|
| utilize, leverage | use |
| in order to | to |
| functionality, capabilities | features, what it does |
| It's important to note that X | X |
| Niko provides a powerful, seamless way to ... | Niko lets you ... |
| The owner | you |
| Pi, the agent, the LLM (in user pages) | Niko, or the model |
code. Placeholders look like <your-key>.caution aside.Write internal links as site paths that start and end with /. The build adds the /docs/ prefix and checks that every page and heading exists.
See [Approve one payment](/trust/payments/#approve-one-payment).Link to source files with full GitHub URLs, such as src/server/trust.ts. Link at the first useful mention only.
Import components at the top of an .mdx page:
import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components';Use an aside for one thing the reader must not miss. Keep it to two sentences.
:::caution[Back up the Vault key]Saved logins can't be read without it.:::Asides work in .md and .mdx pages.
Wrap a numbered list in <Steps> for a procedure. Each step starts with a verb.
Use tabs when the same task differs by platform or setup.
Niko keeps the Vault key in the macOS Keychain.
The Flatpak protects the Vault key with your desktop's Secret Service.
Tabs with the same syncKey switch together across the page.
Use cards for a short grid of ideas, and link cards to send readers onward.
Card
Two lines at most.
Another card
Starlight's icon names work here.
Mark status inline: Preview Local only New.
<Badge text="Local only" variant="note" />Give a code block a title when it's a file or a terminal. Mark lines to draw attention.
PORT=4310NIKO_VAULT_KEY=<your-key>OPENAI_API_KEY=<your-key>```sh title=".env" {2} ins={3}PORT=4310NIKO_VAULT_KEY=<your-key>OPENAI_API_KEY=<your-key>```Store screenshots in src/assets/screens and use synthetic data only. Write alt text that says what the image shows.
Draw diagrams with Mermaid in a mermaid code block. They follow the site's light and dark theme. Keep each diagram small: about eight boxes, short labels and one idea. Draw decisions as hexagons, {{Like this?}}, because diamonds grow very tall. Prefer flowchart TD when a left-to-right chart would be wider than about five boxes.
Add a class to highlight a box:
| Class | Use it for |
|---|---|
:::accent |
The part the page is about, or you |
:::muted |
Background or optional parts |
:::go |
A step that runs |
:::stop |
A step that is refused or held |
Use a flowchart for parts and the paths between them.
flowchart LR
action[App action] --> check{{Allowed?}}
check -- yes --> run[Run it]:::go
check -- not sure --> ask[Ask you]:::accent
ask -- no --> stop[Don't run]:::stop
ask -- yes --> run
```mermaidflowchart LR action[App action] --> check{{Allowed?}} check -- yes --> run[Run it]:::go check -- not sure --> ask[Ask you]:::accent ask -- no --> stop[Don't run]:::stop ask -- yes --> run```Use a sequence diagram when the order of messages matters.
sequenceDiagram actor You participant Niko participant Server participant Site as Website You->>Niko: Read the report with my saved login Niko->>Server: Use this account on this website Server->>Server: Check task, account and website Server->>Site: Fill in and submit privately Site-->>Niko: Page after sign-in, secrets masked Niko-->>You: Here is the report
Use a state diagram for something that moves through a few states.
stateDiagram-v2 direction LR [*] --> Running: claim saved Running --> Submitted: entry finished Running --> Uncertain: interrupted Submitted --> [*] Uncertain --> [*]
pnpm --dir docs build passes.