Automate opening of new tabs and windows in terminal programs
Project description
automate-terminal
Automate opening of new tabs and windows in terminal programs. Currently supports iTerm2, Terminal.app, and Ghostty on macOS, with additional terminals and OSes added by request.
automate-terminal is a best-effort project. Some terminals do not support automation at all!
Installation
pip install automate-terminal
mise install pip:automate-terminal
Or install from source:
git clone https://github.com/yourusername/automate-terminal.git
cd automate-terminal
pip install -e .
Supported Terminals
| Terminal | New Tabs/Windows | Switch by ID | Switch by Working Dir | List Sessions | Paste Commands |
|---|---|---|---|---|---|
| iTerm2 | ✅ | ✅ | ✅ | ✅ | ✅ |
| Terminal.app | ✅ | ❌ | ✅ | ✅ | ✅ |
| Ghostty | ✅ | ❌ | ❌ | ❌ | ✅ |
Other terminals are not supported; automate-terminal will exit with an error code in other terminals.
Quick Start
# Check if your terminal is supported
automate-terminal check
# Create a new tab
automate-terminal new-tab /path/to/project
# Switch to existing session by directory
automate-terminal switch-to --working-directory=/path/to/project
# Create new window with initialization script
automate-terminal new-window /path/to/project \
--paste-and-run="source .env && npm run dev"
Commands
check
Detect terminal capabilities.
automate-terminal check
automate-terminal check --output=json
switch-to
Switch to existing session. Errors if not found.
# By working directory (or use --wd alias)
automate-terminal switch-to --working-directory=/path/to/dir
# By session ID (or use --id alias)
automate-terminal switch-to --session-id=w0t0p2:ABC123
# Both (session ID takes precedence)
automate-terminal switch-to \
--session-id=w0t0p2:ABC123 \
--working-directory=/path/to/dir
# Match sessions in subdirectories
automate-terminal switch-to --working-directory=/path/to/dir --subdirectory-ok
new-tab
Create new tab.
automate-terminal new-tab /path/to/dir
new-window
Create new window.
automate-terminal new-window /path/to/dir
list-sessions
List all sessions.
automate-terminal list-sessions
automate-terminal list-sessions --output=json
Options
Output Format
--output=text- Human-readable (default)--output=json- JSON for programmatic use--output=none- Silent
Paste and Run
Execute commands after creating/switching sessions.
--paste-and-run="echo 'I run unconditionally'"
--paste-and-run-bash="echo 'I only run if the current shell is bash'"
--paste-and-run-zsh="echo 'I only run if the current shell is zsh'"
--paste-and-run-fish="echo 'I only run if the current shell is fish'"
Shell-specific flags override generic --paste-and-run when detected shell matches.
Debug and Dry Run
--debug # Enable debug logging to stderr
--dry-run # Log actions instead of executing them
Use --dry-run to see what AppleScript commands would be executed without actually running them. Useful for debugging and understanding what the tool will do.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file automate_terminal-0.1.0.tar.gz.
File metadata
- Download URL: automate_terminal-0.1.0.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1347ea7dbf91441c332842404c0d1fd66d31bc001ccc30661ec26fc843f8459f
|
|
| MD5 |
aad7a3c38f59e0bd1d49ba5a969fc600
|
|
| BLAKE2b-256 |
4351650f7bf9c01b5658639f94cfcbac9693e82d452b860fa3282651c16eec73
|
Provenance
The following attestation bundles were made for automate_terminal-0.1.0.tar.gz:
Publisher:
pypi.yml on irskep/automate-terminal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
automate_terminal-0.1.0.tar.gz -
Subject digest:
1347ea7dbf91441c332842404c0d1fd66d31bc001ccc30661ec26fc843f8459f - Sigstore transparency entry: 685455496
- Sigstore integration time:
-
Permalink:
irskep/automate-terminal@68b019b149cbd8f88b01d8e2cc5faf047fe14081 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/irskep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@68b019b149cbd8f88b01d8e2cc5faf047fe14081 -
Trigger Event:
push
-
Statement type:
File details
Details for the file automate_terminal-0.1.0-py3-none-any.whl.
File metadata
- Download URL: automate_terminal-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d97cec4676f3fec4d99eabb4bb7c4c01d20ae5c4c8a97d12c7d44b1e3778f431
|
|
| MD5 |
9f3293cb4581924bee8690b02d374127
|
|
| BLAKE2b-256 |
7b8cfe197b4bf535828d0c74911d4245b4f4558d4f63f0fc0fec57a37b0cb8ed
|
Provenance
The following attestation bundles were made for automate_terminal-0.1.0-py3-none-any.whl:
Publisher:
pypi.yml on irskep/automate-terminal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
automate_terminal-0.1.0-py3-none-any.whl -
Subject digest:
d97cec4676f3fec4d99eabb4bb7c4c01d20ae5c4c8a97d12c7d44b1e3778f431 - Sigstore transparency entry: 685455500
- Sigstore integration time:
-
Permalink:
irskep/automate-terminal@68b019b149cbd8f88b01d8e2cc5faf047fe14081 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/irskep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@68b019b149cbd8f88b01d8e2cc5faf047fe14081 -
Trigger Event:
push
-
Statement type: