Metadata-Version: 2.4
Name: subagent-cli
Version: 0.1.2
Summary: Protocol-agnostic worker orchestration CLI
Author: niitsuma-t
License: MIT License
        
        Copyright (c) 2026 niitsuma-t
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: acp,agent,automation,cli,orchestration
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: typer>=0.24.1
Description-Content-Type: text/markdown

# subagent-cli

`subagent-cli` is a protocol-agnostic CLI for orchestrating worker agents from a parent controller.
In practice, it is a control-plane CLI that a manager agent (for example Codex or Claude Code) can use to launch and coordinate other worker agents.
The CLI surface is protocol-agnostic, while the current runtime implementation is ACP-based (`acp-stdio`).

## Status
- Alpha (`v0.1.x`)
- Local single-host focused
- Python 3.11+

## Features
- Worker lifecycle: start, list, show, inspect, stop
- Turn operations: send, watch, wait, approve, cancel
- Handoff workflow: `worker handoff` and `worker continue`
- Strict approval flow with structured events
- ACP runtime integration (`acp-stdio`) with runtime restart + session resume (`session/load`)

## Install
- From PyPI:
`pip install subagent-cli`
- From local artifacts:
`pip install dist/subagent_cli-*.whl`

## Quick Start
1. Prepare config:
`mkdir -p ~/.config/subagent && cp config.example.yaml ~/.config/subagent/config.yaml`
2. Initialize a controller in your workspace:
`subagent controller init --cwd .`
3. Start a worker:
`subagent worker start --cwd .`
4. Send an instruction:
`subagent send --worker <worker-id> --text "Investigate failing tests"`
5. Watch events:
`subagent watch --worker <worker-id> --ndjson`

For local simulation/testing without a real ACP launcher:
`subagent worker start --cwd . --debug-mode`

## Troubleshooting
- Ensure the runtime has the permissions required by your launcher. Some launchers need outbound network access.
- Preflight launcher availability:
`subagent launcher probe <launcher-name> --json`
- If `worker start` fails with `BACKEND_UNAVAILABLE`, inspect runtime logs under:
`~/.local/share/subagent/runtimes/` (or `$SUBAGENT_STATE_DIR/runtimes/` when overridden)
- For local cut-down testing without backend connectivity, use:
`subagent worker start --cwd . --debug-mode`

## Configuration
- Default config path: `~/.config/subagent/config.yaml`
- Override config path: `SUBAGENT_CONFIG=/path/to/config.yaml`
- Example config: [config.example.yaml](config.example.yaml)

## State
- Default state DB: `~/.local/share/subagent/state.db`
- Project hint file: `<workspace>/.subagent/controller.json`

## Documentation
- Architecture note: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
- Examples: [docs/examples](docs/examples)
- Contributing and release process: [CONTRIBUTING.md](CONTRIBUTING.md)

## License
MIT ([LICENSE](LICENSE))
