NPC Configuration
About 403 wordsAbout 1 min
NPC Configuration explains how to define dedicated AI assistant roles, where their knowledge comes from, and what entry button users see.
When to use: when you want a repository to ship with an AI assistant that knows your business, for example to set up a role that helps with code review and Q&A, to import AI configurations from other repositories for knowledge sharing, or to customize the knowledge base button so the assistant is easier to find.
Minimal Configuration
Configuring just one role is enough to provide your repository with an AI assistant that can be @-mentioned:
npc:
roles:
- name: Expert
prompt: |
You refer to yourself as "Expert" and are committed to providing professional, accurate technical answers.After configuration, use it by @repo-path(Expert) in an Issue or PR comment. For more usage, see NPC.
Configuration
Add the npc configuration to .cnb/settings.yml:
npc:
imports:
list:
- cnb/docs
roles:
- name: Code Assistant
slogan: code is cheap, show me your prompt
prompt: You are now Code Assistant, focused on helping write and optimize code
enableThinking: false
avatar:
src: ".cnb/knowledge-base-hover.png"
- name: Reviewer
prompt: |
You are a code reviewer, focused on code quality review and improvement suggestions.
defaultRepo: "cnb/docs"
defaultRole: "Reviewer"
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 selected role for the knowledge base popup |
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.