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

2•mrsurge•13h 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 ```

Ask HN: Those making $500/month on side projects in 2025 – Show and tell

388•cvbox•18h ago•429 comments

Tell HN: HN was down

590•uyzstvqs•1d ago•320 comments

Ask HN: Who here is not working on web apps/server code?

9•ex-aws-dude•1h ago•6 comments

Ask HN: Does anyone understand how Hacker News works?

143•jannesblobel•20h ago•191 comments

Is analytics a necessary evil rather than a real value driver?

5•tiazm•2h ago•4 comments

Ask HN: How to fight back against Lovable, Replit, etc. in enterprise products

2•bears123•2h ago•1 comments

Ask HN: What Are You Working On? (December 2025)

437•david927•4d ago•1432 comments

Ask HN: Should I Open Source Every Product I Build as an Indie Developer?

6•tomfox2•4h ago•9 comments

Ask HN: If you had to get a non-tech masters degree, what would you go for?

2•highwayman47•4h ago•6 comments

Tell HN: AI coding is sexy, but accounting is the real low-hanging target

62•bmadduma•6d ago•55 comments

Ask HN: Why do official-looking emails cause anxiety before I read them?

4•BianDan•6h ago•4 comments

Ask HN: Is RSS Still Alive?

7•militanz•12h ago•10 comments

Ask HN: Decentralized Auth for Information Exchange?

2•vxsz•10h ago•2 comments

Ask HN: Etiquette giving feedback on mostly AI-generated PRs from co-workers

4•chfritz•16h ago•4 comments

Ask HN: Should I start a software foundation (goal: help emergency services)?

9•strgcmc•20h ago•0 comments

Ask HN: Is starting a personal blog still worth it in the age of AI?

62•nazarh•3d ago•75 comments

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

2•mrsurge•13h ago•0 comments

Ask HN: Is building a calm, non-gamified learning app a mistake?

86•hussein-khalil•3d ago•122 comments

Computer animator and Amiga fanatic Dick van Dyke turns 100

280•ggm•5d ago•93 comments

Ask HN: What are your predictions for 2026?

24•mfrw•1d ago•20 comments

Ask HN: How can I get better at using AI for programming?

466•lemonlime227•5d ago•466 comments

Memory Safety in C# vs. Rust

14•northlondoner•2d ago•12 comments

Ask HN: How are you vibe coding in an established code base?

10•adam_gyroscope•2d ago•7 comments

Ask HN: Was HN just down for anyone else?

84•rozenmd•1d ago•2 comments

Ask HN: Claude Opus 4.5 vs. GPT 5.1 Codex Max for coding. Worth the upgrade?

5•terabytest•2d ago•6 comments

Ask HN: Bloggers, how do you manage your content?

11•freemanjiang•2d ago•14 comments

Who has enjoyed using PR code reviewers? What worked and what didn’t?

3•yashwantphogat•1d ago•4 comments

Ask HN: Did anyone else notice that the OpenAI Labs website was completely gone?

27•underlipton•6d ago•9 comments

Ask HN: Thought-Provoking Books

21•Agraillo•5d ago•18 comments

Ask HN: Best back end to run models on Google TPU?

8•vood•3d ago•0 comments