mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
feat(cli): improve workspace and cloud bisync command discoverability (#905)
Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,7 @@ def app_callback(
|
||||
"reindex",
|
||||
"update",
|
||||
"watch",
|
||||
"workspace",
|
||||
}
|
||||
if (
|
||||
not version
|
||||
|
||||
@@ -9,6 +9,7 @@ from . import (
|
||||
format,
|
||||
schema,
|
||||
update,
|
||||
workspace,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
@@ -27,4 +28,5 @@ __all__ = [
|
||||
"format",
|
||||
"schema",
|
||||
"update",
|
||||
"workspace",
|
||||
]
|
||||
|
||||
@@ -146,7 +146,7 @@ def _get_sync_project(
|
||||
|
||||
@cloud_app.command("sync")
|
||||
def sync_project_command(
|
||||
name: str = typer.Option(..., "--name", help="Project name to sync"),
|
||||
name: str = typer.Option(..., "--name", "--project", help="Project name to sync"),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Preview changes without syncing"),
|
||||
verbose: bool = typer.Option(False, "--verbose", "-v", help="Show detailed output"),
|
||||
) -> None:
|
||||
@@ -193,7 +193,7 @@ def sync_project_command(
|
||||
|
||||
@cloud_app.command("bisync")
|
||||
def bisync_project_command(
|
||||
name: str = typer.Option(..., "--name", help="Project name to bisync"),
|
||||
name: str = typer.Option(..., "--name", "--project", help="Project name to bisync"),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Preview changes without syncing"),
|
||||
resync: bool = typer.Option(False, "--resync", help="Force new baseline"),
|
||||
verbose: bool = typer.Option(False, "--verbose", "-v", help="Show detailed output"),
|
||||
@@ -256,7 +256,7 @@ def bisync_project_command(
|
||||
|
||||
@cloud_app.command("check")
|
||||
def check_project_command(
|
||||
name: str = typer.Option(..., "--name", help="Project name to check"),
|
||||
name: str = typer.Option(..., "--name", "--project", help="Project name to check"),
|
||||
one_way: bool = typer.Option(False, "--one-way", help="Check one direction only (faster)"),
|
||||
) -> None:
|
||||
"""Verify file integrity between local and cloud.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""Top-level `workspace` stub that redirects users to `bm cloud workspace`."""
|
||||
|
||||
import typer
|
||||
|
||||
from basic_memory.cli.app import app
|
||||
|
||||
|
||||
# Trigger: user runs `bm workspace`, `bm workspace list`, etc.
|
||||
# Why: workspace verbs live under `bm cloud workspace`; a bare top-level miss
|
||||
# only emits Typer's terse "No such command 'workspace'." with exit 2.
|
||||
# Outcome: allow_extra_args + ignore_unknown_options absorb any trailing tokens
|
||||
# (e.g. `list`, `set-default foo`) so every invocation reaches this body and
|
||||
# prints actionable guidance instead of being rejected as bad usage.
|
||||
@app.command(
|
||||
"workspace",
|
||||
context_settings={"allow_extra_args": True, "ignore_unknown_options": True},
|
||||
)
|
||||
def workspace_stub(ctx: typer.Context) -> None:
|
||||
"""Point users to the real workspace verbs under `bm cloud workspace`."""
|
||||
typer.echo("'bm workspace' is not a command. Workspace verbs live under 'bm cloud workspace':")
|
||||
typer.echo(" bm cloud workspace list")
|
||||
typer.echo(" bm cloud workspace set-default <name>")
|
||||
raise typer.Exit(1)
|
||||
@@ -31,6 +31,7 @@ if not _version_only_invocation(sys.argv[1:]):
|
||||
status,
|
||||
tool,
|
||||
update,
|
||||
workspace,
|
||||
)
|
||||
|
||||
warnings.filterwarnings("ignore") # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user