KosmoKrator

other

Box CLI for AI Agents

Use the Box CLI from KosmoKrator to call Box tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

10 functions 6 read 4 write Manual OAuth token auth

Box CLI Setup

Box can be configured headlessly with `kosmokrator integrations:configure box`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure box --set access_token="$BOX_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor box --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token BOX_ACCESS_TOKEN Secret secret yes Access Token
url BOX_URL URL url no API Base URL

Call Box Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call box.box_list_files '{
  "folder_id": "example_folder_id",
  "limit": 1,
  "offset": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:box box_list_files '{
  "folder_id": "example_folder_id",
  "limit": 1,
  "offset": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs box --json
kosmo integrations:docs box.box_list_files --json
kosmo integrations:schema box.box_list_files --json
kosmo integrations:search "Box" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Box.

box.box_list_files

Read read

List files and folders in a Box folder. Returns item names, IDs, types (file or folder), sizes, and modification dates. Use folder ID "0" for the root folder.

Parameters
folder_id, limit, offset

Generic CLI call

kosmo integrations:call box.box_list_files '{"folder_id":"example_folder_id","limit":1,"offset":1}' --json

Provider shortcut

kosmo integrations:box box_list_files '{"folder_id":"example_folder_id","limit":1,"offset":1}' --json

box.box_get_file

Read read

Get metadata for a Box file by ID. Returns the file name, size, type, created/modified dates, parent folder, and shared link info.

Parameters
file_id

Generic CLI call

kosmo integrations:call box.box_get_file '{"file_id":"example_file_id"}' --json

Provider shortcut

kosmo integrations:box box_get_file '{"file_id":"example_file_id"}' --json

box.box_upload_file

Write write

Upload a file to Box. Provide the file name, content, and optionally a parent folder ID (defaults to root). Returns the uploaded file metadata.

Parameters
file_name, content, parent_folder_id

Generic CLI call

kosmo integrations:call box.box_upload_file '{"file_name":"example_file_name","content":"example_content","parent_folder_id":"example_parent_folder_id"}' --json

Provider shortcut

kosmo integrations:box box_upload_file '{"file_name":"example_file_name","content":"example_content","parent_folder_id":"example_parent_folder_id"}' --json

box.box_download_file

Read read

Download a file from Box by its ID. Returns the raw file contents. Use this to retrieve file data for processing.

Parameters
file_id

Generic CLI call

kosmo integrations:call box.box_download_file '{"file_id":"example_file_id"}' --json

Provider shortcut

kosmo integrations:box box_download_file '{"file_id":"example_file_id"}' --json

box.box_delete_file

Write write

Delete a file from Box by its ID. This action moves the file to the trash. Use with caution — deleted files can be restored from the trash within the retention period.

Parameters
file_id

Generic CLI call

kosmo integrations:call box.box_delete_file '{"file_id":"example_file_id"}' --json

Provider shortcut

kosmo integrations:box box_delete_file '{"file_id":"example_file_id"}' --json

box.box_create_folder

Write write

Create a new folder in Box. Provide a folder name and optionally a parent folder ID (defaults to root). Returns the new folder metadata.

Parameters
name, parent_folder_id

Generic CLI call

kosmo integrations:call box.box_create_folder '{"name":"example_name","parent_folder_id":"example_parent_folder_id"}' --json

Provider shortcut

kosmo integrations:box box_create_folder '{"name":"example_name","parent_folder_id":"example_parent_folder_id"}' --json

box.box_get_folder

Read read

Get metadata for a Box folder by ID. Returns the folder name, size, created/modified dates, parent folder, and item counts. Use "0" for root.

Parameters
folder_id

Generic CLI call

kosmo integrations:call box.box_get_folder '{"folder_id":"example_folder_id"}' --json

Provider shortcut

kosmo integrations:box box_get_folder '{"folder_id":"example_folder_id"}' --json

box.box_share_file

Write write

Create a shared link for a Box file. By default creates an open link. Optionally configure access level, password protection, and expiration.

Parameters
file_id, access, password, expires_at

Generic CLI call

kosmo integrations:call box.box_share_file '{"file_id":"example_file_id","access":"example_access","password":"example_password","expires_at":"example_expires_at"}' --json

Provider shortcut

kosmo integrations:box box_share_file '{"file_id":"example_file_id","access":"example_access","password":"example_password","expires_at":"example_expires_at"}' --json

box.box_get_current_user

Read read

Get information about the currently authenticated Box user. Returns user name, email, login, and account details.

Parameters
none

Generic CLI call

kosmo integrations:call box.box_get_current_user '{}' --json

Provider shortcut

kosmo integrations:box box_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

box.box_list_files

List files and folders in a Box folder. Returns item names, IDs, types (file or folder), sizes, and modification dates. Use folder ID "0" for the root folder.

Operation
Read read
Schema command
kosmo integrations:schema box.box_list_files --json
ParameterTypeRequiredDescription
folder_id string no The folder ID to list. Use "0" for the root folder.
limit integer no Maximum number of items to return (1–1000, default: 100).
offset integer no Zero-based offset for pagination (default: 0).

box.box_get_file

Get metadata for a Box file by ID. Returns the file name, size, type, created/modified dates, parent folder, and shared link info.

Operation
Read read
Schema command
kosmo integrations:schema box.box_get_file --json
ParameterTypeRequiredDescription
file_id string yes The Box file ID.

box.box_upload_file

Upload a file to Box. Provide the file name, content, and optionally a parent folder ID (defaults to root). Returns the uploaded file metadata.

Operation
Write write
Schema command
kosmo integrations:schema box.box_upload_file --json
ParameterTypeRequiredDescription
file_name string yes The name for the file in Box, including extension (e.g., "report.pdf").
content string yes The file contents as a string.
parent_folder_id string no The parent folder ID. Use "0" for the root folder.

box.box_download_file

Download a file from Box by its ID. Returns the raw file contents. Use this to retrieve file data for processing.

Operation
Read read
Schema command
kosmo integrations:schema box.box_download_file --json
ParameterTypeRequiredDescription
file_id string yes The Box file ID to download.

box.box_delete_file

Delete a file from Box by its ID. This action moves the file to the trash. Use with caution — deleted files can be restored from the trash within the retention period.

Operation
Write write
Schema command
kosmo integrations:schema box.box_delete_file --json
ParameterTypeRequiredDescription
file_id string yes The Box file ID to delete.

box.box_create_folder

Create a new folder in Box. Provide a folder name and optionally a parent folder ID (defaults to root). Returns the new folder metadata.

Operation
Write write
Schema command
kosmo integrations:schema box.box_create_folder --json
ParameterTypeRequiredDescription
name string yes The name for the new folder.
parent_folder_id string no The parent folder ID. Use "0" for the root folder.

box.box_get_folder

Get metadata for a Box folder by ID. Returns the folder name, size, created/modified dates, parent folder, and item counts. Use "0" for root.

Operation
Read read
Schema command
kosmo integrations:schema box.box_get_folder --json
ParameterTypeRequiredDescription
folder_id string yes The Box folder ID. Use "0" for the root folder.

box.box_share_file

Create a shared link for a Box file. By default creates an open link. Optionally configure access level, password protection, and expiration.

Operation
Write write
Schema command
kosmo integrations:schema box.box_share_file --json
ParameterTypeRequiredDescription
file_id string yes The Box file ID to share.
access string no Access level: "open" (anyone with link), "company" (enterprise users), "collaborators" (invited only). Default: "open".
password string no Optional password to protect the shared link.
expires_at string no Optional expiration timestamp (ISO 8601, e.g., "2026-12-31T23:59:59Z").

box.box_get_current_user

Get information about the currently authenticated Box user. Returns user name, email, login, and account details.

Operation
Read read
Schema command
kosmo integrations:schema box.box_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.