Skip to main content

Shell/command execution tools with auto-detection - only exposes your active shell (zsh, bash, fish, dash, ksh, tcsh, csh)

Project description

hanzo-tools-shell

Shell execution tools for Hanzo MCP with DAG support and Shellflow DSL.

Installation

pip install hanzo-tools-shell

Tools

dag - DAG Execution Engine

Execute commands with directed acyclic graph semantics.

# Serial execution (default)
dag(["ls", "pwd", "git status"])

# Parallel execution
dag(["npm install", "cargo build"], parallel=True)

# Mixed DAG with parallel blocks
dag([
    "mkdir -p dist",
    {"parallel": ["cp a.txt dist/", "cp b.txt dist/"]},
    "zip -r out.zip dist/"
])

# Tool invocations
dag([{"tool": "search", "input": {"pattern": "TODO"}}])

# Named nodes with dependencies
dag([
    {"id": "build", "run": "make build"},
    {"id": "test", "run": "make test", "after": ["build"]},
])

zsh - Primary Shell with Shellflow DSL

Execute shell commands with optional Shellflow syntax.

# Simple command
zsh("ls -la")

# Shellflow DSL syntax
zsh("mkdir dist ; { cp a dist/ & cp b dist/ } ; zip out")

# With shell parameter
zsh("echo $BASH_VERSION", shell="bash")

Shellflow Syntax:

  • A ; B - Sequential execution
  • { A & B } - Parallel execution
  • A ; { B & C } ; D - Mixed DAG

ps - Process Management

Monitor and control background processes.

ps()                     # List all processes
ps(id="abc123")          # Get specific process
ps(kill="abc123")        # Kill process (SIGTERM)
ps(logs="abc123", n=50)  # Last 50 lines of output

Additional Tools

  • shell - Smart shell (zsh > bash fallback)
  • bash - Explicit bash execution
  • npx - Node package execution with auto-backgrounding
  • uvx - Python package execution with auto-backgrounding
  • open - Open files/URLs in system apps
  • curl - HTTP client without shell escaping issues
  • jq - JSON processor
  • wget - File/site downloads

Auto-Backgrounding

Commands that exceed the timeout (default 60s) are automatically backgrounded:

dag(["long-running-command"], timeout=30)
# If command exceeds 30s, it continues in background
# Use ps --logs <id> to view output

Performance

Shellflow DSL is optimized for high throughput:

  • Simple commands: ~7M ops/sec
  • Sequential: ~2.2M ops/sec
  • Mixed DAG: ~100k ops/sec

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

hanzo_tools_shell-0.6.3.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

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

hanzo_tools_shell-0.6.3-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file hanzo_tools_shell-0.6.3.tar.gz.

File metadata

  • Download URL: hanzo_tools_shell-0.6.3.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hanzo_tools_shell-0.6.3.tar.gz
Algorithm Hash digest
SHA256 dbba4ed7cb4da779d7aa29371ba7c7d0819d275b18a7c000e507ca071c62381c
MD5 eb7948b5455e77926d7319eae43e9d08
BLAKE2b-256 e13d2f3a9971ff40ae1b5c00a0b6976d50d18598f82d0d97a203a177b9edbc36

See more details on using hashes here.

File details

Details for the file hanzo_tools_shell-0.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hanzo_tools_shell-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cfe91196e9c67a62b257ef07a22ad0bb729a11d25f9d86bfdc9d4dcfb3ab0a0e
MD5 615f0f17b2738dfc1a741bf38d7c9238
BLAKE2b-256 70041d2aee79c64fbaa3211ba86a9ea513c9226c1175d97e77266c4b46ddd6ef

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