Used to call BlueKing PaaS application, module, deployment, log, process, environment variable, and enhanced service related APIs via bk-cli paas .
CRITICAL — Before starting, you MUST first use the Read tool to read ../bk-cli-shared/SKILL.md. The shared skill handles authentication, context, tenant, stage, dry-run, verbose, header/body, and general request rules; this skill only supplements paas the command's own semantics and input conventions.
Current coverage
This skill currently covers the following commands:
get_minimal_app_listget_app_infolist_app_modulesget_repo_branchesget_deployments_liststreams_history_eventslist_processesmodule_env_released_infomodule_env_released_statesearch_standard_log_with_postcreate_moduleget_deployment_resultdeploy_with_modulecreate_cloud_native_applist_config_varsget_config_varset_config_var_valuelist_module_servicesbind_serviceget_service_instance_by_moduleunbind_service
Input conventions
- These APIs all require application authentication + user authentication + API resource permissions. Before calling, ensure that the credentials of the current context satisfy both the application identity and the user identity, and that the corresponding application has applied for the API permissions for these APIs.
- The application ID uses the PaaS application
app_code; some APIs use the upstream original parameter namecode。 - The module name uses the PaaS module name; when no module is specified, the default module
defaultis usually used. The related commands have set the default value ofmoduleormodule_nametodefault。 - Environment parameters use the API's original parameter names:
envorenvironment, with common values beingstagorprod. Write operations default to usingstagfirst, unless the user explicitly requestsprod。 deploy_with_module、create_module、create_cloud_native_app、set_config_var_value、bind_serviceand other complex request bodies are passed in via the shared--body '<json>'; to view the complete structure, runbk-cli paas <action> -h --body-schema。
Common workflows
- Use
get_minimal_app_listto locate the application ID. - Use
get_app_infoto confirm the application type, language, modules, and most recent deployment time. - Use
list_app_modulesto confirm the module name; when the user does not specify one, preferdefault。 - Before deploying from a code repository, use
get_repo_branchesto obtainname/type/revision, and fill it intodeploy_with_moduleof--body。 - After deployment, use
get_deployments_listto find the deployment task, then usestreams_history_eventsto view the log stream. - When you need to view the runtime state, use
module_env_released_state、list_processesorsearch_standard_log_with_post。 - When you need to manage environment variables, use
list_config_vars、get_config_var、set_config_var_value。 - When you need to manage enhanced service bindings, use
list_module_services、bind_service、get_service_instance_by_module、unbind_service。 - When you need to create a cloud-native application or module, use
create_cloud_native_apporcreate_module。
Commands
get_minimal_app_list
bk-cli paas get_minimal_app_list
bk-cli paas get_minimal_app_list --app_status normal --source_origin 1
- Get a concise list of Apps that the current user has permission for.
- Call path:
GET /bkapps/applications/lists/minimal - Commonly viewed fields:
results[].application.code、results[].application.name。
get_app_info
bk-cli paas get_app_info --app_code bk-demo
- View application information. Before write operations, call it once to confirm
app_code; before creating a module, confirm thatapplication.typeiscloud_native。 - Call path:
GET /bkapps/applications/{app_code}/ - Commonly viewed fields:
application.type、application.language、application.modules、application.last_deployed_date。
list_app_modules
bk-cli paas list_app_modules --app_code bk-demo
bk-cli paas list_app_modules --app_code bk-demo --source_origin 1
- View all modules under the application.
- Call path:
GET /bkapps/applications/{app_code}/modules/ - For multi-module applications, first confirm whether to use
defaultor another module;is_default=trueindicates the default module.
get_repo_branches
bk-cli paas get_repo_branches --app_code bk-demo
bk-cli paas get_repo_branches --app_code bk-demo --module default
- Get the code repository branch information for the application module.
- Call path:
GET /bkapps/applications/{app_code}/modules/{module}/repo/branches/ - In the response,
results[].namecorresponds to the deployment body'sversion_name,results[].typecorresponds toversion_type,results[].revisioncan be filled intorevision。 - A pure image application has no repository; when encountering repository-related errors, switch to the image deployment path and do not repeatedly retry that API.
get_deployments_list
bk-cli paas get_deployments_list --app_code bk-demo
bk-cli paas get_deployments_list --app_code bk-demo --environment prod --limit 12 --offset 0
- Get the application module deployment history; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/deployments/lists/ - Optional query:
environment、operator、limit、offset。 - In the response,
results[].idorresults[].deployment_idcan be used as thestreams_history_eventsofchannel_id。
streams_history_events
bk-cli paas streams_history_events --channel_id 22d0e9c8-9cfc-45a5-b5a8-718137c515db
bk-cli paas streams_history_events --channel_id 22d0e9c8-9cfc-45a5-b5a8-718137c515db --last_event_id 10
- Get the deployment log stream;
channel_idis usually the deployment task ID. - Call path:
GET /streams/{channel_id}/history_events - There is rate limiting, about 10 times per 60 seconds per user; do not tight loop.
list_processes
bk-cli paas list_processes --app_code bk-demo --env stag
bk-cli paas list_processes --app_code bk-demo --module default --env prod --release_id 123
- Get information about all processes and instances in the application environment.
- Call path:
GET /bkapps/applications/{app_code}/modules/{module}/envs/{env}/processes/list/ - Commonly viewed fields: replica, instance
Running/ready, restart count.
module_env_released_info
bk-cli paas module_env_released_info \
--code bk-demo \
--environment prod
- Query the environment deployment information of an application module; the default module is
default。 - Call path:
GET /bkapps/applications/{code}/modules/{module_name}/envs/{environment}/released_info/
module_env_released_state
bk-cli paas module_env_released_state \
--code bk-demo \
--environment prod
- Query the environment deployment status of an application module; compared with
module_env_released_info, it has moreis_offlined, default access entry, and other information. - Call path:
GET /bkapps/applications/{code}/modules/{module_name}/envs/{environment}/released_state/ - Commonly viewed fields:
is_offlined、exposed_link.url、default_access_entrance.url. If it has never been published, the upstream may returnAPP_NOT_RELEASED。
search_standard_log_with_post
bk-cli paas search_standard_log_with_post \
--app_code bk-demo \
--body '{"query":{"query_string":"","terms":{"environment":["stag"]}}}'
bk-cli paas search_standard_log_with_post \
--app_code bk-demo \
--module default \
--time_range customized \
--start_time '2026-08-24 10:00:00' \
--end_time '2026-08-24 11:00:00' \
--body '{"query":{"query_string":"error","terms":{"environment":["prod"],"process_id":["web"]}}}'
- Query the application standard output logs; the default module is
default, and by default it queries the most recent1h。 - Call path:
POST /bkapps/applications/{app_code}/modules/{module}/log/standard_output/list/ - Optional query:
time_range、start_time、end_time、limit、scroll_id。 - When filtering by environment and process, put them in the body's
query.terms, for exampleenvironmentorprocess_id。
create_module
bk-cli paas create_module \
--app_code bk-demo \
--body '{"name":"api","source_config":{"source_init_template":"dj2_with_auth","source_origin":2},"bkapp_spec":{"build_config":{"build_method":"buildpack"}}}'
- Create a module for a cloud-native application. Before calling, first use
get_app_infoto confirm that the application type iscloud_native。 - Call path:
POST /bkapps/applications/{app_code}/modules/ - Required fields in the request body:
name、source_config、bkapp_spec; common buildpack scenarios also require filling inbkapp_spec.build_config.build_methodwithbuildpack. For the complete structure, seebk-cli paas create_module -h --body-schema。
get_deployment_result
bk-cli paas get_deployment_result \
--app_code bk-demo \
--deployment_id 12345
- Query the deployment task result; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/deployments/{deployment_id}/result/
deploy_with_module
bk-cli paas deploy_with_module \
--app_code bk-demo \
--env prod \
--body '{"revision":"{commit_id}","version_type":"branch","version_name":"master"}'
- Trigger an App deployment that supports multiple modules; the default module is
default。 - Call path:
POST /bkapps/applications/{app_code}/modules/{module}/envs/{env}/deployments/ - Request body fields:
revisionis the source code repository version number, optional;version_nameis the branch or tag name, required;version_typeis the version type, required; svn supportstrunk/tag, git supportsbranch。
create_cloud_native_app
bk-cli paas create_cloud_native_app \
--body '{"code":"bk-demo","name":"bk-demo","source_config":{"source_origin":1,"source_repo_url":"https://github.com/octocat/helloWorld.git","source_repo_auth_info":{},"source_dir":"","source_init_template":"docker"},"bkapp_spec":{"build_config":{"build_method":"dockerfile","dockerfile_path":"Dockerfile"}}}'
- Create a cloud-native application.
- Call path:
POST /bkapps/cloud-native/ - Root fields of the request body:
code、name、source_config、bkapp_specis required;app_tenant_mode、auth_code、is_plugin_app、advanced_optionsis passed as needed. source_config.source_originindicates the source code origin; common values:1is an authorized code repository;6corresponds to the upstreamSourceOrigin.CNATIVE_IMAGE, indicating a cloud-native application that only hosts images.bkapp_spec.build_config.build_methodsupportsbuildpack、dockerfile、custom_image;dockerfilescenarios usually requiredockerfile_path,custom_imagescenarios requireimage_repositoryand usually requireprocesses。
list_config_vars
bk-cli paas list_config_vars --app_code bk-demo
bk-cli paas list_config_vars --app_code bk-demo --module default
- View the environment variable list of an application module; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/config_vars/
get_config_var
bk-cli paas get_config_var --app_code bk-demo --config_var_key FOO
bk-cli paas get_config_var --app_code bk-demo --module default --config_var_key FOO
- Query a single environment variable by key; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/config_vars/{config_var_key}/
set_config_var_value
bk-cli paas set_config_var_value \
--app_code bk-demo \
--config_var_key FOO \
--body '{"environment_name":"stag","value":"bar","description":"demo config","is_sensitive":false}'
- Create or update an environment variable by key; the default module is
default。 - Call path:
POST /bkapps/applications/{app_code}/modules/{module}/config_vars/{config_var_key}/ - Required fields in the request body:
environment_name; common values arestag、prodor_global_. When creating a new variable, also passvalue。 - For sensitive variables, set
is_sensitive=true; values in query results may be masked by the upstream.
list_module_services
bk-cli paas list_module_services --app_code bk-demo
bk-cli paas list_module_services --app_code bk-demo --module default
- View the enhanced services of an application module; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/services/ - The response is usually grouped by bound, shared, and unbound services; before binding, you can confirm from the unbound services
service_id。
bind_service
bk-cli paas bind_service \
--body '{"code":"bk-demo","service_id":"svc-uuid","module_name":"default"}'
- Bind the application module and the enhanced service.
- Call path:
POST /services/service-attachments/ - Required request body fields:
code、service_id;module_nameIf not passed, it will be handled by the upstream according to the default module; it is recommended to pass it explicitlydefault。 - Pass this when you need to specify a service plan
plan_id, and pass this when you need a per-environment planenv_plan_id_map。
get_service_instance_by_module
bk-cli paas get_service_instance_by_module \
--app_code bk-demo \
--service_id svc-uuid
- View the details of the binding relationship between the application module and the enhanced service; the default module is
default。 - Call path:
GET /bkapps/applications/{app_code}/modules/{module}/services/{service_id}/
unbind_service
bk-cli paas unbind_service \
--app_code bk-demo \
--service_id svc-uuid
- Unbind the application module and the enhanced service; the default module is
default。 - Call path:
DELETE /bkapps/applications/{app_code}/modules/{module}/services/{service_id}/ - Unbinding is a write operation; before actual execution, it is recommended to first add
--dry-runto confirm app, module, and service_id.