Skip to main content

Snap your setup into place by automating your iTerm layouts and workflows

Project description

Termis

Snap your setup into place

Define your iTerm layouts and commands using YAML, then launch everything with a single command — your workspace, ready to go

Features

  • Multiple Layout Support - Create complex window layouts with multiple panes and tabs
  • Environment Variable Support - Use environment variables in your configurations with !ENV tag
  • Global Profiles - Save and reuse configurations as global profiles
  • Interactive Setup Wizard - Use the wizard mode to create configurations interactively
  • Flexible Pane Management - Support for complex layouts with advanced position notation (column/row/column_in_row)
  • Command Execution - Run multiple commands in each pane with optional delays between commands
  • Working Directory - Set root directory for each tab or individual panes
  • Tool Integration - Built-in support for:
    • VS Code - Integration with Visual Studio Code
    • Docker - Docker container management
    • Git - Source control operations
  • Dry Run Mode - Preview configuration changes without applying them
  • iTerm Profile Support - Use different iTerm profiles for different windows/panes
  • Command Delays - Configure delays between command executions to handle timing dependencies
  • Global Profile Management - List, save, and manage global configuration profiles

Requirements

  • iTerm2 Version 3.3 or later
  • Python 3.5 or later

Installation

Make sure that you are running Python 3.5 or later

pip install termis

Enable Python API usage in iTerm settings.

termis --version

Example

The layout, number of panes, tabs, titles and commands is configurable and is detailed below.

Usage

Open iTerm and simply run the below command

termis -c config.yml

If you don't provide -c flag, termis will look for termis.yml file in the current directory and use that.

Here is the list of options available:

termis [-c,--config <config-file>]  # Path to the configuration file
        [-h,--help]                  # Shows the help screen
        [-v,--version]               # Shows the installed termis version
        [-n,--new]                   # Runs termis in a new window
        [-p,--profile <name>]        # Use a profile from ~/.termis/profiles
        [-w,--wizard]                # Run interactive configuration wizard
        [-d,--dry-run]               # Show what would happen without executing
        [-l,--log-level <level>]     # Set logging level (debug, info, warning, error)
        [-s,--save-global <name>]    # Save current configuration to global profiles
        [-g,--global-list]           # List all available global profiles
        [-t,--tools-check]           # Check availability of development tools

Configuration

Configuration file to set up the sessions has the format below

profile: "Default"
metadata:
  name: "Development Environment with Advanced Layout"
  description: "Demonstrates the extended pane positioning feature"
  author: "Your Name"
  version: "1.0.0"
tabs:
  development:
    title: "Dev Environment"
    root: "~/Documents/my_project"
    panes:
      - position: "1/1/1"
        title: "Editor"
        focus: true
        badge:
          text: "📝 EDITOR"
          theme: "primary"
        commands:
          - !ENV "db authenticate ${DB_PASSWORD}"
          - "echo 'EDITOR'"
        focus: true
        prompt: "populated command"
  db:
    title: "Database"
    badge: "DB"
    panes:
      - position: "1/1/1"
      - position: "1/2/1"
      - position: "2/1/1"

Details for each of the configuration objects above is given below

Key Description
version Refers to the termis configuration version. Should always be 1.
profile Name of the profile you would like to use for all panes. If using -n argument to launch a new window, then window specific profile settings will be applied
tabs Windows or tabs in the iTerm window.
development Replace with the unique project id e.g. development-pid
root Root path for all panes within a tab
title Title to be shown in the title bar of the current tab
badge Set the Badge Text of the pane or provide text and theme keys to customize color scheme
position Position of the pane in the window. Supports two formats: column/row or column/row/column_in_row for more complex layouts. More details in the Layouts section.
focus Pane to be in focus when termis is finished. focus: true. There should only be one focus flag per Tab. If multiple are found, it will focus on the last pane evaluated.
commands List of commands to execute in the current pane.
prompt A command which will remain populated in the prompt after all commands have finished executing. The prompt command itself is not executed automatically.
command_delay Delay in seconds between executing commands in a pane. Useful when commands need to wait for previous operations to complete.
working_directory local path for current pane within a tab
tools Configure tool integrations for the pane. Supports 'vscode', 'docker', and 'git' integrations.

Layouts

The parameter position in each pane decides where each of the window panes will be displayed. The position value has the format below

x / y / z  both x and y are required parameters

x: refers to the column in the window
y: refers to the row of the given column x
z: refers to the column in given row column x+y (used for complex layout structure)

Here are some of the examples for different pane layouts

Single Pane Window

For single pane, since there is one column and one row, the position for pane would be 1/1/1

.------------------.
| 1/1              |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
'------------------'

Here is how the configuration would look like

version: "1.0"
tabs:
  some-project:
    title: "Demo Project"
    panes:
      - title: "Demo Pane"
        position: "1/1/1"
        commands:
          - "yarn dev"

Complex Pane Layout

.------------------.------------------.------------------.
| 1/1/1            | 2/1/1            | 3/1/1            |
|                  |                  |                  |
|                  |                  |                  |
|                  |                  |                  |
|                  |                  |------------------|
|--------.---------|                  | 3/2/1            |
|1/2/1   | 1/2/2   |                  |                  |
|        |         |                  |                  |
|        |         |                  |------------------|
|        |         |                  | 3/3/1            |
|        |         |                  |                  |
|        |         |                  |                  |
'--------'---------'------------------'------------------'

Configuration for that would be

tabs:
  complex:
    title: "Complex Layout"
    panes:
      - position: "1/1/1"
      - position: "1/2/1"
      - position: "1/2/2"

      - position: "2/1/1"

      - position: "3/1/1"
      - position: "3/2/1"
      - position: "3/3/1"

Tool Integrations

Termis supports various tool integrations that can be configured per pane:

panes:
  - position: "1/1"
    tools:
      vscode:
        files: ["file1", "file2"]
      docker:
        # Docker specific configurations
      git:
        # Git specific configurations

You can check available tools using:

termis --tools-check

🙏 Acknowledgements

Special thanks to kamranahmedse/itomate for the original inspiration. This project is heavily inspired by itomate and builds upon it with additional features tailored to my daily development workflows.

Contributions

Feel free to submit pull requests, create issues, spread the word.

License

MIT © Smith Gajjar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termis-0.5.3.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termis-0.5.3-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file termis-0.5.3.tar.gz.

File metadata

  • Download URL: termis-0.5.3.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for termis-0.5.3.tar.gz
Algorithm Hash digest
SHA256 9efe68b476cbd47233774d63cf3c1e08de6be28e6ecbf314937b1a61a2ba8bf2
MD5 cd7b82cf16150ea74a27ce60bb39a509
BLAKE2b-256 908eb1f6f23a268a447e8b2fe8e779aa130e41ce0d65d00452f5abac280a065c

See more details on using hashes here.

File details

Details for the file termis-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: termis-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for termis-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 39825a75fefc3c7c13de42984343ed8366005da37149b311022d8e98fc0c991c
MD5 5a3260ba29b8b6990bff2b7f3af9f5ef
BLAKE2b-256 c60ed766ee70356cc55a9918014dee2eac949a8e5b5efd85e3a03f587c38e7fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page