frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

FWS – pip-installable embedded process supervisor with PTY/pipe/dtach back ends

8•mrsurge•3d ago
I’m releasing *Framework Shells* (`fws`): a standalone Python package for orchestrating long-running background processes (“shells”) with *PTY*, *pipes*, and *dtach* backends.

This is meant for environments where you don’t want to stand up a full supervisor stack (or don’t have one): quick multi-service prototypes, dev environments, constrained userlands, etc.

### What it does

* Spawn/manage shells with:

  * **PTY**: interactive terminal sessions (resize, input, stream)
  * **Pipes**: stdin/stdout/stderr streams (good for daemons/LSPs)
  * **dtach**: persistent sessions you can attach/detach to (survives manager restarts)
* *Runtime isolation* (the big feature): shells are namespaced by `~/.cache/framework_shells/runtimes/<repo_fingerprint>/<runtime_id>/...` so two clones of the same repo can run concurrently without cross-adoption or cross-control. * *Control surfaces*: CLI + optional FastAPI/WS UI for listing, logs, and lifecycle actions. * Optional *hooks* for host integration (external registries/telemetry).

### CLI quickstart

```bash # list shells fws list

# run a one-off shell (no spec) fws run --backend pty --label demo -- bash -l -i

# apply a YAML shellspec (recommended) fws up shells.yaml

# terminate shells fws down

# attach to a dtach-backed shell fws attach <shell_id>

# show managed shells + procfs descendants fws tree --depth 4 ```

### Shellspec example

```yaml version: "1" shells: worker: backend: proc cwd: ${ctx:PROJECT_ROOT} subgroups: ["worker", "project:${ctx:APP_ID}"] command: ["python", "-m", "your_module.worker", "--port", "${free_port}"] ```

### Isolation + security model (simple by default)

* `FRAMEWORK_SHELLS_SECRET` derives the `runtime_id` (namespace) and API tokens. * If the secret is set, mutating API endpoints require:

  * `Authorization: Bearer <token>` (or `X-Framework-Key`).
* If the secret is unset, auth is disabled (dev mode).

Hard limit: if two runtimes share the same OS user/UID, the OS may still allow signaling each other’s processes. The guarantee is: no cross-count/adopt/control *through the library’s control plane*.

### Real-world usage

I use this as the substrate of a full dev environment where “apps are shells” (terminals, IDE + LSP, agent/MCP, aria2 RPC, file explorer, llama.cpp runner, etc.). Repo:

```text https://github.com/mrsurge/termux-extensions-2 ```

### Feedback I want

* Does the secret/fingerprint/runtime isolation contract feel right? * Any obvious foot-guns in the default API/CLI? * Expectations vs systemd/supervisord/tmux/dtach: where would you use this?

github.com/mrsurge/framework-shells

pip install "framework-shells @ git+https://github.com/mrsurge/framework-shells@main"

```bash fws --help ```

Comments

teraflop•1h ago
> Expectations vs systemd/supervisord/tmux/dtach: where would you use this?

Sorry to be blunt, but I feel like this is a big unanswered question that you should be addressing. Why would I use your tool over the other well-known alternatives? I read through your overview and I don't see an answer.

You say that this is intended "for environments where you don’t want to stand up a full supervisor stack (or don’t have one)". And you compare it to systemd. But what Linux developer doesn't already have systemd installed?

Or to use a different comparison, what advantage does "fws run" have over "podman run"? Podman already supports PTYs that can be attached/detached, allows isolating different processes, and has an HTTP API.

It seems like you intend this for situations where you want a multi-pane text-base UI that resembles an IDE. But personally, I prefer to do this sort of thing by composing existing tools that provide that functionality (namely tmux/screen and Docker/Podman) rather than using a single integrated tool that tries to replace both.

Logging Sucks

https://loggingsucks.com/
249•FlorinSays•2h ago•81 comments

Show HN: Books mentioned on Hacker News in 2025

https://hackernews-readings-613604506318.us-west1.run.app
220•seinvak•4h ago•95 comments

Weight loss jabs: What happens when you stop taking them

https://www.bbc.com/news/articles/cn98pdpyjz5o
25•neom•42m ago•11 comments

