Skip to main content

scrn-mgr

A GNU screen session manager: CLI first, with a Rich/Textual TUI and an MCP server, so sessions can be driven the same way from a terminal, a human-friendly UI, or an AI assistant. Sessions can live on the local machine or on remote nodes reachable over SSH -- scrn-mgr keeps a small registry at ~/.scrn-mgr/registry.json recording which host each session is on.

Install

pip install scrn-mgr

Development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest -q

Quick start (Python API)

from scrn_mgr import ScreenSessionManager

manager = ScreenSessionManager()
manager.new_session("work")                       # local
manager.new_session("train", host="user@gpu01")    # remote, over SSH
manager.send_command("work", "python script.py")
output = manager.capture("work")

CLI usage

scrn-mgr new work                       # alias: create
scrn-mgr new train --host user@gpu01    # started on a remote node over SSH
scrn-mgr send work "echo hello"
scrn-mgr send-commands work -c "echo 1" -c "echo 2"
scrn-mgr send-file work script.sh
scrn-mgr capture work
scrn-mgr list --all
scrn-mgr attach work                    # interactive; ssh -t under the hood if remote
scrn-mgr new-or-attach work             # alias: create-or-attach
scrn-mgr kill work
scrn-mgr cleanup work                   # or: scrn-mgr cleanup --all
scrn-mgr tui                            # Textual UI
scrn-mgr serve                          # MCP server (stdio)

MCP server

scrn-mgr serve runs an MCP server over stdio exposing every non-interactive operation: list_sessions, new_session, send_command, send_commands, send_file, capture, cleanup_session, kill_session. Interactive attach is intentionally not exposed over MCP -- it needs to take over a real terminal/PTY for the life of the session, which doesn't fit a single tool call/response. Use the CLI (scrn-mgr attach NAME) or the TUI for that.

Because the MCP server always runs locally next to its client and reaches remote sessions the same way the CLI does (one ssh round trip per call, using the host recorded in the registry), no special transport is needed for SSH-remote sessions -- plain stdio is sufficient.

Example client config:

{
  "mcpServers": {
    "scrn-mgr": {
      "command": "scrn-mgr",
      "args": ["serve"]
    }
  }
}

Requirements

  • Python 3.10+
  • The screen binary (brew install screen / apt install screen)
  • For remote sessions: SSH access to the target host (via your normal ~/.ssh/config) with screen installed there too

Releasing

Pushing a v* tag runs .github/workflows/release.yml, which builds the sdist/wheel, publishes them to PyPI via Trusted Publishing (no stored secrets), and attaches the build artifacts to a GitHub release.

One-time setup (already done for this repo, kept here for reference): on the PyPI project's "Publishing" settings (or, for the very first release, on https://pypi.org/manage/account/publishing/), add a trusted publisher with:

Field Value
PyPI project name scrn-mgr
Owner this repository's GitHub owner (user or org)
Repository name scrn-mgr
Workflow name release.yml
Environment name pypi

Cutting a release:

# 1. bump the version in pyproject.toml, e.g. 0.1.0 -> 0.1.1, and commit it
git commit -am "Bump version to 0.1.1"

# 2. tag it (must match pyproject.toml's version, with a v prefix) and push both
git push
git tag v0.1.1
git push origin v0.1.1

The workflow refuses to publish if the tag and pyproject.toml's version disagree.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrn_mgr-0.1.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrn_mgr-0.1.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file scrn_mgr-0.1.1.tar.gz.

File metadata

  • Download URL: scrn_mgr-0.1.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scrn_mgr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6acf96d599853b3df70c3c28da86103559cb4d86a2dce26b8f65a62f0be68d3d
MD5 753080d704d87b7b04c04fbc249d3d65
BLAKE2b-256 46cec4207ebcd33bbd1d192c0d8225d08d3edf81cf7097afeb0e75cb9be52d20

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrn_mgr-0.1.1.tar.gz:

Publisher: release.yml on matplo/scrn-mgr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scrn_mgr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scrn_mgr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scrn_mgr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a11e875882e058f137c0b5945a107fc167a72458994b73f3f46b6b4c0cbe033
MD5 9fda7bae9f2444bcc2194a87946bf983
BLAKE2b-256 449114a42093ff1732ca6e9cb7216f5a8f9794a746b6f5a38eae0f1d61f7fd02

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrn_mgr-0.1.1-py3-none-any.whl:

Publisher: release.yml on matplo/scrn-mgr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

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