Metadata-Version: 2.3
Name: gitdirector
Version: 1.1.0
Summary: A Python CLI tool for managing and synchronizing multiple git repositories with ease
Keywords: git,repository,manager,cli,synchronization,batch
Author: Anito Anto
Author-email: Anito Anto <49053859+anitoanto@users.noreply.github.com>
License: MIT
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.1.0
Requires-Dist: rich>=12.0
Requires-Dist: libtmux>=0.46.2
Requires-Dist: textual>=8.2.1
Requires-Dist: coolname>=3.0.0
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=4.0 ; extra == 'dev'
Requires-Dist: black>=23.0 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
Requires-Dist: mypy>=1.0 ; extra == 'dev'
Requires-Dist: build>=1.0 ; extra == 'dev'
Requires-Dist: twine>=4.0 ; extra == 'dev'
Maintainer: Anito Anto
Maintainer-email: Anito Anto <49053859+anitoanto@users.noreply.github.com>
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/anitoanto/gitdirector
Project-URL: Repository, https://github.com/anitoanto/gitdirector.git
Project-URL: Issues, https://github.com/anitoanto/gitdirector/issues
Project-URL: Documentation, https://github.com/anitoanto/gitdirector/blob/main/README.md
Provides-Extra: dev
Description-Content-Type: text/markdown

# GitDirector

An interactive TUI for managing all your git repositories from one place — launch AI coding agents, spin up tmux sessions, and run multiple agents across repos in parallel.

## Why GitDirector?

Stop context-switching between terminals. `gitdirector console` gives you a live dashboard of every repository you work on. Hit `enter`, pick a repo, and instantly drop into a tmux session with your AI agent of choice — OpenCode, Claude Code, GitHub Copilot, or Codex. Run them all at once, each in its own session, while you track sync state, branches, and changes across every repo in real time.

## Installation

```bash
pip install gitdirector
```

## Usage

| Command | Description |
| --- | --- |
| `gitdirector console` | Open the interactive TUI dashboard |
| `gitdirector link PATH [--discover]` | Link a repository or discover all under a path |
| `gitdirector unlink PATH\|NAME [--discover]` | Unlink a repository by path, name, or all under a path |
| `gitdirector list` | List all tracked repositories with live status |
| `gitdirector status` | Show dirty repositories with staged/unstaged files |
| `gitdirector pull` | Pull latest changes for all tracked repositories |
| `gitdirector cd NAME` | Open or switch to a tmux session for a repository |
| `gitdirector autoclean links\|sessions` | Clean broken links or stale tmux sessions |
| `gitdirector help` | Show help |

### link

```bash
gitdirector link /path/to/repo
gitdirector link /path/to/folder --discover   # recursively find and link all repos
```

### unlink

```bash
gitdirector unlink /path/to/repo         # unlink by full path
gitdirector unlink my-repo               # unlink by repository name
gitdirector unlink /path/to/folder --discover  # unlink all repos under a path
```

If multiple tracked repositories share the same name, `gitdirector` will refuse and list the conflicting paths so you can use the full path instead.

### list

Displays a live table of all tracked repositories with:

- Sync state: `up to date`, `ahead`, `behind`, `diverged`, or `unknown`
- Current branch
- Staged/unstaged changes
- Last commit (relative time)
- Tracked file size
- Path

Checks run concurrently (default: 10 workers).

### status

Shows repositories with uncommitted changes (staged and/or unstaged files). Prints a summary of total, clean, and changed repo counts.

### pull

Pulls all tracked repositories concurrently using fast-forward only (`git pull --ff-only`). Reports success or failure per repository.

### cd

```bash
gitdirector cd my-repo
```

Opens a [tmux](https://github.com/tmux/tmux) session rooted at the repository directory, or switches to it if a session for that repo already exists.

- **Inside tmux** — switches the current client to the target session.
- **Outside tmux** — replaces the current process with `tmux attach-session`, handing the terminal over to tmux.

> **Requires tmux to be installed on your system.**
>
> macOS: `brew install tmux`  
> Debian/Ubuntu: `sudo apt install tmux`  
> Arch: `sudo pacman -S tmux`

### console

```bash
gitdirector console
```

Opens a full interactive TUI dashboard built with [Textual](https://github.com/Textualize/textual). All repositories load concurrently with live status updates.

Features:

- Live table with sync state, branch, changes, last commit, and active tmux sessions
- `/` to filter repositories by name or path
- `s` to cycle sort by any column
- `r` to refresh all statuses
- Press `enter` on any repository to open an action menu:
  - **New tmux session** — create and attach a session for the repository
  - **Attach existing session** — switch to any already-running tmux session
  - **Launch AI agent** — open OpenCode, Claude Code, GitHub Copilot, or Codex in a new tmux session
  - **Remove session** — kill a running tmux session

## Configuration

Config is stored at `~/.gitdirector/config.yaml`.

```yaml
repositories:
  - /path/to/repo1
  - /path/to/repo2
max_workers: 10   # optional, default 10
```

## Requirements

- Python 3.9+
- Git
- [tmux](https://github.com/tmux/tmux) ≥ 3.2a (for `gitdirector cd`)

## License

MIT
