Gemini CLI icon

Gemini CLI

Use Google Gemini CLI to execute AI-powered coding tasks with multimodal capabilities

Overview

The "Approve Plan" operation in the Gemini CLI node is designed to mark an existing execution plan as approved and ready for subsequent execution. This operation is part of a broader workflow where users generate, edit, approve, and execute AI-generated plans for coding or project tasks using the Google Gemini CLI.

Typical scenarios include:

  • After generating and reviewing an execution plan, a user approves it to signal readiness for automated execution.
  • Teams managing complex AI-assisted development workflows can use this operation to gate plan execution until approval.
  • Automating deployment or code modification steps that require explicit confirmation before running.

For example, a developer might generate a plan to refactor a Python module, review and edit the plan, then use the "Approve Plan" operation to confirm the plan before triggering its execution.

Properties

Name Meaning
Plan ID The unique identifier of the plan to approve (e.g., "plan_20240108_123456"). This is required to specify which plan to mark as approved.
Model The Gemini model to use for any underlying AI interactions (options: "Gemini 2.5 Pro" - most capable with 1M token context window, or "Gemini 2.5 Flash" - faster, efficient responses).
Max Turns Maximum number of conversation turns allowed during AI interactions (back-and-forth exchanges).
Timeout Maximum time in seconds to wait for the Gemini CLI command to complete before aborting.
Project Path Directory path where the Gemini CLI should run. If empty, defaults to the current working directory. This allows access to project files and commands within a specific folder.
Output Format How to format the output data. Options include: "Messages" (raw message array), "Plan" (execution plan structure), "Plan Status" (progress and status), "Structured" (detailed object with messages, summary, metrics), and "Text" (final result text).
Additional Options Collection of optional settings including: API Key (for Gemini API authentication if not set via environment variable), Use Vertex AI (boolean toggle), System Prompt (extra instructions/context), Debug Mode (enable debug logging).
Tools Configuration Configure built-in tools and external integrations such as enabling file system access, shell commands, web fetch/search, security mode (safe, auto-approve, sandbox), and checkpointing (save session state).
MCP Servers Configuration for external MCP servers to extend functionality, including connection type, commands, environment variables, tool inclusion/exclusion, trust level, and working directory.

Output

The output JSON structure when approving a plan includes:

  • plan: The full plan object after being marked as approved. It contains fields like:
    • id: Plan identifier.
    • title: Brief title of the plan.
    • description: Detailed description.
    • steps: Array of step objects with details.
    • status: Updated status, which will be "approved".
    • created_at and modified_at: Timestamps.
  • operation: The string "approve_plan".
  • success: Boolean indicating successful approval.

This output confirms the plan's new status and provides the updated plan details for downstream nodes or processes.

Dependencies

  • Requires the Google Gemini CLI installed and accessible in the system PATH.
  • May require an API key credential for Gemini API access, either provided explicitly or via environment variables.
  • Optional integration with Vertex AI if enabled.
  • Access to the specified project directory if projectPath is set.
  • Permissions to read/write in the .gemini/plans directory under the project path or current working directory.
  • Optional MCP server configurations for extended capabilities.

Troubleshooting

  • Gemini CLI Not Available: Error if the Gemini CLI is not installed or not found in PATH. Solution: Install the CLI globally (npm install -g @google/gemini-cli) and ensure it's accessible.
  • Plan Not Found: If the specified Plan ID does not exist in the plans directory, an error is thrown. Verify the Plan ID is correct and the plan file exists.
  • Invalid Project Path: If the projectPath is invalid, not a directory, or lacks permissions, the node throws an error. Check the path validity and permissions.
  • Timeouts: If the Gemini CLI command exceeds the specified timeout, the process is aborted with a timeout error. Increase the timeout or optimize the plan size.
  • Permission Issues: Insufficient permissions to read/write in the project or plans directory can cause failures. Ensure proper filesystem permissions.
  • Debug Mode: Enable debug mode to get detailed logs for troubleshooting.

Links and References


This summary focuses specifically on the "Approve Plan" operation of the Gemini CLI node, describing its purpose, inputs, outputs, dependencies, and common issues based on static analysis of the provided source code and property definitions.

Discussion