diff --git a/backend/fluksio/sdk/cli.py b/backend/fluksio/sdk/cli.py index cb2a249..5863b3f 100644 --- a/backend/fluksio/sdk/cli.py +++ b/backend/fluksio/sdk/cli.py @@ -612,6 +612,10 @@ def cmd_status(args: argparse.Namespace) -> int: return 0 if not sys.stdout.isatty(): return _fail("--watch needs a terminal; without one, drop it") + if getattr(args, "local", False): + # An in-process engine is this command and nothing else, so + # nothing can change under it while it watches. + return _fail("--watch wants an engine that outlives it; drop --local") with Live(_status_screen(client), console=console) as live: while True: time.sleep(WATCH_INTERVAL_S) @@ -788,7 +792,9 @@ def add_parsers(subparsers: Any) -> None: action="store_true", help="keep it on screen, refreshed until Ctrl-C", ) - with_engine(parser) + # `--local` for the same reason `runs` has it: the flows and the history are + # in this directory, and reading them should not need a server. + with_engine(parser, local=True) parser.set_defaults(func=cmd_status) parser = subparsers.add_parser("runs", help="the runs an engine has recorded") diff --git a/docs/code/cli.md b/docs/code/cli.md index 012ef8f..226596a 100644 --- a/docs/code/cli.md +++ b/docs/code/cli.md @@ -241,6 +241,10 @@ whether it has unpublished changes, and the last few failures under them. the cadence the dashboard polls at, since nothing here moves faster. It needs a terminal; without one, run it without `--watch` and the output pipes cleanly. +`--local` reads the flows and history out of this directory with no engine +served, the same way `runs --local` does. It cannot be watched: an in-process +engine is the command itself, so nothing changes under it. + ### `fluksio runs` ```sh