NPC Configuration
About 447 wordsAbout 1 min
Configure AI assistant roles, knowledge base, and interaction buttons for your repository to enable intelligent collaboration.
Use Cases
- Set up dedicated AI roles for your repository to assist with code review, Q&A, etc.
- Import AI configurations from other repositories for knowledge sharing
- Customize the knowledge base button to make the AI assistant more discoverable and usable
- Define the role's domain expertise and communication style through prompts
Configuration
Add the npc configuration to .cnb/settings.yml:
.cnb/settings.yml
# NPC Configuration
npc:
# Import AI configurations from other repositories
imports:
# List of referenced repositories
list:
- cnb/docs
# NPC role list for the current repository
roles:
- name: Xiao Li
# slogan
slogan: code is cheap, show me your prompt
# Role description prompt
prompt: You are now Xiao Li, a front-end development engineer
# Whether to enable thinking mode, boolean type, default is true
enableThinking: false
# Role avatar information
avatar:
# Avatar image address
# Only images from the repository's default branch can be used, fill in the path relative to the repository root directory, such as .cnb/knowledge-base-hover.png
src: ".cnb/knowledge-base-hover.png"
- name: Xiao Wang
prompt: |
You are a junior engineer,
Being cute is your main business,
# Default selected repository for knowledge base document popup
defaultRepo: "cnb/docs"
# Default role
defaultRole: "Junior Engineer"
# Web interface style for knowledge base button
button:
# Button name
name: "Quick Ask AI"
# Button description
description: "Click, start AI!"
# Only use images from the default branch of the repository, specify the path relative to the repository root directory, e.g., .cnb/knowledge-base-hover.png
hoverImage: ".cnb/knowledge-base-hover.png"Parameter Reference
Import Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.imports.list | string[] | - | List of repositories to import AI configurations 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, defining the role's domain expertise and communication style |
npc.roles[].enableThinking | boolean | true | Whether to enable thinking mode |
npc.roles[].avatar.src | string | - | Role avatar image path, only supports images from the repository's default branch |
Global Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.defaultRepo | string | - | Default selected repository for the knowledge base document popup |
npc.defaultRole | string | - | Default role name |
Knowledge Base Button Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
npc.button.name | string | - | Knowledge base button name |
npc.button.description | string | - | Knowledge base button description |
npc.button.hoverImage | string | - | Image displayed on hover, 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.