tab-management

Automates iTerm2 tab creation, querying, and closure via AppleScript and osascript scripts.

Updated Nov 9, 2025
One-click install
npx skills add https://github.com/manifoldlogic/claude-code-plugins --skill tab-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tab-management
Source: https://github.com/manifoldlogic/claude-code-plugins/tree/main/plugins/iterm/skills/tab-management
Command: npx skills add https://github.com/manifoldlogic/claude-code-plugins --skill tab-management

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of managing iTerm2 tabs programmatically, allowing users to automate tab creation, querying, and cleanup.

Core Features & Use Cases

  • Tab Creation: Open new tabs with specified profiles, directories, and commands.
  • Tab Query: List existing tabs and windows in table or JSON format.
  • Tab Closure: Close tabs by pattern matching on titles with options for confirmation or force.
  • Use Case: Automatically open a new tab with a specific profile and directory when starting a new worktree in Claude Code.

Quick Start

To open a new tab in a specific directory using the "Devcontainer" profile:

iterm-open-tab.sh --directory "/workspace/repos/my-project" --profile "Devcontainer"

Frequently Asked Questions about tab-management

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

FAQPage Schema
How do I automate iTerm2 tab creation with a specific profile and directory?

Automate iTerm2 tab creation by running a shell script that calls osascript to open a new tab, passing arguments for the profile name and target directory to customize the session environment.

Can I query existing iTerm2 tabs programmatically using AppleScript?

Query existing iTerm2 tabs programmatically via AppleScript to list open windows and tabs, returning the data in a structured table or JSON format for integration into development workflows.

What's the best way to close multiple iTerm2 tabs by matching their titles?

Close multiple iTerm2 tabs by running an AppleScript that pattern-matches tab titles, with options to prompt for confirmation or force-close matching tabs without user interaction.

Does tab management with AppleScript work inside Linux devcontainer environments?

Tab management automation applies to macOS host and Linux container development workflows, allowing scripts to programmatically control iTerm2 tabs across different environment contexts.

Do I need iTerm2 Shell Integration installed to manage tabs with osascript?

iTerm2 tab management via osascript requires iTerm2 with Shell Integration installed, ensuring the necessary programmatic hooks are available for tab creation, querying, and closure operations.

Why use AppleScript for iTerm2 tab management instead of manual terminal interaction?

AppleScript automates repetitive tab management tasks like opening worktree-specific sessions or cleaning up tabs by pattern, eliminating manual steps and streamlining development workflows.