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 executionA ; { 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
Metadata
Release files for hanzo-tools-shell 0.6.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hanzo_tools_shell-0.6.6.tar.gz | 46.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hanzo_tools_shell-0.6.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 101.1 kB
Release files / hanzo_tools_shell-0.6.6.tar.gz
| Download URL | hanzo_tools_shell-0.6.6.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b262d88d40961ba1ee91ec4a2ead8fcfb5032fd890d0908950a9e4c7637ed41
|
|
BLAKE2b-256 checksum How to use checksums |
753981b2689d6d823ba83e86a01a7b0e7f45e6c11d733efa62be7a1baeba5246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|
Release files / hanzo_tools_shell-0.6.6-py3-none-any.whl
| Download URL | hanzo_tools_shell-0.6.6-py3-none-any.whl |
|---|---|
| Size | 54.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d8ec3dc085d7ef45147ad1bb1f5ce22910e3aefa8f4f3d37e5a02be8c2eda41
|
|
BLAKE2b-256 checksum How to use checksums |
1d2d59b3a51ddfc1c2da9db73fc890aa1b163b10b220a406408ce10dce33e93f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.9
|