feat(cast)!: redesign the CLI around felis's own command line #15
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/cli-redesign"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Breaking CLI redesign: positional FILE, interactive record by default (switch-in-place inside felis, else a new window; --headless / --session), stop on program exit, streaming FILE.part writes, felis-compatible socket/spawn/exit codes, new play command. Closes #5.
The old CLI was a thin wrapper over the library: `--out`/`--in` files, a mandatory `--command` string run under `sh -c`, an `--idle-ms` timer as the only way to stop, and no way to type into the recorded session. It answered "record what this script prints", not the question users bring ("record what I do in this terminal"), and every flag spelled something differently from `felis` itself. Breaking: the commands are now felis cast record [OPTIONS] <FILE> [-- <COMMAND>...] felis cast play [--speed F] <FILE> felis cast serve <FILE> --socket <PATH> [--speed F] [--session-id ID] - record is interactive by default. Inside a felis window it switches that window onto the new session (`felis sessions switch`) and felis brings it back when the program exits; elsewhere it opens a window. `--headless` keeps the scripted mode, `--session` records an existing session. This implements forge issue #5. - The recording stops on the daemon's SessionExited push instead of an idle timer, which cut quiet interactive sessions short. `--idle` and `--max` remain as extra stops. Stopping the recording leaves the session running (felis sessions are persistent), except a headless session the recorder created, which would otherwise leak. - Socket resolution, session creation (launch_args) and daemon auto-spawn go through felis-client-core, so they match `felis` exactly. Args are parsed by clap like felis's, which also makes `felis help cast` work. Exit codes keep felis's 1/2 split. - Units are appended as they close into FILE.part, renamed at the end: memory stays flat for long recordings, a killed recorder leaves a valid partial file, and an existing FILE is refused unless --force. - play is serve on a private 0700 socket plus a window, so replaying to oneself is one command instead of two terminals. The integration tests run an in-process felis-daemon with stand-in felis scripts, which surfaced a bug: a program that exited before the first pull completed ended as "disconnected" because a failed pull broke the loop before the SessionExited push was read. The flake vendors felis's build-common.rs because felis-daemon's build script includes it by relative path. The retry_connect mutants exclusion goes with retry_connect itself.