Skip to main content

Worktree-based agent workflow management toolkit

Project description

agent-tools

Worktree-based agent workflow management toolkit.

Overview

agent-tools provides a Python-based CLI for managing isolated Git worktrees for agent workflows. It replaces shell scripts with a maintainable, testable Python package that can be used locally, as a submodule, or in CI/CD pipelines.

Features

  • Isolated Worktrees: Each agent gets its own isolated Git worktree
  • Domain-based CLI: ws, cfg, env domains with clear action names
  • Backward Compatible: Legacy aliases supported (deprecated in v0.3, removed in v0.4)
  • Manual PR Creation: Push branch and create PR manually in GitHub UI
  • Cross-platform: Works on Windows, Linux, and macOS
  • Installable: Can be installed via pip or used as submodule

Quick Start

Installation

# From source
cd agt
uv pip install -e .  # or: pip install -e .

# Or as submodule
git submodule add -b main https://github.com/tnedr/agent-ops .tools
cd .tools/agt
uv pip install -e .  # or: pip install -e .

Note: This project follows UV Cache Workflow Guidelines. If using uv, ensure UV_CACHE_DIR is set (e.g., E:\uv-cache on Windows).

Usage

New domain-based commands (v0.3+):

# Start a new agent worktree
agt ws new

# Run commands in the worktree
agt ws run python my_script.py

# Commit changes
agt ws save "feat: new feature"

# Push to remote (then open PR manually)
agt ws push

# Optional: cleanup after PR is merged
agt ws clean

Legacy aliases (deprecated, will be removed in v0.4):

agt start    # → agt ws new
agt commit   # → agt ws save
agt run      # → agt ws run
agt push     # → agt ws push
agt clean    # → agt ws clean

See COMMANDS.md for complete command reference.

VS Code Integration

Generate VS Code Command Runner settings with agt commands:

agt vscode init  # Creates/updates .vscode/settings.json

This adds the following commands to VS Code/Cursor:

  • agt start: Start a new agent worktree
  • agt run: Run a command in the agent worktree (with input prompt)
  • agt commit: Commit changes (with input prompt for message)
  • agt push: Push branch to remote
  • agt merge: Merge agent branch back to base
  • agt clean: Remove agent worktree

Usage in VS Code/Cursor:

  • Press F1Command Runner: Run...
  • Select any agt * command
  • Or use in chat: > run command: agt start

Note: The agt vscode init command preserves existing commands in your .vscode/settings.json, so you can combine it with other Command Runner configurations.

Documentation

Examples

See the examples/ directory for:

  • demo_local.sh: Local workflow example
  • demo_action.yml: GitHub Actions workflow example

Development

Setup

cd agt
uv pip install -e ".[dev]"  # or: pip install -e ".[dev]"

Note: Uses UV Cache Workflow - minimal .venv, global cache.

Run Tests

uv run pytest tests/ -v  # or: pytest tests/ -v

Run Linter

uv run ruff check .  # or: ruff check .

Project Structure

agt/
├── __init__.py          # Package metadata
├── __main__.py          # Allows `python -m agt`
├── worktree.py          # Low-level Git worktree operations
├── cli.py               # CLI entrypoint and command handlers
└── pyproject.toml        # Package configuration

bin/
└── agt                  # Standalone entrypoint script

docs/                    # Documentation
tests/                   # Test suite
examples/                # Usage examples
.github/                 # CI/CD workflows and actions

License

MIT

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

agent_tools_drnt-0.4.3.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

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

agent_tools_drnt-0.4.3-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_tools_drnt-0.4.3.tar.gz.

File metadata

  • Download URL: agent_tools_drnt-0.4.3.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for agent_tools_drnt-0.4.3.tar.gz
Algorithm Hash digest
SHA256 61b7aa1a58362315217e160af6951e534ad17034aa10b951a17c8c2f9f92a841
MD5 9461be0454e57f0350a7ce414aef96f6
BLAKE2b-256 7056ba8581d48cd4dde4d9b5e043ed9239907fce120344eb4992f45d516ccb0c

See more details on using hashes here.

File details

Details for the file agent_tools_drnt-0.4.3-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_tools_drnt-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 287495757791154e471f67f8050910715df5b7698e46b8795025eb69daa87370
MD5 634358c835d40b7eddb61ce87208cfd6
BLAKE2b-256 ca939d3204f5339d86f5e61a0479f5b3aee971b35efa818b5f8f026e16b4df01

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