Skip to main content

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 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.

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)

Source distribution for screen-manager 0.1.0
File Size Uploaded Provenance
screen_manager-0.1.0.tar.gz 28.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for screen-manager 0.1.0
File Interpreter ABI Platform
screen_manager-0.1.0-py3-none-any.whl Python 3 none any Details

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page