Quick Start
This article introduces how to use CloudBase CLI to quickly manage integration configurations.
What is an Integration
An integration is a capability provided by CloudBase that allows you to bind third-party services or custom business logic to cloud functions, enabling more flexible business scenarios.
Quick Experience
1. Install and Login to CLI
npm install -g @cloudbase/cli
tcb login
2. Query Available Integration Types (Optional)
If you don't know which integration types are available, you can query first:
# Query all available integration types
tcb integration types
# Filter by auth type code
tcb integration types --auth-type-code weixinpaydc
3. Initialize Integration Configuration (Optional)
If you want to manage integrations through configuration files, you can first initialize the integration configuration template:
# Interactively initialize integration configuration
tcb config init integration
# Specify integration type and name
tcb config init integration --type weixinpaydc --name myPayment
After initialization, a cloudbaserc.json configuration file will be generated. You can edit this file to fill in specific configuration values, and then use tcb config update integration to push to the cloud.
Tip: Managing integrations through configuration files enables version control and team collaboration. If you just want to quickly try it out, you can skip to step 4 and use commands to create integrations.
4. Create an Integration
# Create integration from configuration file (interactive confirmation for batch creation)
tcb integration create
# Only create the integration named my-integration from the configuration file
tcb integration create --name my-integration
# Skip confirmation, batch create all integrations in the configuration file
tcb integration create --yes
5. View Integration List
# View all integrations in the current environment
tcb integration list
# Output in JSON format
tcb integration list --json
6. Bind to Cloud Function
For ready-to-use cloud function template code (including WeChat Pay, Official Account OAuth, and other scenarios — with cloud function source, frontend sample, and minimal runnable demo), see Sample Projects & References and clone the official example projects before running the command below.
# Bind integration to cloud function
tcb integration bind-resource --key-id key-xxx --function my-function
7. View Integration Details
# Query by Key ID
tcb integration get --key-id key-xxx
# Query by name
tcb integration get --name my-integration
8. Update Integration
Update integration configuration through configuration file:
# Edit the integrations configuration in cloudbaserc.json
# Then execute the following command to push to the cloud
tcb config update integration key-xxx
Tip: For more configuration update methods, see Configuration File - Push Configuration.
9. Delete Integration
# Delete specified integration
tcb integration delete --key-id key-xxx
Common Commands
| Command | Description |
|---|---|
tcb integration types | Query available integration types |
tcb integration create | Create an integration |
tcb integration list | Query integration list |
tcb integration get | Query integration details |
tcb config update integration | Update integration configuration |
tcb integration bind-resource | Bind to cloud function |
tcb integration delete | Delete an integration |
Next Steps
- Create Integration - Learn detailed parameters for creating integrations
- Query Integration List - Learn how to query and filter integrations
- Bind to Cloud Function - Learn how to bind integrations to cloud functions