The kscli collection and category groups — manage data center containers and category hierarchies
A collection is the top-level container in the data center. Categories organize files inside a collection and support multi-level nesting. This group has 5 commands.
Shared conventions for authentication, workspace ID, global flags, output formats, and confirmation prompts are covered in the CLI overview. The examples below assume the workspace ID is already set in the config file.
Create a file data collection.
Parameters
Output
Show data collection details.
Parameters
The two are mutually exclusive; exactly one is required.
Output
List data center categories.
Parameters
Output
The category marked
Create a data center category.
Parameters
Output
Delete a data center category.
Parameters
Output
kscli collection create
Create a file data collection.
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <text> | string | Yes | Collection name, 1–20 chars |
--description <text> | string | Yes | Collection description |
--store-type <type> | string | No | Storage type, platform (managed, default) or custom (your own OSS bucket) |
--oss-region <id> | string | No | OSS region ID, required with --store-type custom |
--oss-bucket <name> | string | No | OSS bucket name, required with --store-type custom |
quiet mode prints the collection ID. json mode returns the full result.
Using your own OSS bucket
--store-type custom requires the bucket to be authorized for the platform. Beyond the RAM role authorization, the bucket must also carry the tag bailian-connector-access=ReadAndWrite. Without that tag, creation fails and the error message may point at CORS configuration even though the real cause is the missing tag.
Examples
kscli collection get
Show data collection details.
| Parameter | Type | Required | Description |
|---|---|---|---|
--collection-id <id> | string | One of two | Collection ID; mutually exclusive with --name |
--name <text> | string | One of two | Collection name; mutually exclusive with --collection-id |
quiet mode prints the collection ID. json mode returns the full result.
Storage settings (storage type, OSS region and bucket) are specified only at creation time and are not returned by queries.
Examples
kscli category list
List data center categories.
| Parameter | Type | Required | Description |
|---|---|---|---|
--collection-id <id> | string | No | Filter by exact collection ID |
--parent-id <id> | string | No | List sub-categories of this category |
--name <text> | string | No | Exact filter by category name |
--next-token <token> | string | No | Cursor pagination token, from the previous output |
--max-result <n> | number | No | Items per page, default 20 |
[default] is where files land when no category is specified.
quiet mode prints one category ID per line. json mode returns the full result.
This command uses cursor pagination — pass the --next-token <token> shown on the last output line into the next call to page forward.
--name is an exact match, unlike the fuzzy matching in kb list --name.
Examples
kscli category add
Create a data center category.
| Parameter | Type | Required | Description |
|---|---|---|---|
--name <text> | string | Yes | Category name, 1–20 chars |
--parent-id <id> | string | No | Create as a sub-category of this category |
--collection-id <id> | string | No | Create under this collection, defaults to the platform collection |
quiet mode prints the category ID. json mode returns the full result.
The new category ID can be used as the input for doc upload --category-id, kb create --category-id, or file list --category-id.
Examples
kscli category delete
Delete a data center category.
| Parameter | Type | Required | Description |
|---|---|---|---|
--category-id <id> | string | Yes | Category ID |
--yes | switch | No | Skip the confirmation prompt |
quiet mode prints nothing. json mode returns the full result.
Whether a category containing files or sub-categories can be deleted is decided by the server, and its error message is shown verbatim. Confirm the category is empty with kscli file list --category-id first.
Examples