iterm2-exec

Execute shell commands in iTerm2 sessions via the iTerm2 Python API.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/yangyongyongyong/skills --skill iterm2-exec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterm2-exec
Source: https://github.com/yangyongyongyong/skills/tree/main/iterm2-exec
Command: npx skills add https://github.com/yangyongyongyong/skills --skill iterm2-exec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires iterm2, and includes scripts (resource) components.

What problem does it solve?

This Skill streamlines executing shell commands within existing iTerm2 sessions, eliminating the need for manual navigation and connection setup.

Core Features & Use Cases

  • Command Execution: Run commands in any iTerm2 session without needing to establish new connections.
  • Session Integration: Supports SSH, Docker, and local sessions, providing seamless integration with your existing workflows.
  • Mode Selection: Automatically selects between Shell Integration and Sentinel modes based on session capabilities.
  • Use Case: When you are working on a project that requires accessing multiple servers and need to run commands in their respective iTerm2 sessions efficiently.

Quick Start

Use the iterm2-exec skill to execute the command 'echo OK' in the first iTerm2 tab.

Frequently Asked Questions about iterm2-exec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate shell commands in existing iTerm2 sessions?

You can automate shell commands in iTerm2 sessions by using Python scripts that interact with the iTerm2 API. This eliminates manual navigation and connection setup, allowing you to execute commands directly in active sessions.

Does this terminal automation approach support remote SSH and Docker sessions?

Yes, this terminal automation approach supports remote SSH, Docker, and local sessions. It integrates seamlessly with existing workflows, automatically selecting between Shell Integration and Sentinel modes based on session capabilities.

Do I need to install extra software to run shell commands in iTerm2 sessions via Python?

You only need the iterm2 Python library to interact with iTerm2 and run shell commands. No additional installations are required to operate terminal sessions without manual SSH connections.

What is the best way to execute commands across multiple iTerm2 tabs for different servers?

The best way to execute commands across multiple servers is using Python automation with the iTerm2 API. It allows developers and sysadmins to run commands in their respective iTerm2 sessions efficiently without manual navigation.

How does Python interact with the iTerm2 API for terminal automation?

Python interacts with the iTerm2 API by sending commands to active terminal sessions through the iterm2 library. It automatically selects the appropriate execution mode based on the session's capabilities to ensure commands run successfully.

Can I run terminal automation scripts without establishing new SSH connections?

Yes, you can run terminal automation scripts without establishing new SSH connections. The Skill operates within existing iTerm2 sessions, allowing you to execute commands directly without manual setup.