/Data Source/CNB
app icon

CNB

Verified by Dify
No ratings yet
0
H
haiminovo/cnb_datasource

CNB datasource - import repositories, files, issues, and pull requests

ProductivityRAG

CNB Datasource for Dify

Import repositories, source files, issues, pull requests, and comments from
CNB into Dify knowledge pipelines.

Source repository:
https://github.com/haiminovo/cnb_datasource

Features

  • Import repository metadata and README files
  • Recursively list source, configuration, and documentation files
  • Import issues, pull requests, labels, and comments
  • Filter imports to one or more repository paths
  • Support CNB SaaS and enterprise API endpoints
  • Read-only access to CNB data

Requirements

  • Dify 1.9.0 or later
  • Python 3.12 plugin runtime
  • A CNB access token or an approved CNB OAuth application

Setup

1. Create a CNB access token

Open CNB Personal Settings, then create an access token with these scopes:

Private repositories also require the matching private-resource scope and
repository access.

For a repository-scoped token, set in the datasource
credentials. Validation then skips and , and checks only:

That mode requires and , but does not require
or .

2. Connect the datasource in Dify

Configure:

  • : the token created above
  • : for CNB SaaS
  • : for CNB SaaS

For an enterprise deployment, replace the URL fields with the deployment
endpoints.

3. Configure the import

  • : optional comma-separated paths such as
  • : optional CNB ; leave empty for the default
    branch
  • : default
  • : enabled by default
  • : default
  • : default
  • : default

After the page list is generated, select the repository metadata, README, code,
issue, and pull request documents that should be imported.

Repository paths

Copy the repository path from the CNB browser URL. For example:

The corresponding repository path is:

Accepted formats:

Multiple repositories can be separated by commas or new lines:

Do not enter only the repository name, such as . The full
namespace path is required. Leave this field empty to scan all repositories
accessible to the configured CNB token.

only limits automatic repository discovery. Explicit
repository paths are all processed and are not truncated by that value.

If you leave repository paths empty and also set a ref, the plugin applies that
ref to every accessible repository. Repositories where the ref does not exist or
cannot be read are shown with and their README/code files
are skipped. This prevents one inaccessible repository from failing the whole
datasource.

Branch, tag, and commit

The import form exposes three optional fields:

Set only one of them:

FieldExampleResolution
BranchResolves the branch through the CNB branches API
TagResolves the tag through the CNB tags API
Commit SHAUses the commit SHA directly

If all three fields are empty, the repository default branch is used. Setting
more than one field returns a validation error.

The plugin resolves branch and tag values to a commit SHA before reading files.
This keeps branch and tag names distinct when both use the same name. For branch
names containing slashes, enter the complete name directly, such as
.

Import Behavior

  • Access is read-only.
  • Leave the ref empty to read the repository default branch through CNB .
  • Set the ref to a branch, tag, or commit SHA to import that version.
  • Generated output, dependency, cache, binary, and lock directories are skipped.
  • Code files are exposed as separate Dify documents.

OAuth

The plugin includes a CNB OAuth 2.0 authorization flow. CNB currently requires
an operator to approve and register OAuth applications. Access-token
authentication is the recommended setup for normal use.

Connection

The plugin connects directly to:

For enterprise deployments, the configured API and web endpoints are used
instead.

Privacy

The plugin accesses only CNB data allowed by the configured token or OAuth
authorization. The data is sent directly to CNB and the Dify installation that
runs the plugin. See PRIVACY.md for details.

Development

CATEGORY
Data Source
VERSION
0.0.13
haiminovo·Updated 2 days ago
REPOSITORY
https://github.com/haiminovo/cnb_datasource
REQUIREMENTS
Maximum memory
256MB
Access domain
DeclaredDetected
DeclaredDetected
Security
Security Rating

Last checked 10/10/2026 10:53 AM · version 0.0.13

Give a rate
SHARE WITH