gemini-cli: Skill for Gemini CLI

.gemini/skills/agent-tui/SKILL.md

agent-tui is a skill for Gemini CLI from google-gemini/gemini-cli. It costs 122 tokens per session (3,187 once invoked), scanned C, original, Apache-2.0.

A testing guide for terminal user interfaces, meaning applications that run inside a command-line window and accept keyboard input. It explains how to run and reconnect to automated TUI tests for the Gemini CLI.

In plain words
What is it for?
It supports automated testing and inspection of interactive command-line applications, including starting the required daemon and controlling test sessions.
Why use it?
It prevents connection failures caused by the environment's background process setup and helps agents reconnect to the correct test session.

Skill for Gemini CLI ✓ vendor

Written for Gemini CLI: installed under .gemini/. Also seen: mentions subagents; mentions Gemini CLI.

This is google-gemini/gemini-cli's own configuration. It tells Gemini CLI how to work on gemini-cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gemini-cli configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is env GEMINI_CLI_TRUST_WORKSPACE=true GEMINI_CLI_HOME=test-gemini-home agent-tui run -d "$(pwd)" node packages/cli/dist/index.js.

About the project

Gemini CLI is a terminal-based AI agent that lets developers interact with Google Gemini models and use tools for tasks such as file operations, shell commands, web fetching, and search. Developers use it from the command line, and the catalogue add-ons extend its workflows and integrations.

google-gemini/gemini-cli · 107,525 stars · on GitHub · geminicli.com

Reuse

Borrowing it

Nothing to install: this file belongs to google-gemini/gemini-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/google-gemini/gemini-cli/main/.gemini/skills/agent-tui/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/google-gemini/gemini-cli

Made for: Gemini CLI.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-tui

README.md
[![agentmods](https://agentmods.dev/badge/skills/google-gemini/gemini-cli/agent-tui/github.svg)](https://agentmods.dev/skills/google-gemini/gemini-cli/agent-tui)
Your own site
<a href="https://agentmods.dev/skills/google-gemini/gemini-cli/agent-tui"><img src="https://agentmods.dev/badge/skills/google-gemini/gemini-cli/agent-tui/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-tui

Your own site · 80×15
<a href="https://agentmods.dev/skills/google-gemini/gemini-cli/agent-tui"><img src="https://agentmods.dev/badge/skills/google-gemini/gemini-cli/agent-tui.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,187 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 23
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 68
    Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
    Fix: Limit tool chaining depth and validate the output of each tool before passing it to the next. Require explicit user approval for multi-step chains.
  • medium Excessive Agency · line 228
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • low Supply Chain · line 68
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.03187
Opus 5.5 $0.00049 $0.01275
Sonnet 5.5 $0.00024 $0.00637
Haiku 4.5 $0.00012 $0.00319

Measured 1mo ago against content hash e5d1452e1089, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

agent-tui scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://raw.githubusercontent.com/pproenca/agent-tui/master/install.sh | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://raw.githubusercontent.com/pproenca/agent-tui/master/install.sh | sh
.gemini/skills/agent-tui/SKILL.md · 331 lines

How it starts

The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🚨 CRITICAL: macOS Daemon Workaround & Gemini CLI Usage 🚨

When using agent-tui in this macOS environment, the default background daemonization process crashes, causing Connection refused (os error 61) errors.

You MUST start the daemon manually shielded from TTY hangups before running any agent-tui commands. Using nohup is insufficient; you must use tmux to provide a fully isolated pseudo-terminal.

To support parallel runs, only restart the daemon if it is not currently running:

# Check if daemon is alive, start it in tmux if it is not
if ! agent-tui sessions >/dev/null 2>&1; then
  tmux kill-session -t agent-tui 2>/dev/null || true
  agent-tui daemon stop 2>/dev/null || true
  rm -f /tmp/agent-tui*
  tmux new-session -d -s agent-tui 'agent-tui daemon start --foreground > /tmp/agent-tui-daemon.log 2>&1'
  sleep 1
fi

Session ID vs PID (Crucial for Reconnection)

When agent-tui run returns JSON, it includes both a session_id and a pid. The pid is purely informational (the OS process ID of the child command). You do not use the pid to reconnect or issue commands. You must always use the session_id (e.g., --session <id>).

If the daemon crashes (os error 61), the pseudo-terminal is destroyed. Even if the child pid survives as an orphan, you cannot reconnect to it. You must restart the daemon using the workaround above and start a completely new session.

Testing the Gemini CLI

When testing the Gemini CLI with agent-tui, there are several strict requirements to ensure deterministic and accurate behavior:

  1. Build Before Running: agent-tui runs the built JS files, not TypeScript. You MUST run npm run build or npm run build:all after making code changes and before launching the CLI with agent-tui.
  2. Bypass Trust Modals: Always pass GEMINI_CLI_TRUST_WORKSPACE=true in the environment. If you don't, any new project-level agents or extensions will trigger a full-screen "Acknowledge and Enable" modal. This modal steals focus, swallows automation keystrokes, and causes agent-tui wait commands to time out.
  3. Isolated Environments: If you need to test without real user credentials or existing agents interfering, isolate the global settings using GEMINI_CLI_HOME=<some-test-dir>.
  4. Testing State Deltas (e.g., Reloads): If you are testing features that report deltas (e.g., /agents reload outputting "1 new local subagent"), you MUST:
    • Start the CLI first so it establishes its baseline registry.
    • Use a separate shell command (outside of agent-tui) to write the new agent .md/.toml file.
    • Use agent-tui type and press to trigger the /agents reload command inside the running session.
    • (If you add the files before starting the CLI, they become part of the baseline and won't trigger the delta logic).

Read the full file on GitHub · 331 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 331 lines · 122 tokens per session scan C e5d1452e1089

Subscribe to this mod's changes

agent-tui is a skill published in the GitHub repository google-gemini/gemini-cli (107,525 stars, last pushed today), licensed Apache-2.0. It adds 122 tokens to every session and 3,187 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.