---
url: /en/ai/codewiki.md
---
By configuring the CodeWiki pipeline, a code repository can automatically generate a wiki based on its content. A wiki portal will appear on the repository homepage, allowing you to quickly build a documentation center.

![CodeWiki Portal](/images/ai/cnb-codewiki-en.png)

## Specific Usage Instructions

### Step 1: Configure the pipeline to use the CodeWiki plugin

Plugin image name: [cnbcool/codewiki](https://cnb.cool/cnb/plugins/cnbcool/codewiki)

Configure the CodeWiki plugin in the repository's `.cnb.yml` file. The pipeline will be triggered when a new tag is created in the repository.

> Note: It is recommended to use the tag\_push event to avoid frequent wiki document generation. For more pipeline events, please refer to [Build Trigger Rules](../build/trigger-rule.md)

```yaml title=".cnb.yml"
$:
  tag_push:
    - services:
        - docker
      docker:
        volumes:
          - /data/codewiki/${CNB_REPO_SLUG}:data
      stages:
        - name: generate codewiki
          timeout: 10h
          image: cnbcool/codewiki:latest
          settings:
            git_doc_dir: /data/codewiki/${CNB_REPO_SLUG}
```

Some plugin parameters are described below. For more information, please refer to the [cnbcool/codewiki](https://cnb.cool/cnb/plugins/cnbcool/codewiki) plugin documentation.

|Parameter Name|Description|Default Value|Required|Remarks|
|---|---|---|---|---|
|`git_doc_dir`|Specify the directory for generating wiki documentation|None|Yes|None|

### Step 2: Using CodeWiki

Click the CodeWiki entry on the repository homepage to access the CodeWiki page.
