This directory contains the source documentation for ICP CLI, written in Markdown.
docs/
├── index.md # Homepage
├── tutorial.md # Getting started tutorial
├── guides/ # How-to guides
├── concepts/ # Conceptual explanations
├── reference/ # Technical reference
├── migration/ # Migration guides
└── schemas/ # JSON schemas (not rendered)
Each Markdown file needs minimal YAML frontmatter with a title and description:
---
title: Your Page Title
description: A brief summary of what this page covers.
---
Content here...Starlight renders the title as the page's H1 heading, so do not add a separate # Heading in the content.
- Use standard Markdown — keep it simple and GitHub-friendly
- Always include
titleanddescriptionin frontmatter - Use relative links with
.mdextensions:[text](./other-doc.md)(works on GitHub; a rehype plugin strips.mdat build time) - Use
.mdfiles (not.mdx) for better GitHub rendering - Code blocks with language:
```bash - Use em dashes (
—) to separate list item subjects from descriptions:- **Term** — Description
Some docs are auto-generated from code:
reference/cli.md— Generated byscripts/generate-cli-docs.shfrom CLI command definitionsschemas/*.json— Generated byscripts/generate-config-schemas.shfrom Rust types
Run these scripts when command-line options or config types change.
The documentation website is built using Astro + Starlight. Starlight reads directly from the docs/ directory via a glob content loader — no preprocessing step is needed.
A rehype plugin (docs-site/plugins/rehype-rewrite-links.mjs) rewrites .md links at build time so that relative links with .md extensions work on both GitHub and the documentation site.
Docs are rendered automatically when browsing on GitHub. The directory structure provides natural navigation.
See the documentation website locally:
cd ../docs-site
npm run devThis starts a Starlight site at http://localhost:4321 that reads from this docs/ directory.
The documentation website is automatically built and deployed to GitHub Pages:
- URL: https://dfinity.github.io/icp-cli/
- Workflow:
.github/workflows/docs.yml - Triggers: Push to main, PRs, manual dispatch
- Create a
.mdfile in the appropriate directory - Add YAML frontmatter with
titleanddescription - Write standard Markdown content (no H1 heading — Starlight renders the title)
- Add the page to the sidebar in
../docs-site/astro.config.mjsunder the appropriate section:{ label: 'Guides', items: [ { label: 'Your New Guide', slug: 'guides/your-new-guide' }, // ... ], }
guides/— Task-oriented, step-by-step instructionsconcepts/— Understanding-oriented explanationsreference/— Information-oriented specificationsmigration/— Version or tool migration guides
This follows the Diátaxis documentation framework.