<!-- ---
!-- 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 -->
Raw data
{
"_id": null,
"home_page": null,
"name": "screen-manager",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Yusuke Watanabe <yusuke.watanabe@scitex.ai>",
"keywords": "debugging, ipdb, multi-agent, mcp, screen, session-management, conditional-debugging, AI-agents",
"author": null,
"author_email": "Yusuke Watanabe <yusuke.watanabe@scitex.ai>",
"download_url": "https://files.pythonhosted.org/packages/6b/52/49107af3812384eb79c3e3ae5d76e333fd9251da8b5c6e717a1e15242ecd/screen_manager-0.1.0.tar.gz",
"platform": null,
"description": "<!-- ---\n!-- Timestamp: 2025-08-30 09:30:31\n!-- Author: ywatanabe\n!-- File: /home/ywatanabe/proj/screen-manager/README.md\n!-- --- -->\n\n# Screen Session Manager\n\nManage screen sessions programmatically. Send commands, capture output, and automate workflows.\n\n## Install\n\n```bash\npip install -e .\n```\n\n## Quick Start\n\n```python\nfrom screen_manager import ScreenSessionManager\n\nmanager = ScreenSessionManager()\n\n# Create session and send commands\nmanager.create_session(\"work\")\nmanager.send_command(\"work\", \"python script.py\")\noutput = manager.capture(\"work\")\n```\n\n## CLI Usage\n\n```bash\n# Create and manage sessions \npython -m screen_manager create work\npython -m screen_manager send work \"echo hello\"\npython -m screen_manager capture work\n\n# Send multiple commands\npython -m screen_manager send-commands work -c \"echo 1\" -c \"echo 2\"\n\n# Execute files\npython -m screen_manager send-file work script.py\n\n# List and attach\npython -m screen_manager list --all\npython -m screen_manager attach work\n\n# Smart create/attach \npython -m screen_manager create-or-attach work\n\n# Cleanup\npython -m screen_manager cleanup work\n```\n\n## MCP Server\n\n```bash\n# Run as MCP server\npython -m screen_manager serve\n\n# Or from Python\nfrom screen_manager.mcp_server import main\nmain()\n```\n\n### MCP Configuration\n\nAdd to your MCP client configuration:\n\n```json\n{\n \"mcpServers\": {\n \"screen-manager\": {\n \"command\": \"python\",\n \"args\": [\"-m\", \"screen_manager.mcp_server\"],\n \"description\": \"Manage screen sessions, send commands, and capture output\"\n }\n }\n}\n```\n\n## API Methods\n\n- `create_session(name)` - Create new session\n- `send_command(name, cmd)` - Send single command\n- `send_commands(name, cmds)` - Send command list\n- `send_command_from_file(name, file)` - Execute file\n- `capture(name, lines=-1)` - Get output\n- `list_sessions(all_sessions=False)` - List sessions\n- `attach_session(name)` - Get attach instructions\n- `create_or_attach_session(name)` - Smart create/attach\n- `cleanup_session(name)` - Remove session\n\n## MCP Tools\n\nThe MCP server provides 10 tools:\n- `create_session`\n- `send_command` \n- `send_commands`\n- `send_command_from_file`\n- `capture_output`\n- `list_sessions`\n- `list_all_sessions`\n- `attach_session`\n- `create_or_attach_session`\n- `cleanup_session`\n\n### Use Case: Debugging with selective breakpoints\nmanager.send_commands(\"debug\", [\n \"export CIPDB_IDS=validate,transform\",\n \"python script_with_cipdb.py\"\n])\n\n## Requirements\n\n- Python 3.8+\n- `screen` command (install with `apt install screen` or `brew install screen`)\n\nThat's it. Simple screen session management for Python.\n\n<!-- EOF -->\n",
"bugtrack_url": null,
"license": null,
"summary": "Screen session manager with MCP support",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://github.com/Yusuke Watanabe/screen-manager",
"Homepage": "https://github.com/Yusuke Watanabe/screen-manager",
"Repository": "https://github.com/Yusuke Watanabe/screen-manager"
},
"split_keywords": [
"debugging",
" ipdb",
" multi-agent",
" mcp",
" screen",
" session-management",
" conditional-debugging",
" ai-agents"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8c1e32e5f3b947058cad746b2990177ec6ff02a1c85c9409598688d31ade53b6",
"md5": "2fc1667a5d5c6c3c303afacc174ac92a",
"sha256": "37afb1dc4b6c603e9d4ca6b773441e151d5cad9e72ddf6aca063e813ae6ea5e5"
},
"downloads": -1,
"filename": "screen_manager-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2fc1667a5d5c6c3c303afacc174ac92a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 21241,
"upload_time": "2025-08-29T23:31:46",
"upload_time_iso_8601": "2025-08-29T23:31:46.243722Z",
"url": "https://files.pythonhosted.org/packages/8c/1e/32e5f3b947058cad746b2990177ec6ff02a1c85c9409598688d31ade53b6/screen_manager-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6b5249107af3812384eb79c3e3ae5d76e333fd9251da8b5c6e717a1e15242ecd",
"md5": "7127614cc31a3ac69525f192f0b14016",
"sha256": "1e01bdac7924a0758256949c6ebb5a0c4a948ec706c431b688dcb98030dfafc8"
},
"downloads": -1,
"filename": "screen_manager-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7127614cc31a3ac69525f192f0b14016",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 28855,
"upload_time": "2025-08-29T23:31:48",
"upload_time_iso_8601": "2025-08-29T23:31:48.134613Z",
"url": "https://files.pythonhosted.org/packages/6b/52/49107af3812384eb79c3e3ae5d76e333fd9251da8b5c6e717a1e15242ecd/screen_manager-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-29 23:31:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Yusuke Watanabe",
"github_project": "screen-manager",
"github_not_found": true,
"lcname": "screen-manager"
}