Metadata-Version: 2.4
Name: screen-manager
Version: 0.1.0
Summary: Screen session manager with MCP support
Author-email: Yusuke Watanabe <yusuke.watanabe@scitex.ai>
Maintainer-email: Yusuke Watanabe <yusuke.watanabe@scitex.ai>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Yusuke Watanabe/screen-manager
Project-URL: Repository, https://github.com/Yusuke Watanabe/screen-manager
Project-URL: Documentation, https://github.com/Yusuke Watanabe/screen-manager
Keywords: debugging,ipdb,multi-agent,mcp,screen,session-management,conditional-debugging,AI-agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: System :: Shells
Classifier: Topic :: Communications
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cipdb>=0.1.0
Requires-Dist: ipdb>=0.13.0
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: pexpect>=4.8.0
Requires-Dist: typing-extensions>=4.0.0
Requires-Dist: aiofiles>=23.0.0
Requires-Dist: pytest>=8.0.0
Requires-Dist: pytest-cov>=5.0.0
Requires-Dist: pytest-xdist>=3.0.0
Requires-Dist: pytest-testmon>=2.0.0
Provides-Extra: dev
Requires-Dist: ruff>=0.7.0; extra == "dev"
Requires-Dist: mypy>=1.13.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: pytest-json-report>=1.5.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
Requires-Dist: pytest-watch>=4.2.0; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

<!-- ---
!-- Timestamp: 2025-08-30 09:30:31
!-- Author: ywatanabe
!-- File: /home/ywatanabe/proj/screen-manager/README.md
!-- --- -->

# Screen Session Manager

Manage screen sessions programmatically. Send commands, capture output, and automate workflows.

## Install

```bash
pip install -e .
```

## Quick Start

```python
from screen_manager import ScreenSessionManager

manager = ScreenSessionManager()

# Create session and send commands
manager.create_session("work")
manager.send_command("work", "python script.py")
output = manager.capture("work")
```

## CLI Usage

```bash
# Create and manage sessions  
python -m screen_manager create work
python -m screen_manager send work "echo hello"
python -m screen_manager capture work

# Send multiple commands
python -m screen_manager send-commands work -c "echo 1" -c "echo 2"

# Execute files
python -m screen_manager send-file work script.py

# List and attach
python -m screen_manager list --all
python -m screen_manager attach work

# Smart create/attach  
python -m screen_manager create-or-attach work

# Cleanup
python -m screen_manager cleanup work
```

## MCP Server

```bash
# Run as MCP server
python -m screen_manager serve

# Or from Python
from screen_manager.mcp_server import main
main()
```

### MCP Configuration

Add to your MCP client configuration:

```json
{
  "mcpServers": {
    "screen-manager": {
      "command": "python",
      "args": ["-m", "screen_manager.mcp_server"],
      "description": "Manage screen sessions, send commands, and capture output"
    }
  }
}
```

## API Methods

- `create_session(name)` - Create new session
- `send_command(name, cmd)` - Send single command
- `send_commands(name, cmds)` - Send command list
- `send_command_from_file(name, file)` - Execute file
- `capture(name, lines=-1)` - Get output
- `list_sessions(all_sessions=False)` - List sessions
- `attach_session(name)` - Get attach instructions
- `create_or_attach_session(name)` - Smart create/attach
- `cleanup_session(name)` - Remove session

## MCP Tools

The MCP server provides 10 tools:
- `create_session`
- `send_command` 
- `send_commands`
- `send_command_from_file`
- `capture_output`
- `list_sessions`
- `list_all_sessions`
- `attach_session`
- `create_or_attach_session`
- `cleanup_session`

### Use Case: Debugging with selective breakpoints
manager.send_commands("debug", [
    "export CIPDB_IDS=validate,transform",
    "python script_with_cipdb.py"
])

## Requirements

- Python 3.8+
- `screen` command (install with `apt install screen` or `brew install screen`)

That's it. Simple screen session management for Python.

<!-- EOF -->
