KosmoKrator

productivity

Google Translate CLI for AI Agents

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

7 functions 5 read 2 write API key auth

Google Translate CLI Setup

Google Translate can be configured headlessly with `kosmokrator integrations:configure google-translate`.

# 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 google-translate --set api_key="$GOOGLE_TRANSLATE_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor google-translate --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key GOOGLE_TRANSLATE_API_KEY Secret secret yes API Key
base_url GOOGLE_TRANSLATE_BASE_URL URL url no API Base URL

Call Google Translate Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call google-translate.google_translate_translate_text '{
  "text": "example_text",
  "target": "example_target",
  "source": "example_source",
  "format": "example_format"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:google-translate google_translate_translate_text '{
  "text": "example_text",
  "target": "example_target",
  "source": "example_source",
  "format": "example_format"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs google-translate --json
kosmo integrations:docs google-translate.google_translate_translate_text --json
kosmo integrations:schema google-translate.google_translate_translate_text --json
kosmo integrations:search "Google Translate" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Google Translate.

google-translate.google_translate_translate_text

Write write

Translate text using Google Cloud Translation. Supports automatic source language detection or explicit source language specification. Returns translated text with detected source language.

Parameters
text, target, source, format

Generic CLI call

kosmo integrations:call google-translate.google_translate_translate_text '{"text":"example_text","target":"example_target","source":"example_source","format":"example_format"}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_translate_text '{"text":"example_text","target":"example_target","source":"example_source","format":"example_format"}' --json

google-translate.google_translate_detect_language

Read read

Detect the language of text using Google Cloud Translation. Returns detected language codes and confidence scores.

Parameters
text

Generic CLI call

kosmo integrations:call google-translate.google_translate_detect_language '{"text":"example_text"}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_detect_language '{"text":"example_text"}' --json

google-translate.google_translate_list_supported_languages

Read read

List languages supported by Google Cloud Translation. Returns language codes and names. Optionally specify a target language to localize language names.

Parameters
target

Generic CLI call

kosmo integrations:call google-translate.google_translate_list_supported_languages '{"target":"example_target"}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_list_supported_languages '{"target":"example_target"}' --json

google-translate.google_translate_list_glossaries

Read read

List all glossaries in your Google Cloud Translation project. Returns glossary names, language pairs, and entry counts.

Parameters
none

Generic CLI call

kosmo integrations:call google-translate.google_translate_list_glossaries '{}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_list_glossaries '{}' --json

google-translate.google_translate_get_glossary

Read read

Get details of a specific Google Cloud Translation glossary by name. Returns glossary name, language pair, entry count, and timestamps.

Parameters
name

Generic CLI call

kosmo integrations:call google-translate.google_translate_get_glossary '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_get_glossary '{"name":"example_name"}' --json

google-translate.google_translate_create_glossary

Write write

Create a new Google Cloud Translation glossary. Glossaries define custom translations for specific terms. Provide term pairs as an array of source/target strings.

Parameters
name, source_lang, target_lang, entries

Generic CLI call

kosmo integrations:call google-translate.google_translate_create_glossary '{"name":"example_name","source_lang":"example_source_lang","target_lang":"example_target_lang","entries":"example_entries"}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_create_glossary '{"name":"example_name","source_lang":"example_source_lang","target_lang":"example_target_lang","entries":"example_entries"}' --json

google-translate.google_translate_get_current_user

Read read

Verify the Google Cloud Translation API key and get connection information. Confirms the API key is valid and the service is reachable.

Parameters
none

Generic CLI call

kosmo integrations:call google-translate.google_translate_get_current_user '{}' --json

Provider shortcut

kosmo integrations:google-translate google_translate_get_current_user '{}' --json

Function Schemas

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

google-translate.google_translate_translate_text

Translate text using Google Cloud Translation. Supports automatic source language detection or explicit source language specification. Returns translated text with detected source language.

Operation
Write write
Schema command
kosmo integrations:schema google-translate.google_translate_translate_text --json
ParameterTypeRequiredDescription
text string yes The text to translate.
target string yes The target language code (e.g., "en", "de", "fr", "es", "ja", "zh").
source string no The source language code (e.g., "en", "de"). If omitted, Google auto-detects the source language.
format string no Text format: "text" (plain text, default) or "html" (HTML markup).

google-translate.google_translate_detect_language

Detect the language of text using Google Cloud Translation. Returns detected language codes and confidence scores.

Operation
Read read
Schema command
kosmo integrations:schema google-translate.google_translate_detect_language --json
ParameterTypeRequiredDescription
text string yes The text to detect the language of.

google-translate.google_translate_list_supported_languages

List languages supported by Google Cloud Translation. Returns language codes and names. Optionally specify a target language to localize language names.

Operation
Read read
Schema command
kosmo integrations:schema google-translate.google_translate_list_supported_languages --json
ParameterTypeRequiredDescription
target string no Target language code for localizing language names (e.g., "en" for English names, "fr" for French names). If omitted, only language codes are returned.

google-translate.google_translate_list_glossaries

List all glossaries in your Google Cloud Translation project. Returns glossary names, language pairs, and entry counts.

Operation
Read read
Schema command
kosmo integrations:schema google-translate.google_translate_list_glossaries --json
ParameterTypeRequiredDescription
No parameters.

google-translate.google_translate_get_glossary

Get details of a specific Google Cloud Translation glossary by name. Returns glossary name, language pair, entry count, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema google-translate.google_translate_get_glossary --json
ParameterTypeRequiredDescription
name string yes The glossary resource name (e.g., "projects/PROJECT_ID/locations/LOCATION/glossaries/GLOSSARY_ID").

google-translate.google_translate_create_glossary

Create a new Google Cloud Translation glossary. Glossaries define custom translations for specific terms. Provide term pairs as an array of source/target strings.

Operation
Write write
Schema command
kosmo integrations:schema google-translate.google_translate_create_glossary --json
ParameterTypeRequiredDescription
name string yes The glossary resource name (e.g., "projects/PROJECT_ID/locations/LOCATION/glossaries/my-glossary").
source_lang string yes The source language code (e.g., "en", "de").
target_lang string yes The target language code (e.g., "de", "fr").
entries array yes Array of term pairs, each with "source" and "target" keys. E.g., [{"source": "hello", "target": "hallo"}].

google-translate.google_translate_get_current_user

Verify the Google Cloud Translation API key and get connection information. Confirms the API key is valid and the service is reachable.

Operation
Read read
Schema command
kosmo integrations:schema google-translate.google_translate_get_current_user --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.