Code Wiki
About 459 wordsAbout 2 min
By configuring the CodeWiki pipeline, you can automatically generate Wiki documentation from your repository's code. A Wiki portal will appear on the repository homepage, enabling quick documentation center setup.

Generating via NPC
The quickest way is to summon the npc/codewiki NPC to generate or update CodeWiki on demand, without configuring .cnb.yml in your own repository.
Star the npc/codewiki repository.
In the repository's Issue or Pull Request comments, summon the NPC with
@npc/codewiki(codewiki)followed by the task, for example:@npc/codewiki(codewiki) generate codewiki @npc/codewiki(codewiki) update codewiki
The NPC checks the environment, starts the CodeWiki container, tracks the run status, validates the output, and queries the platform-side knowledge base to confirm the ingestion result.
By default this NPC uses the CNB AI endpoint with knowledge base ingestion enabled (embedding model bge-m3). For configurable parameters and fallback behavior, see the npc/codewiki repository.
For NPC concepts and summoning rules, see NPC.
Generating via Pipeline
Use the pipeline plugin when you need Wiki generation to run automatically on events such as tag pushes.
Step 1: Configure the Pipeline
Plugin image: cnbcool/codewiki
Configure the CodeWiki plugin in the repository's .cnb.yml. It is recommended to use the tag_push event to avoid frequent Wiki generation. For more event types, see Build Trigger Rules.
$:
tag_push:
- docker:
image: cnbcool/codewiki:latest
stages:
- name: generate codewiki
timeout: 10h
settings:
git_doc_dir: /data/codewiki/${CNB_REPO_SLUG}Key parameters:
| Parameter Name | Description | Default Value | Required |
|---|---|---|---|
git_doc_dir | Directory for generating Wiki documentation | None | Yes |
use_codebuddy | Whether to use the CodeBuddy endpoint; 1 for CodeBuddy, 0 for CNB AI | 1 | No |
llm_model_name | Name of the LLM model to use | deepseek-v3.1 | No |
knowledge_enabled | Whether to enable knowledge base ingestion | false | No |
knowledge_embedding_model | Knowledge base embedding model name | hunyuan | No |
knowledge_chunk_size | Text chunk size (token count) | 1500 | No |
knowledge_chunk_overlap | Overlapping token count between adjacent chunks | 0 | No |
When
knowledge_enabledis set totrue, generated Wiki docs are automatically ingested into the repository knowledge base.
For more information, see the cnbcool/codewiki plugin documentation.
Step 2: Access CodeWiki
Click the Wiki portal on the repository homepage to access the CodeWiki page.
Automatic Knowledge Base Integration
Content generated by CodeWiki is automatically synced to the repository's knowledge base. Once synced, the repository will be marked as a knowledge base, enabling AI-based Q&A on CodeWiki content.
For more details on knowledge base configuration and usage, see Knowledge Base.