productivity
Phrase CLI for AI Agents
Use the Phrase CLI from KosmoKrator to call Phrase tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Phrase CLI Setup
Phrase can be configured headlessly with `kosmokrator integrations:configure phrase`.
# 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 phrase --set access_token="$PHRASE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor phrase --json
kosmokrator integrations:status --json Credentials
Authentication type: Bearer token bearer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | PHRASE_ACCESS_TOKEN | Secret secret | yes | API Token |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call phrase.phrase_list_projects '{"page":1,"per_page":1}' --json kosmo integrations:phrase phrase_list_projects '{"page":1,"per_page":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs phrase --json
kosmo integrations:docs phrase.phrase_list_projects --json
kosmo integrations:schema phrase.phrase_list_projects --json
kosmo integrations:search "Phrase" --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.
phrase.phrase_list_projects
List all Phrase projects the authenticated user has access to. Returns project IDs, names, main formats, and locale counts.
read - Parameters
- page, per_page
kosmo integrations:call phrase.phrase_list_projects '{"page":1,"per_page":1}' --json kosmo integrations:phrase phrase_list_projects '{"page":1,"per_page":1}' --json phrase.phrase_get_project
Get details of a single Phrase project including name, slug, main format, default locale, and shares.
read - Parameters
- project_id
kosmo integrations:call phrase.phrase_get_project '{"project_id":"example_project_id"}' --json kosmo integrations:phrase phrase_get_project '{"project_id":"example_project_id"}' --json phrase.phrase_list_keys
List translation keys in a Phrase project. Optionally filter by name using the query parameter, and control pagination with page and per_page. Returns key IDs, names, and creation dates.
read - Parameters
- project_id, page, per_page, q
kosmo integrations:call phrase.phrase_list_keys '{"project_id":"example_project_id","page":1,"per_page":1,"q":"example_q"}' --json kosmo integrations:phrase phrase_list_keys '{"project_id":"example_project_id","page":1,"per_page":1,"q":"example_q"}' --json phrase.phrase_get_key
Get a single translation key by ID, including its name, description, tags, and plural settings.
read - Parameters
- project_id, key_id
kosmo integrations:call phrase.phrase_get_key '{"project_id":"example_project_id","key_id":"example_key_id"}' --json kosmo integrations:phrase phrase_get_key '{"project_id":"example_project_id","key_id":"example_key_id"}' --json phrase.phrase_list_translations
List translations in a Phrase project. Optionally filter by key ID or locale ID, and control pagination with page and per_page. Returns translation content, key names, and locale codes.
read - Parameters
- project_id, page, per_page, key_id, locale_id, q
kosmo integrations:call phrase.phrase_list_translations '{"project_id":"example_project_id","page":1,"per_page":1,"key_id":"example_key_id","locale_id":"example_locale_id","q":"example_q"}' --json kosmo integrations:phrase phrase_list_translations '{"project_id":"example_project_id","page":1,"per_page":1,"key_id":"example_key_id","locale_id":"example_locale_id","q":"example_q"}' --json phrase.phrase_list_locales
List locales in a Phrase project. Returns locale IDs, codes, names, and default status.
read - Parameters
- project_id, page, per_page
kosmo integrations:call phrase.phrase_list_locales '{"project_id":"example_project_id","page":1,"per_page":1}' --json kosmo integrations:phrase phrase_list_locales '{"project_id":"example_project_id","page":1,"per_page":1}' --json phrase.phrase_get_current_user
Get the current authenticated Phrase user's profile, including username, name, email, and account details.
read - Parameters
- none
kosmo integrations:call phrase.phrase_get_current_user '{}' --json kosmo integrations:phrase phrase_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
phrase.phrase_list_projects 2 parameters
kosmo integrations:schema phrase.phrase_list_projects --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number (default 1). |
per_page | integer | no | Number of projects per page (default 25, max 100). |
phrase.phrase_get_project 1 parameters
kosmo integrations:schema phrase.phrase_get_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The ID of the project to retrieve. |
phrase.phrase_list_keys 4 parameters
kosmo integrations:schema phrase.phrase_list_keys --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID. |
page | integer | no | Page number (default 1). |
per_page | integer | no | Number of keys per page (default 25, max 100). |
q | string | no | Search query to filter keys by name. |
phrase.phrase_get_key 2 parameters
kosmo integrations:schema phrase.phrase_get_key --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID. |
key_id | string | yes | The key ID. |
phrase.phrase_list_translations 6 parameters
kosmo integrations:schema phrase.phrase_list_translations --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID. |
page | integer | no | Page number (default 1). |
per_page | integer | no | Number of translations per page (default 25, max 100). |
key_id | string | no | Filter translations by key ID. |
locale_id | string | no | Filter translations by locale ID. |
q | string | no | Search query to filter translations. |
phrase.phrase_list_locales 3 parameters
kosmo integrations:schema phrase.phrase_list_locales --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID. |
page | integer | no | Page number (default 1). |
per_page | integer | no | Number of locales per page (default 25, max 100). |
phrase.phrase_get_current_user 0 parameters
kosmo integrations:schema phrase.phrase_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.