Gemini CLI icon

Gemini CLI

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

Overview

The "Approve Plan" operation in this 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 for a software development task, you want to approve it so that it can be executed automatically.
  • In a multi-step automation pipeline where plans are created and modified by AI, this operation acts as a gatekeeper to ensure only vetted plans proceed to execution.
  • Teams managing complex projects can use this to control when plans move from draft to active status.

Practical example:

  • You have generated a plan to refactor a Python codebase. Once satisfied with the plan details, you use this operation to approve the plan, signaling the system to allow its execution in later steps.

Properties

Name Meaning
Plan ID The unique identifier of the plan to approve. Required to specify which plan should be marked as approved. Example: "plan_20240108_123456"
Model The Gemini model variant to use for any underlying AI operations (if applicable). Options:
- Gemini 2.5 Pro: Most capable model with 1M token context window
- Gemini 2.5 Flash: Fast and efficient for quick responses
Max Turns Maximum number of conversation turns allowed (not directly relevant for approve operation but part of common properties)
Timeout Maximum time in seconds to wait for completion before aborting (general property)
Project Path Directory path where Gemini CLI runs; sets working directory context for file access and commands. If empty, defaults to current working directory.
Output Format How to format the output data. Options include:
- Messages: raw array of all messages exchanged
- Plan: execution plan structure
- Plan Status: progress and status
- Structured: detailed object
- Text: final result text
Additional Options Collection of optional settings:
- API Key: Gemini API key if not set via environment variable
- Use Vertex AI: toggle to use Vertex AI instead of Gemini API
- System Prompt: extra instructions/context
- Debug Mode: enable debug logging
Tools Configuration Configure built-in tools and integrations:
- Enable Built-in Tools: filesystem, shell commands, web fetch, web search
- Security Mode: safe, auto-approve, sandbox
- Enable Checkpointing: save session state
MCP Servers Configure external MCP servers for extended functionality, including connection type, commands, environment variables, tool inclusion/exclusion, trust level, etc.

Output

When approving a plan, the node outputs a JSON object representing the updated plan with its new status set to "approved". The output includes:

  • plan: The full plan object containing:

    • id: Plan identifier
    • title: Brief title of the plan
    • description: Detailed description
    • steps: Array of step objects with their details and statuses
    • created_at and modified_at: Timestamps
    • status: Current status, which will be "approved" after this operation
    • Other metadata such as original prompt and configuration used
  • operation: The string "approve_plan" indicating the performed operation

  • success: Boolean flag indicating successful approval (true)

This structured output allows downstream nodes or workflows to verify the plan's approval status and proceed accordingly.

Dependencies

  • Requires the Google Gemini CLI installed and accessible in the system PATH.
  • May require a valid Gemini API key credential, either provided explicitly in the node parameters or set as an environment variable.
  • Optional integration with Vertex AI if enabled.
  • Access to the local filesystem at the specified project path for reading/writing plan files.
  • Node depends on standard Node.js modules like child_process, fs, and path.
  • Configurable external MCP servers for extended protocol support.

Troubleshooting

Common Issues

  • Gemini CLI Not Installed or Not Accessible
    Error: "Gemini CLI is not installed or not accessible. Install with: npm install -g @google/gemini-cli"
    Resolution: Ensure the Gemini CLI is installed globally and available in the system PATH.

  • Plan Not Found
    Error: Plan with ID <planId> not found
    Resolution: Verify the plan ID is correct and that the plan exists in the .gemini/plans directory under the project path or current working directory.

  • Invalid Project Path
    Error: "Invalid project path: ..."
    Resolution: Confirm the specified project path exists, is a directory, and has read/write permissions.

  • Permission Issues
    Errors related to file system access may occur if the node lacks permission to read/write in the project directory.

  • Timeouts
    If the Gemini CLI process takes longer than the configured timeout, the operation will abort with a timeout error. Increase the timeout parameter if necessary.

Error Messages

  • Plan must be approved before execution. Current status: ...
    Indicates trying to execute a plan that hasn't been approved yet.

  • Unknown operation: ...
    Means an unsupported operation was requested.

  • Parsing errors related to plan JSON indicate malformed or incomplete plan data.

Links and References


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

Discussion