ai
Google Gemini CLI for Headless Automation
Use the Google Gemini CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write API key auth
Google Gemini CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Google Gemini CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Google Gemini CLI for Headless Automation
kosmokrator integrations:configure google-gemini --set api_key="$GOOGLE_GEMINI_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call google-gemini.gemini_list_models '{"pageSize":1,"pageToken":"example_pageToken"}' --json Discovery Before Execution
Agents and scripts can inspect Google Gemini docs and schemas before choosing a function.
kosmo integrations:docs google-gemini --json
kosmo integrations:docs google-gemini.gemini_list_models --json
kosmo integrations:schema google-gemini.gemini_list_models --json
kosmo integrations:search "Google Gemini" --json
kosmo integrations:list --json Useful Google Gemini CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
google-gemini.gemini_list_models | Read | pageSize, pageToken | List available Gemini AI models. Returns model names, display names, supported generation methods, and other metadata. |
google-gemini.gemini_get_model | Read | id | Get detailed information about a specific Gemini model, including supported generation methods, input/output token limits, and capabilities. |
google-gemini.gemini_generate_content | Write | id, contents, temperature, topP, maxOutputTokens | Generate content using a Gemini model. Send text prompts and receive AI-generated responses. Supports configurable generation parameters like temperature, topP, and maxOutputTokens. |
google-gemini.gemini_list_files | Read | pageSize, pageToken | List files uploaded to the Gemini File API. Returns file names, MIME types, sizes, and states. |
google-gemini.gemini_get_file | Read | id | Get metadata for an uploaded file in the Gemini File API, including its name, display name, MIME type, size, and processing state. |
google-gemini.gemini_list_tuned_models | Read | pageSize, pageToken | List tuned (fine-tuned) Gemini models in your project. Returns model names, base models, tuning tasks, and display names. |
google-gemini.gemini_get_current_user | Read | none | Get information about the currently authenticated Google user, including permissions and account details. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.