Tencent Cloud CLI
raw JSON → 3.1.88.1 verified Sat May 09 auth: no python
Official CLI for Tencent Cloud API services. Version 3.1.88.1. Maintained actively by Tencent Cloud. Follows a monthly release cadence with service updates and bug fixes.
pip install tccli Common errors
error tccli.exceptions.TencentCloudSDKException: [TencentCloudSDKException] code: InvalidParameter.RepeatedParameter, message: SecretId cannot be empty. ↓
cause Missing or incorrect credentials configuration.
fix
Set credentials via
configure.set(SecretId='...', SecretKey='...') or export TENCENT_SECRET_ID and TENCENT_SECRET_KEY environment variables. error ModuleNotFoundError: No module named 'tccli.services' ↓
cause Old import pattern used or package not installed correctly.
fix
Install tccli with
pip install tccli and use from tccli.services import ... Warnings
breaking In v3.0+, the import path for service modules changed from `tccli.services.xxx` to `tccli.services.xxx`. Old imports like `from tccli.cvm import ...` will fail. ↓
fix Use `from tccli.services.service_name import ...`
breaking Python 3.6 support dropped in v3.1.0. Requires Python 3.7+. ↓
fix Upgrade Python to 3.7 or later
gotcha Credentials must be set via `configure.set()` before any service call. Calling API without configuration raises 'SecretId cannot be empty'. ↓
fix Always call `configure.set()` at the start of your script or use environment variables.
Imports
- tccli wrong
import tcclicorrectfrom tccli import configure
Quickstart
from tccli import configure
configure.set(SecretId=os.environ.get('TENCENT_SECRET_ID', ''), SecretKey=os.environ.get('TENCENT_SECRET_KEY', ''), region='ap-guangzhou')
from tccli.services.cvm import DescribeInstances
result = DescribeInstances()
print(result)