Gemini CLI icon

Gemini CLI

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

Overview

The "List Plans" operation of the Gemini CLI node allows users to retrieve all stored execution plans managed by the Gemini CLI environment. Execution plans are structured sets of tasks or steps that describe how to accomplish complex AI-powered coding or automation workflows.

This operation is beneficial when you want to:

  • View all available execution plans in a project directory.
  • Monitor and manage existing plans before approving, editing, or executing them.
  • Integrate plan metadata into larger workflows for decision-making or reporting.

Practical example:
A developer managing multiple AI-assisted coding projects can use this operation to list all saved plans, review their statuses, and decide which plan to execute next or modify.

Properties

Name Meaning
Model Choose between "Gemini 2.5 Pro" (most capable with 1M token context window) or "Gemini 2.5 Flash" (fast and efficient for quick responses).
Max Turns Maximum number of conversation turns allowed during interactions (back-and-forth exchanges).
Timeout Maximum time in seconds to wait for Gemini CLI completion before aborting.
Project Path Directory path where Gemini CLI runs. If empty, defaults to current working directory. This allows Gemini CLI to access files and run commands in the specified project location.
Output Format How to format the output data. Options include:
  • Messages: Raw array of all messages exchanged.
  • Plan: The full execution plan structure.
  • Plan Status: Progress and status of plan execution.
  • Structured: Object containing messages, summary, result, and metrics.
  • Text: Only the final result text. |
    | Additional Options | Collection of optional settings:
  • API Key: Gemini API key if not set via environment variable.
  • Use Vertex AI: Whether to use Vertex AI instead of Gemini API.
  • System Prompt: Extra context or instructions for Gemini CLI.
  • Debug Mode: Enable debug logging. |
    | Tools Configuration| Configure built-in tools and external integrations:
  • Enable Built-in Tools: File system, shell commands, web fetch, web search.
  • Security Mode: Safe mode (confirmations required), auto-approve (YOLO), sandbox mode.
  • Enable Checkpointing: Save conversation state. |
    | MCP Servers | Configure external MCP servers for extended functionality, including connection type (command or HTTP), environment variables, tool inclusion/exclusion, headers, timeout, trust level, and working directory. |

Output

The output for the "List Plans" operation is a JSON object containing:

  • plans: An array of plan summaries, each with:
    • id: Unique identifier of the plan.
    • title: Brief title of the plan.
    • status: Current status (e.g., draft, approved).
    • stepCount: Number of steps in the plan.
    • created_at: Timestamp of creation.
    • modified_at: Timestamp of last modification.
  • planCount: Total number of plans found.
  • operation: The operation name ("list_plans").
  • success: Boolean indicating successful retrieval.

Example snippet of output JSON structure:

{
  "plans": [
    {
      "id": "plan_20240108_123456_abcd12",
      "title": "Build CSV Parser",
      "status": "draft",
      "stepCount": 5,
      "created_at": 1700000000000,
      "modified_at": 1700000500000
    },
    {
      "id": "plan_20240109_101112_efgh34",
      "title": "Deploy Webhook Handler",
      "status": "approved",
      "stepCount": 3,
      "created_at": 1700050000000,
      "modified_at": 1700050200000
    }
  ],
  "planCount": 2,
  "operation": "list_plans",
  "success": true
}

No binary data output is involved in this operation.

Dependencies

  • Requires the Gemini CLI to be installed and accessible in the system PATH.
  • May require an API key credential for Gemini API access, either via environment variable or input property.
  • Node expects read/write permissions on the .gemini/plans directory inside the specified project path or current working directory.
  • Optional configuration of MCP servers and built-in tools may require additional setup depending on usage.

Troubleshooting

  • Gemini CLI Not Available:
    Error message: "Gemini CLI is not installed or not accessible."
    Resolution: Install Gemini CLI globally (npm install -g @google/gemini-cli) and ensure it is in the system PATH.

  • Invalid Project Path:
    Error message: "Invalid project path: ..."
    Resolution: Verify the directory exists, is accessible, and has proper read/write permissions.

  • No Plans Found:
    The output will return an empty array if no plans exist. This is normal if no plans have been generated or saved yet.

  • Permission Issues:
    Errors related to reading or writing plan files may occur if the node lacks filesystem permissions. Ensure the n8n process user has appropriate access rights.

  • Timeouts:
    If Gemini CLI operations take longer than the configured timeout, the node will abort with a timeout error. Increase the timeout property as needed.

Links and References

Discussion