KosmoKrator

productivity

Codemagic CLI for AI Agents

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

Codemagic CLI Setup

Codemagic can be configured headlessly with `kosmokrator integrations:configure codemagic`.

Install, configure, and verify
# 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 codemagic --set api_token="$CODEMAGIC_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor codemagic --json
kosmokrator integrations:status --json

Credentials

Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_token CODEMAGIC_API_TOKEN Secret secret yes API Token
url CODEMAGIC_URL Text text no API URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call codemagic.codemagic_list_apps '{}' --json
Provider shortcut
kosmo integrations:codemagic codemagic_list_apps '{}' --json

Discovery

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

Discovery commands
kosmo integrations:docs codemagic --json
kosmo integrations:docs codemagic.codemagic_list_apps --json
kosmo integrations:schema codemagic.codemagic_list_apps --json
kosmo integrations:search "Codemagic" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

codemagic.codemagic_list_apps

List Codemagic applications.

Read read
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_list_apps '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_list_apps '{}' --json

codemagic.codemagic_get_app

Get one Codemagic application.

Read read
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_get_app '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_get_app '{}' --json

codemagic.codemagic_create_app

Add a repository to Codemagic.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_create_app '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_create_app '{}' --json

codemagic.codemagic_create_private_app

Add a private repository with SSH key details.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_create_private_app '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_create_private_app '{}' --json

codemagic.codemagic_start_build

Start a Codemagic build.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_start_build '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_start_build '{}' --json

codemagic.codemagic_cancel_build

Cancel a Codemagic build.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_cancel_build '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_cancel_build '{}' --json

codemagic.codemagic_get_artifact

Get an authenticated artifact URL.

Read read
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_get_artifact '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_get_artifact '{}' --json

codemagic.codemagic_create_artifact_public_url

Create a public artifact download URL.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_create_artifact_public_url '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_create_artifact_public_url '{}' --json

codemagic.codemagic_list_caches

List app caches.

Read read
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_list_caches '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_list_caches '{}' --json

codemagic.codemagic_delete_caches

Delete all app caches.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_delete_caches '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_delete_caches '{}' --json

codemagic.codemagic_delete_cache

Delete one app cache.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_delete_cache '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_delete_cache '{}' --json

codemagic.codemagic_api_get

Call a safe relative Codemagic GET path.

Read read
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_api_get '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_api_get '{}' --json

codemagic.codemagic_api_post

Call a safe relative Codemagic POST path.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_api_post '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_api_post '{}' --json

codemagic.codemagic_api_patch

Call a safe relative Codemagic PATCH path.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_api_patch '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_api_patch '{}' --json

codemagic.codemagic_api_delete

Call a safe relative Codemagic DELETE path.

Write write
Parameters
none
Generic call
kosmo integrations:call codemagic.codemagic_api_delete '{}' --json
Shortcut
kosmo integrations:codemagic codemagic_api_delete '{}' --json

Function Schemas

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

codemagic.codemagic_list_apps 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_list_apps --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_get_app 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_get_app --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_create_app 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_create_app --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_create_private_app 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_create_private_app --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_start_build 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_start_build --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_cancel_build 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_cancel_build --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_get_artifact 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_get_artifact --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_create_artifact_public_url 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_create_artifact_public_url --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_list_caches 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_list_caches --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_delete_caches 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_delete_caches --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_delete_cache 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_delete_cache --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_api_get 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_api_get --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_api_post 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_api_post --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_api_patch 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_api_patch --json
ParameterTypeRequiredDescription
No parameters.
codemagic.codemagic_api_delete 0 parameters
Schema command
kosmo integrations:schema codemagic.codemagic_api_delete --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.