Skip to main content

Herdr Compose (herdr-compose)

CI Python 3.10+ License: MIT

herdr-compose is a declarative workspace layout manager for Herdr — the terminal workspace manager for AI coding agents and developers.

It allows you to define complex Herdr workspace configurations (workspaces, tabs, split directions, pane sizes, initial commands, and environment variables) in clean, human-readable YAML files (herdr-compose.yaml or herdrlayout.yaml).


🚀 Key Features

  • 📑 Declarative Workspaces & Tabs: Define multiple workspaces and tabs in human-readable YAML.
  • 💾 Save & Manage Layouts: Save your layout files into ~/.config/herdr-compose/ and list them easily with herdr-compose list.
  • 🔍 Visual Layout Inspection: Inspect the full workspace/tab/pane hierarchy tree using herdr-compose show.
  • 🪟 Explicit Split Directions & Sizes: Split panes with intuitive directions (direction: right / vertical) and percentage sizes (size: 30% or size: 0.3).
  • 🏷️ Named Pane References: Name panes (name: main_editor) and split directly from them (from: main_editor).
  • Shorthand Syntax: Concise single-line pane definitions (- nvim) and workspace-level pane lists.
  • ⚙️ Command Auto-Launch: Automatically run commands in specific panes upon creation (nvim, npm run dev, opencode).
  • 🔑 Environment Variables: Pass custom environment variables (env) per workspace, tab, or pane.
  • 🔍 Dry-Run Mode: Preview generated herdr CLI execution commands with herdr-compose apply --dry-run.

📦 Installation

You can install herdr-compose locally using uv or pip:

# Using uv (recommended)
uv pip install -e ".[dev]"

# Or standard pip
pip install -e .

# Or install globally as a tool with uv
uv tool install --editable .

🛠️ Usage & Commands

You can run herdr-compose either directly (if installed on PATH) or via uv run:

1. List Saved Configurations (list)

List all saved configuration files residing in ~/.config/herdr-compose/ along with workspace count metadata:

herdr-compose list
# or
uv run herdr-compose list

Sample terminal output:

Saved configuration files in '/home/user/.config/herdr-compose':

  1. layout.yaml (2 workspaces)
  2. backend-stack.yaml (1 workspace)

2. Inspect Layout Hierarchy Tree (show)

Display an ASCII tree visualization of the workspace, tab, and pane hierarchy without executing any terminal commands.

show supports flexible path resolution:

  • Explicit File Path: herdr-compose show path/to/my-layout.yaml
  • Saved Filename: herdr-compose show layout.yaml (automatically looks in ~/.config/herdr-compose/)
  • Default: herdr-compose show (inspects ~/.config/herdr-compose/herdr-compose.yaml)
herdr-compose show layout.yaml
# or
uv run herdr-compose show examples/complex_multi_workspace.yaml

Sample tree output:

Layout loaded from '/home/user/code/herdr-compose/examples/complex_multi_workspace.yaml':

Layout Summary:
Workspace 1: backend-api (focused) [root: ~/code/backend-api]
  ├─ Tab 1: editor
  │  ├─ Pane 1 [main_editor] [root pane] (focused) -> `nvim`
  │  ├─ Pane 2 [side_tool] [split right, size 0.3] -> `opencode`
  │  └─ Pane 3 [bottom_term] [split down, size 0.3] (from main_editor)
  └─ Tab 2: watch server
     └─ Pane 1 [root pane] -> `cargo check --watch`
Workspace 2: docs-server [root: ~/code/docs-server]
  ├─ Tab 1: editor
  │  ├─ Pane 1 [main_editor] [root pane] (focused) -> `nvim`
  │  ├─ Pane 2 [side_tool] [split right, size 0.3] -> `opencode`
  │  └─ Pane 3 [bottom_term] [split down, size 0.3] (from main_editor)
  └─ Tab 2: watch server
     └─ Pane 1 [root pane] -> `mdbook serve --open`

3. Save Configuration (save)

Validate and save any user layout file to your ~/.config/herdr-compose/ user directory:

# Saves to ~/.config/herdr-compose/layout.yaml
herdr-compose save layout.yaml

# Save and apply simultaneously
herdr-compose apply layout.yaml --save

4. Apply Layout (apply)

Create workspaces, tabs, panes, and run configured commands:

# Apply default layout (~/.config/herdr-compose/herdr-compose.yaml)
herdr-compose

# Apply specific layout file
herdr-compose apply path/to/herdr-compose.yaml

# Perform a dry-run (preview generated herdr commands without executing)
herdr-compose apply layout.yaml --dry-run

5. Validate Configuration (validate)

Check if a layout YAML file is valid:

herdr-compose validate path/to/herdr-compose.yaml

6. Initialize Starter Configuration (init)

Generate a starter herdr-compose.yaml file:

herdr-compose init

🔍 Search Priority Order

When no file path is specified, herdr-compose searches in the following order:

  1. CLI argument parameter (e.g., herdr-compose apply path/to/file.yaml)
  2. HERDR_COMPOSE_CONFIG environment variable
  3. Default candidate path: ~/.config/herdr-compose/herdr-compose.yaml

📄 Configuration Reference & Examples

Save your configuration file as herdr-compose.yaml or layout.yaml.


🧪 Testing

Run unit tests using pytest or uv:

uv run pytest

📄 License

Distributed under the MIT License. See LICENSE for details.

Release files for herdr-compose 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for herdr-compose 0.1.0
File Size Uploaded
herdr_compose-0.1.0.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for herdr-compose 0.1.0
File Interpreter ABI Platform
herdr_compose-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / herdr_compose-0.1.0.tar.gz

Download URL herdr_compose-0.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7ba163d3ae1541b3022dffc7fab59f3f0ed56284209f8805c1ccf304cc534914
BLAKE2b-256 checksum
How to use checksums
4d30696b2c33dbf500d707ff0aec506d0926b793a73a3aef9c2cde1c6cee327e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / herdr_compose-0.1.0-py3-none-any.whl

Download URL herdr_compose-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ede3c242b1344da5b615f0b7b5c0d0419fa23161b2a6a4f7d9cfb19bf00ff6c
BLAKE2b-256 checksum
How to use checksums
0a58232bdb80f387b0f21ac507134ebd54dcd6919456722a3ca759fb4350a620
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page