Skip to content

Add Nix flake and fish shell completions - #1

Closed
schickling-assistant wants to merge 1 commit into
compoundingtech:mainfrom
schickling-assistant:add-nix-flake
Closed

Add Nix flake and fish shell completions#1
schickling-assistant wants to merge 1 commit into
compoundingtech:mainfrom
schickling-assistant:add-nix-flake

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Summary

  • Add flake.nix with buildNpmPackage derivation for the pty CLI
  • Add fish shell completions (completions/pty.fish) covering all subcommands and flags
  • Install bash, zsh, and fish completions to standard Nix paths (share/bash-completion/, share/zsh/site-functions/, share/fish/vendor_completions.d/)
  • Add result to .gitignore for nix build output

Rationale

This makes pty installable via Nix flakes, which enables reproducible builds and easy consumption as a flake input in other projects:

# As a flake input
inputs.pty.url = "github:myobie/pty";

# Direct usage
nix run github:myobie/pty -- --help
nix shell github:myobie/pty

The derivation uses buildNpmPackage (nixpkgs) which handles the node-pty native prebuilds correctly and patches the shebang to use a Nix-provided Node.js.

Test plan

  • nix build .#pty succeeds
  • pty --help works from the built output
  • pty run -d test sleep 5 && pty list && pty kill test — full session lifecycle works
  • Bash completions produce correct subcommands
  • Zsh completions installed at correct path
  • Fish completions produce correct subcommands and flags

Note

This PR was created on behalf of @schickling

🤖 Generated with Claude Code

- Add flake.nix with buildNpmPackage derivation for the pty CLI
- Add fish shell completions (completions/pty.fish) covering all
  subcommands and flags
- Install bash, zsh, and fish completions to standard Nix paths
- Add `result` to .gitignore for nix build output

Usage as a flake input:
  nix run github:myobie/pty -- --help
  nix shell github:myobie/pty

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@myobie

myobie commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

@schickling-assistant thanks for this, I've now got something in main inspired from this PR and are grateful for your help 🫡

@myobie myobie closed this Mar 23, 2026
myobie added a commit that referenced this pull request Jul 21, 2026
…k parity + wire vitest CI (#114)

Un-breaks the post-exit parity contract that #111 (exit-reap) broke on main, per
Nathan's call: make reap-vs-preserve-on-exit CONFIGURABLE rather than a fixed
default.

- PTY_REAP_ON_EXIT env knob (network/global; the daemon inherits it via
  spawn.ts) sets the default: false/0/no/off -> preserve, unset/else -> reap
  (shipped default). Per-session keep=true (force preserve) / --ephemeral
  (force reap) override it. shouldReapAtExit gains an OPTIONAL defaultReap
  param (defaults to reapOnExitDefault()) so the re-exported 2-arg API
  (relay/layout/supervisors) stays backward-compatible.
- parity #1 now asserts BOTH modes (preserve keeps the final screen; reap
  reaps). exit-reap.test.ts keeps the reap-default suite + adds a preserve-mode
  block. isolate-env.ts scrubs PTY_REAP_ON_EXIT for a deterministic default.
- help.test.ts: completions -> NON_COMMAND_CASES (fixes pre-existing #106 help
  drift; completions ships its own lightweight usage, not the strict
  per-subcommand format).
- CI: add .github/workflows/test.yml gating the vitest suite (Node 22, matches
  flake.nix) on PR + push-to-main. Installs the test-only binaries
  ubuntu-latest lacks (zsh/fish for shells.test.ts; a no-op claude stub for
  restart-guardrail). The push CI was Nix-build-only, which is how both breaks
  reached main invisibly. Supersedes #113.
- Docs: README "Session lifecycle and cleanup" + CHANGELOG rewritten for the
  configurable setting.

Full suite green: 1408 passed, 21 pre-existing env-gated skips.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants