Skip to content

feat(cli): expose --live-fork on forkd fork / from-image / run for spawn-time opt-in #209

@WaylandYang

Description

@WaylandYang

Gap

Phase 7.1 (REST live_fork: true on POST /v1/sandboxes) and Phase 7.3 (Controller.spawn_sandboxes(live_fork=True) in Python/TS/MCP SDKs) shipped the spawn-time live-fork opt-in. The CLI did not get a matching flag.

This means:

  • The doc comment on forkd snapshot --live (added in Phase 7.2) tells users "the source must have been created with `--live-fork`," but that flag doesn't exist.
  • A CLI-only workflow can't currently spawn a live-fork-capable source — you have to drop into the SDK or curl REST to set live_fork: true.

Scope

Add --live-fork (bool flag) to:

  • forkd fork (spawns N children from a registered snapshot)
  • forkd from-image (Docker → rootfs → boot → register, then optionally spawn one)
  • forkd run (one-shot spawn)

For each, plumb the flag through to POST /v1/sandboxes body's live_fork: true (the daemon already accepts it).

Acceptance

  • forkd fork --tag X -n 1 --live-fork spawns a live-fork-capable child; forkd snapshot --from-sandbox <id> --live then succeeds against it
  • clap docstring explains the kernel/FC prereqs (link to docs/VENDORED-FIRECRACKER.md)
  • forkd snapshot --live doc comment can drop the "source must have been created with --live-fork" caveat into being literally true on the CLI
  • README's bash snippet (currently calls out the gap explicitly) can be tightened to remove that note

Why follow-up not blocking

mode: \"live\" itself works today via SDK or REST — this is purely CLI ergonomics. Filed honestly in the v0.4 CHANGELOG entry rather than papered over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions