Screen Session Manager
Manage screen sessions programmatically. Send commands, capture output, and automate workflows.
Install
pip install -e .
Quick Start
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
# 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
# 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:
{
"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 sessionsend_command(name, cmd)- Send single commandsend_commands(name, cmds)- Send command listsend_command_from_file(name, file)- Execute filecapture(name, lines=-1)- Get outputlist_sessions(all_sessions=False)- List sessionsattach_session(name)- Get attach instructionscreate_or_attach_session(name)- Smart create/attachcleanup_session(name)- Remove session
MCP Tools
The MCP server provides 10 tools:
create_sessionsend_commandsend_commandssend_command_from_filecapture_outputlist_sessionslist_all_sessionsattach_sessioncreate_or_attach_sessioncleanup_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+
screencommand (install withapt install screenorbrew install screen)
That's it. Simple screen session management for Python.
Metadata
Release files for screen-manager 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| screen_manager-0.1.0.tar.gz | 28.9 kB | Without provenance | Details for screen_manager-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| screen_manager-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for screen_manager-0.1.0-py3-none-any.whl |
Total release size: 50.1 kB
Release files / screen_manager-0.1.0.tar.gz
| Download URL | screen_manager-0.1.0.tar.gz |
|---|---|
| Size | 28.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e01bdac7924a0758256949c6ebb5a0c4a948ec706c431b688dcb98030dfafc8
|
|
BLAKE2b-256 checksum How to use checksums |
6b5249107af3812384eb79c3e3ae5d76e333fd9251da8b5c6e717a1e15242ecd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.0rc1
|
Release files / screen_manager-0.1.0-py3-none-any.whl
| Download URL | screen_manager-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37afb1dc4b6c603e9d4ca6b773441e151d5cad9e72ddf6aca063e813ae6ea5e5
|
|
BLAKE2b-256 checksum How to use checksums |
8c1e32e5f3b947058cad746b2990177ec6ff02a1c85c9409598688d31ade53b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.0rc1
|
Security for screen-manager 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.