Skip to content

Commit fcf9d7f

Browse files
Merge branch 'main' into feat-changeCapture-Updates
2 parents d08df68 + 4c6bb6e commit fcf9d7f

File tree

2 files changed

+20
-33
lines changed

2 files changed

+20
-33
lines changed

docs/docs/core/cli-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ cocoindex server [OPTIONS] APP_TARGET
108108
| `-ci, --cors-cocoindex` | Allow `https://cocoindex.io` to access the server. |
109109
| `-cl, --cors-local INTEGER` | Allow `http://localhost:<port>` to access the server. |
110110
| `-L, --live-update` | Continuously watch changes from data sources and apply to the target index. |
111-
| `--setup` | Automatically setup backends for the flow if it's not setup yet. |
111+
| `--setup` | (DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior. [default: True] |
112112
| `--reset` | Drop existing setup before starting server (equivalent to running 'cocoindex drop' first). `--reset` implies `--setup`. |
113113
| `--reexport` | Reexport to targets even if there's no change. |
114114
| `-f, --force` | Force setup without confirmation prompts. |
@@ -194,7 +194,7 @@ cocoindex update [OPTIONS] APP_FLOW_SPECIFIER
194194
|--------|-------------|
195195
| `-L, --live` | Continuously watch changes from data sources and apply to the target index. |
196196
| `--reexport` | Reexport to targets even if there's no change. |
197-
| `--setup` | Automatically setup backends for the flow if it's not setup yet. |
197+
| `--setup` | (DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior. [default: True] |
198198
| `--reset` | Drop existing setup before updating (equivalent to running 'cocoindex drop' first). `--reset` implies `--setup`. |
199199
| `-f, --force` | Force setup without confirmation prompts. |
200200
| `-q, --quiet` | Avoid printing anything to the standard output, e.g. statistics. |

python/cocoindex/cli.py

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ def ls(app_target: str | None) -> None:
182182
"--color/--no-color", default=True, help="Enable or disable colored output."
183183
)
184184
@click.option("--verbose", is_flag=True, help="Show verbose output with full details.")
185-
@click.option("--live-status", is_flag=True, help="Show live update status for each data source.")
186-
def show(app_flow_specifier: str, color: bool, verbose: bool, live_status: bool) -> None:
185+
def show(app_flow_specifier: str, color: bool, verbose: bool) -> None:
187186
"""
188187
Show the flow spec and schema.
189188
@@ -204,15 +203,6 @@ def show(app_flow_specifier: str, color: bool, verbose: bool, live_status: bool)
204203
console = Console(no_color=not color)
205204
console.print(fl._render_spec(verbose=verbose))
206205
console.print()
207-
208-
if live_status:
209-
# Show live update status
210-
console.print("\n[bold cyan]Live Update Status:[/bold cyan]")
211-
options = flow.FlowLiveUpdaterOptions(live_mode=False, reexport_targets=False, print_stats=False)
212-
with flow.FlowLiveUpdater(fl, options) as updater:
213-
updater.print_cli_status()
214-
console.print()
215-
216206
table = Table(
217207
title=f"Schema for Flow: {fl.name}",
218208
title_style="cyan",
@@ -261,6 +251,23 @@ def _drop_flows(flows: Iterable[flow.Flow], app_ref: str, force: bool = False) -
261251
setup_bundle.apply(report_to_stdout=True)
262252

263253

254+
def _deprecate_setup_flag(
255+
ctx: click.Context, param: click.Parameter, value: bool
256+
) -> bool:
257+
"""Callback to warn users that --setup flag is deprecated."""
258+
# Check if the parameter was explicitly provided by the user
259+
if param.name is not None:
260+
param_source = ctx.get_parameter_source(param.name)
261+
if param_source == click.core.ParameterSource.COMMANDLINE:
262+
click.secho(
263+
"Warning: The --setup flag is deprecated and will be removed in a future version. "
264+
"Setup is now always enabled by default.",
265+
fg="yellow",
266+
err=True,
267+
)
268+
return value
269+
270+
264271
def _setup_flows(
265272
flow_iter: Iterable[flow.Flow],
266273
*,
@@ -285,22 +292,6 @@ def _setup_flows(
285292
setup_bundle.apply(report_to_stdout=not quiet)
286293

287294

288-
def _deprecate_setup_flag(
289-
ctx: click.Context, param: click.Parameter, value: bool
290-
) -> bool:
291-
"""Callback to warn users that --setup flag is deprecated."""
292-
if param.name is not None:
293-
param_source = ctx.get_parameter_source(param.name)
294-
if param_source == click.core.ParameterSource.COMMANDLINE:
295-
click.secho(
296-
"Warning: The --setup flag is deprecated and will be removed in a future version. "
297-
"Setup is now always enabled by default.",
298-
fg="yellow",
299-
err=True,
300-
)
301-
return value
302-
303-
304295
def _show_no_live_update_hint() -> None:
305296
click.secho(
306297
"NOTE: No change capture mechanism exists. See https://cocoindex.io/docs/core/flow_methods#live-update for more details.\n",
@@ -488,10 +479,6 @@ def update(
488479
else:
489480
assert len(flow_list) == 1
490481
with flow.FlowLiveUpdater(flow_list[0], options) as updater:
491-
if options.live_mode:
492-
# Show initial status
493-
updater.print_cli_status()
494-
click.echo()
495482
updater.wait()
496483
if options.live_mode:
497484
_show_no_live_update_hint()

0 commit comments

Comments
 (0)