Mullvad VPN: "This is a Chat Control 3.0 attempt."

https://mastodon.online/@mullvadnet/115742530333573065
200•janandonly•2h ago•59 comments

E.W.Dijkstra Archive

https://www.cs.utexas.edu/~EWD/welcome.html
77•surprisetalk•5h ago•7 comments

Show HN: WalletWallet – create Apple passes from anything

https://walletwallet.alen.ro/
175•alentodorov•4h ago•61 comments

ARIN Public Incident Report – 4.10 Misissuance Error

https://www.arin.net/announcements/20251212/
115•immibis•5h ago•25 comments

Get an AI code review in 10 seconds

https://oldmanrahul.com/2025/12/19/ai-code-review-trick/
31•oldmanrahul•3h ago•18 comments

You're Not Burnt Out. You're Existentially Starving

https://neilthanedar.com/youre-not-burnt-out-youre-existentially-starving/
86•thanedar•2h ago•79 comments

I Program on the Subway

https://www.scd31.com/posts/programming-on-the-subway
100•evankhoury•4d ago•66 comments

I can't upgrade to Windows 11, now leave me alone

https://idiallo.com/byte-size/cant-update-to-windows-11-leave-me-alone
96•firefoxd•1h ago•71 comments

Coarse Is Better

https://borretti.me/article/coarse-is-better
149•_dain_•7h ago•79 comments

Three Ways to Solve Problems

https://andreasfragner.com/writing/three-ways-to-solve-problems
77•42point2•6h ago•17 comments

Ruby website redesigned

https://www.ruby-lang.org/en/
304•psxuaw•13h ago•119 comments

Structured Outputs Create False Confidence

https://boundaryml.com/blog/structured-outputs-create-false-confidence
82•gmays•5h ago•48 comments

Indoor tanning makes youthful skin much older on a genetic level

https://www.ucsf.edu/news/2025/12/431206/indoor-tanning-makes-youthful-skin-much-older-genetic-level
190•SanjayMehta•15h ago•140 comments

Show HN: RenderCV – Open-source CV/resume generator, YAML to PDF

https://github.com/rendercv/rendercv
52•sinaatalay•7h ago•28 comments

FWS – pip-installable embedded process supervisor with PTY/pipe/dtach back ends

8•mrsurge•3d ago•1 comments

Measuring AI Ability to Complete Long Tasks

https://metr.org/blog/2025-03-19-measuring-ai-ability-to-complete-long-tasks/
211•spicypete•16h ago•163 comments

What I learned about deploying AV1 from two deployers

https://streaminglearningcenter.com/articles/what-i-learned-about-deploying-av1-from-two-deployer...
31•breve•5d ago•20 comments

Show HN: Jmail – Google Suite for Epstein files

https://www.jmail.world
1312•lukeigel•23h ago•305 comments

Show HN: HN Sentiment API – I ranked tech CEOs by how much you hate them

https://docs.hnpulse.com
23•kingofsunnyvale•5h ago•5 comments

Show HN: Shittp – Volatile Dotfiles over SSH

https://github.com/FOBshippingpoint/shittp
104•sdovan1•8h ago•57 comments

Decompiling the New C# 14 field Keyword

https://blog.ivankahl.com/decompiling-the-new-csharp-14-field-keyword/
62•ivankahl•4d ago•24 comments

Show HN: AI-Augmented Memory for Groups

https://www.largemem.com/
7•vishal-ds•5d ago•2 comments

Show HN: The Official National Train Map Sucked, So I Made My Own

https://www.bdzmap.com/
63•Pavlinbg•8h ago•15 comments

Claude in Chrome

https://claude.com/chrome
293•ianrahman•23h ago•160 comments

ELF Crimes: Program Interpreter Fun

https://nytpu.com/gemlog/2025-12-21
44•nytpu•4h ago•9 comments

Ireland’s Diarmuid Early wins world Microsoft Excel title

https://www.bbc.com/news/articles/cj4qzgvxxgvo
302•1659447091•1d ago•116 comments

Autoland Saves King Air, Everyone Reported Safe

https://avbrief.com/autoland-saves-king-air-everyone-reported-safe/
11•bradleybuda•3h ago•4 comments