NPC Configuration
About 313 wordsAbout 1 min
Configure dedicated AI assistant roles, knowledge base, and interaction buttons to enable intelligent collaboration for your repository.
Use Cases
- Set up dedicated AI roles to assist with code review and Q&A
- Import AI configurations from other repositories for knowledge sharing
- Customize the knowledge base button to improve AI assistant discoverability
- Define the role's domain expertise and communication style through prompts
Configuration
Add the npc configuration to .cnb/settings.yml:
.cnb/settings.yml
npc:
imports:
list:
- cnb/docs
roles:
- name: Xiao Li
slogan: code is cheap, show me your prompt
prompt: You are now Xiao Li, a front-end development engineer
enableThinking: false
avatar:
src: ".cnb/knowledge-base-hover.png"
- name: Xiao Wang
prompt: |
You are a junior engineer,
Being cute is your main business,
defaultRepo: "cnb/docs"
defaultRole: "Junior Engineer"
button:
name: "Quick Ask AI"
description: "Click, start AI!"
hoverImage: ".cnb/knowledge-base-hover.png"Parameter Reference
Import Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.imports.list | string[] | - | List of repo paths to import AI configs from (e.g., cnb/docs) |
Role Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.roles[].name | string | - | Role name |
npc.roles[].slogan | string | - | Role slogan |
npc.roles[].prompt | string | - | Role description prompt |
npc.roles[].enableThinking | boolean | true | Whether to enable thinking mode |
npc.roles[].avatar.src | string | - | Avatar image, supports images from repo's default branch |
Global Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.defaultRepo | string | - | Default selected repository for the knowledge base popup |
npc.defaultRole | string | - | Default role name |
Knowledge Base Button Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.button.name | string | - | Button name |
npc.button.description | string | - | Button description |
npc.button.hoverImage | string | - | Hover image, only supports images from the repository's default branch |
Tips
Role avatars and knowledge base button hover images only support files from the repository's default branch. Simply provide the relative path from the repository root.