productivity
Bitrise Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Bitrise KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.bitrise.*.
Use lua_read_doc("integrations.bitrise") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Bitrise workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.bitrise.list_apps({}))' --json kosmo integrations:lua --eval 'print(docs.read("bitrise"))' --json
kosmo integrations:lua --eval 'print(docs.read("bitrise.list_apps"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local bitrise = app.integrations.bitrise
local result = bitrise.list_apps({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.bitrise, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.bitrise.default.* or app.integrations.bitrise.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Bitrise, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Bitrise
Namespace: bitrise
Use the Bitrise integration to manage Bitrise CI/CD apps through API v0.1. Authentication uses a personal access token or Workspace API token passed in the Authorization header.
Common Workflows
- Use
bitrise_list_apps,bitrise_get_app,bitrise_update_app, andbitrise_delete_appto inspect and administer apps. - Use
bitrise_register_app,bitrise_register_ssh_key, andbitrise_finish_appfor the multi-step app registration flow. - Use
bitrise_get_bitrise_yml,bitrise_upload_bitrise_yml,bitrise_get_bitrise_yml_config, andbitrise_update_bitrise_yml_configto inspect or update configuration YAML. - Use
bitrise_trigger_build,bitrise_abort_build,bitrise_list_app_builds,bitrise_get_build,bitrise_get_build_log, andbitrise_list_archived_buildsfor build operations. - Use
bitrise_register_webhook,bitrise_list_outgoing_webhooks,bitrise_create_outgoing_webhook,bitrise_update_outgoing_webhook, andbitrise_delete_outgoing_webhookfor incoming and outgoing webhooks. - Use
bitrise_list_artifacts,bitrise_get_artifact,bitrise_update_artifact, andbitrise_delete_artifactfor build artifacts. - Use
bitrise_list_secrets,bitrise_get_secret_value,bitrise_put_secret, andbitrise_delete_secretfor app secrets. Bitrise only returns a secret value when it is unprotected. - Use
bitrise_list_android_keystore_files,bitrise_create_android_keystore_file, andbitrise_delete_android_keystore_filefor Android signing files. - Use
bitrise_api_get,bitrise_api_post,bitrise_api_put,bitrise_api_patch, andbitrise_api_deletefor safe relative paths not covered by first-class tools. Full URLs are rejected.
Argument Notes
Most app-scoped tools require app_slug. Build-scoped tools require app_slug and build_slug. Artifact tools also require artifact_slug; outgoing webhook tools use webhook_slug; Android keystore deletion uses file_slug; secret tools use secret_name.
Read tools accept optional filters and pagination via query. Write tools accept the Bitrise JSON body through payload.
Examples
local apps = tools.bitrise_list_apps({
query = { limit = 20 }
})
local build = tools.bitrise_trigger_build({
app_slug = "app-slug",
payload = {
hook_info = { type = "bitrise" },
build_params = {
branch = "main",
workflow_id = "primary"
}
}
})
local log = tools.bitrise_get_build_log({
app_slug = "app-slug",
build_slug = "build-slug"
})
local secret = tools.bitrise_put_secret({
app_slug = "app-slug",
secret_name = "DEPLOY_TOKEN",
payload = {
value = "dummy-token",
is_protected = true,
expand_in_step_inputs = true
}
})
Return Shapes
The integration returns decoded Bitrise JSON responses directly. Empty successful responses are normalized to:
{"success": true}
Text responses are normalized to:
{"value": "raw response text"}
Some Bitrise endpoints require owner/admin roles on the app team, and older archived build data has separate endpoints. When Bitrise returns an HTTP error, the tool returns that as an error instead of fabricating a successful response.
Raw agent markdown
# Bitrise
Namespace: `bitrise`
Use the Bitrise integration to manage Bitrise CI/CD apps through API v0.1. Authentication uses a personal access token or Workspace API token passed in the `Authorization` header.
## Common Workflows
- Use `bitrise_list_apps`, `bitrise_get_app`, `bitrise_update_app`, and `bitrise_delete_app` to inspect and administer apps.
- Use `bitrise_register_app`, `bitrise_register_ssh_key`, and `bitrise_finish_app` for the multi-step app registration flow.
- Use `bitrise_get_bitrise_yml`, `bitrise_upload_bitrise_yml`, `bitrise_get_bitrise_yml_config`, and `bitrise_update_bitrise_yml_config` to inspect or update configuration YAML.
- Use `bitrise_trigger_build`, `bitrise_abort_build`, `bitrise_list_app_builds`, `bitrise_get_build`, `bitrise_get_build_log`, and `bitrise_list_archived_builds` for build operations.
- Use `bitrise_register_webhook`, `bitrise_list_outgoing_webhooks`, `bitrise_create_outgoing_webhook`, `bitrise_update_outgoing_webhook`, and `bitrise_delete_outgoing_webhook` for incoming and outgoing webhooks.
- Use `bitrise_list_artifacts`, `bitrise_get_artifact`, `bitrise_update_artifact`, and `bitrise_delete_artifact` for build artifacts.
- Use `bitrise_list_secrets`, `bitrise_get_secret_value`, `bitrise_put_secret`, and `bitrise_delete_secret` for app secrets. Bitrise only returns a secret value when it is unprotected.
- Use `bitrise_list_android_keystore_files`, `bitrise_create_android_keystore_file`, and `bitrise_delete_android_keystore_file` for Android signing files.
- Use `bitrise_api_get`, `bitrise_api_post`, `bitrise_api_put`, `bitrise_api_patch`, and `bitrise_api_delete` for safe relative paths not covered by first-class tools. Full URLs are rejected.
## Argument Notes
Most app-scoped tools require `app_slug`. Build-scoped tools require `app_slug` and `build_slug`. Artifact tools also require `artifact_slug`; outgoing webhook tools use `webhook_slug`; Android keystore deletion uses `file_slug`; secret tools use `secret_name`.
Read tools accept optional filters and pagination via `query`. Write tools accept the Bitrise JSON body through `payload`.
## Examples
```lua
local apps = tools.bitrise_list_apps({
query = { limit = 20 }
})
local build = tools.bitrise_trigger_build({
app_slug = "app-slug",
payload = {
hook_info = { type = "bitrise" },
build_params = {
branch = "main",
workflow_id = "primary"
}
}
})
local log = tools.bitrise_get_build_log({
app_slug = "app-slug",
build_slug = "build-slug"
})
local secret = tools.bitrise_put_secret({
app_slug = "app-slug",
secret_name = "DEPLOY_TOKEN",
payload = {
value = "dummy-token",
is_protected = true,
expand_in_step_inputs = true
}
})
```
## Return Shapes
The integration returns decoded Bitrise JSON responses directly. Empty successful responses are normalized to:
```json
{"success": true}
```
Text responses are normalized to:
```json
{"value": "raw response text"}
```
Some Bitrise endpoints require owner/admin roles on the app team, and older archived build data has separate endpoints. When Bitrise returns an HTTP error, the tool returns that as an error instead of fabricating a successful response. local result = app.integrations.bitrise.list_apps({})
print(result) Functions
list_apps Read
List accessible Bitrise apps.
- Lua path
app.integrations.bitrise.list_apps- Full name
bitrise.bitrise_list_apps
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
register_app Write
Register a new Bitrise app.
- Lua path
app.integrations.bitrise.register_app- Full name
bitrise.bitrise_register_app
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_app Read
Get one Bitrise app.
- Lua path
app.integrations.bitrise.get_app- Full name
bitrise.bitrise_get_app
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_app Write
Update app settings.
- Lua path
app.integrations.bitrise.update_app- Full name
bitrise.bitrise_update_app
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_app Write
Delete one Bitrise app.
- Lua path
app.integrations.bitrise.delete_app- Full name
bitrise.bitrise_delete_app
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_yml Read
Get app configuration YAML.
- Lua path
app.integrations.bitrise.get_yml- Full name
bitrise.bitrise_get_bitrise_yml
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
upload_yml Write
Upload app configuration YAML.
- Lua path
app.integrations.bitrise.upload_yml- Full name
bitrise.bitrise_upload_bitrise_yml
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_yaml_config Read
Get bitrise.yml storage configuration.
- Lua path
app.integrations.bitrise.get_yaml_config- Full name
bitrise.bitrise_get_bitrise_yml_config
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_yaml_config Write
Update bitrise.yml storage configuration.
- Lua path
app.integrations.bitrise.update_yaml_config- Full name
bitrise.bitrise_update_bitrise_yml_config
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_branches Read
List repository branches for an app.
- Lua path
app.integrations.bitrise.list_branches- Full name
bitrise.bitrise_list_branches
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
register_ssh_key Write
Register app SSH key data.
- Lua path
app.integrations.bitrise.register_ssh_key- Full name
bitrise.bitrise_register_ssh_key
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
finish_app Write
Finish app registration.
- Lua path
app.integrations.bitrise.finish_app- Full name
bitrise.bitrise_finish_app
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_workspace_apps Read
List apps for a Workspace.
- Lua path
app.integrations.bitrise.list_workspace_apps- Full name
bitrise.bitrise_list_organization_apps
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_user_apps Read
List apps for a user.
- Lua path
app.integrations.bitrise.list_user_apps- Full name
bitrise.bitrise_list_user_apps
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_role_groups Read
List groups assigned to an app role.
- Lua path
app.integrations.bitrise.get_role_groups- Full name
bitrise.bitrise_get_role_groups
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
set_role_groups Write
Replace groups assigned to an app role.
- Lua path
app.integrations.bitrise.set_role_groups- Full name
bitrise.bitrise_set_role_groups
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_email_notifications Write
Update app email notification settings.
- Lua path
app.integrations.bitrise.update_email_notifications- Full name
bitrise.bitrise_update_email_notifications
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
migrate_user_app_machines Write
Migrate user-owned app machine types.
- Lua path
app.integrations.bitrise.migrate_user_app_machines- Full name
bitrise.bitrise_migrate_user_app_machine_types
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
migrate_workspace_app_machines Write
Migrate Workspace-owned app machine types.
- Lua path
app.integrations.bitrise.migrate_workspace_app_machines- Full name
bitrise.bitrise_migrate_organization_app_machine_types
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
trigger_build Write
Trigger a new app build.
- Lua path
app.integrations.bitrise.trigger_build- Full name
bitrise.bitrise_trigger_build
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
abort_build Write
Abort a running app build.
- Lua path
app.integrations.bitrise.abort_build- Full name
bitrise.bitrise_abort_build
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_app_builds Read
List recent app builds.
- Lua path
app.integrations.bitrise.list_app_builds- Full name
bitrise.bitrise_list_app_builds
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_archived_builds Read
List archived app builds.
- Lua path
app.integrations.bitrise.list_archived_builds- Full name
bitrise.bitrise_list_archived_builds
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_build_workflows Read
List workflows triggered for an app.
- Lua path
app.integrations.bitrise.list_build_workflows- Full name
bitrise.bitrise_list_build_workflows
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_build Read
Get one app build.
- Lua path
app.integrations.bitrise.get_build- Full name
bitrise.bitrise_get_build
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_build_yaml Read
Get bitrise.yml used by one build.
- Lua path
app.integrations.bitrise.get_build_yaml- Full name
bitrise.bitrise_get_build_bitrise_yml
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_build_log Read
Get one build log.
- Lua path
app.integrations.bitrise.get_build_log- Full name
bitrise.bitrise_get_build_log
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_builds Read
List builds accessible to the account.
- Lua path
app.integrations.bitrise.list_builds- Full name
bitrise.bitrise_list_builds
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
register_webhook Write
Register an incoming app webhook.
- Lua path
app.integrations.bitrise.register_webhook- Full name
bitrise.bitrise_register_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_outgoing_webhooks Read
List outgoing app webhooks.
- Lua path
app.integrations.bitrise.list_outgoing_webhooks- Full name
bitrise.bitrise_list_outgoing_webhooks
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_outgoing_webhook Write
Create an outgoing app webhook.
- Lua path
app.integrations.bitrise.create_outgoing_webhook- Full name
bitrise.bitrise_create_outgoing_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_outgoing_webhook Write
Update an outgoing app webhook.
- Lua path
app.integrations.bitrise.update_outgoing_webhook- Full name
bitrise.bitrise_update_outgoing_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_outgoing_webhook Write
Delete an outgoing app webhook.
- Lua path
app.integrations.bitrise.delete_outgoing_webhook- Full name
bitrise.bitrise_delete_outgoing_webhook
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_artifacts Read
List build artifacts.
- Lua path
app.integrations.bitrise.list_artifacts- Full name
bitrise.bitrise_list_artifacts
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_artifact Read
Get one build artifact.
- Lua path
app.integrations.bitrise.get_artifact- Full name
bitrise.bitrise_get_artifact
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_artifact Write
Update one build artifact.
- Lua path
app.integrations.bitrise.update_artifact- Full name
bitrise.bitrise_update_artifact
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_artifact Write
Delete one build artifact.
- Lua path
app.integrations.bitrise.delete_artifact- Full name
bitrise.bitrise_delete_artifact
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_secrets Read
List app secrets.
- Lua path
app.integrations.bitrise.list_secrets- Full name
bitrise.bitrise_list_secrets
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_secret_value Read
Get an unprotected secret value.
- Lua path
app.integrations.bitrise.get_secret_value- Full name
bitrise.bitrise_get_secret_value
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
put_secret Write
Create or update an app secret.
- Lua path
app.integrations.bitrise.put_secret- Full name
bitrise.bitrise_put_secret
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_secret Write
Delete an app secret.
- Lua path
app.integrations.bitrise.delete_secret- Full name
bitrise.bitrise_delete_secret
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_android_keystores Read
List Android keystore files.
- Lua path
app.integrations.bitrise.list_android_keystores- Full name
bitrise.bitrise_list_android_keystore_files
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_android_keystore Write
Create an Android keystore upload record.
- Lua path
app.integrations.bitrise.create_android_keystore- Full name
bitrise.bitrise_create_android_keystore_file
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_android_keystore Write
Delete an Android keystore file.
- Lua path
app.integrations.bitrise.delete_android_keystore- Full name
bitrise.bitrise_delete_android_keystore_file
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_get Read
Call a safe relative Bitrise GET path.
- Lua path
app.integrations.bitrise.api_get- Full name
bitrise.bitrise_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_post Write
Call a safe relative Bitrise POST path.
- Lua path
app.integrations.bitrise.api_post- Full name
bitrise.bitrise_api_post
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_put Write
Call a safe relative Bitrise PUT path.
- Lua path
app.integrations.bitrise.api_put- Full name
bitrise.bitrise_api_put
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_patch Write
Call a safe relative Bitrise PATCH path.
- Lua path
app.integrations.bitrise.api_patch- Full name
bitrise.bitrise_api_patch
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_delete Write
Call a safe relative Bitrise DELETE path.
- Lua path
app.integrations.bitrise.api_delete- Full name
bitrise.bitrise_api_delete
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||