The kscli file group — inspect and delete source files in the data center
The data center is the storage layer for Knowledge Base files. Files enter it through
List files under a data center category.
Parameters
Output
This command uses cursor pagination — pass the
Show details of a data center file.
Parameters
Output
Both
Permanently delete a file from the data center.
Parameters
Output
Examples
doc upload or doc import-oss and are then imported into Knowledge Bases, and one file can be referenced by several Knowledge Bases. This group has 3 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.
kscli file list
List files under a data center category.
| Parameter | Type | Required | Description |
|---|---|---|---|
--category-id <id> | string | Yes | Category ID, exact match. Get it from category list |
--name <text> | string | No | Exact filter by file name without its extension. For a.md, pass a |
--file-id <id> | array | No | Exact filter by file ID, repeatable |
--next-token <token> | string | No | Cursor pagination token, from the previous output |
--max-result <n> | number | No | Items per page |
quiet mode prints one file ID per line. json mode returns the full result.
--category-id must be a real category ID; the literal default is not accepted and returns an empty list. Get the real ID from kscli category list or the category field in kscli file get output.--next-token <token> shown on the last output line into the next call to page forward.
--name is an exact match and excludes the file extension, unlike the fuzzy matching in kb list --name.
Examples
kscli file get
Show details of a data center file.
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-id <id> | string | Yes | Data center file ID |
quiet and json modes return the full JSON result.
The category field in the output can be used as the --category-id input for file list.
Examples
kscli file delete
Permanently delete a file from the data center.
| Parameter | Type | Required | Description |
|---|---|---|---|
--file-id <id> | string | Yes | Data center file ID |
--yes | switch | No | Skip the confirmation prompt |
quiet mode prints nothing. json mode returns the full result.
How it differs from doc delete:
| Command | Scope | Source file |
|---|---|---|
kscli doc delete | Removes a document from one Knowledge Base index | Kept |
kscli file delete | Deletes the data center source file | Deleted, affecting every Knowledge Base referencing it |