feat(cli): improve workspace and cloud bisync command discoverability by phernandez · Pull Request #905 · basicmachines-co/basic-memory · GitHub
Skip to content

feat(cli): improve workspace and cloud bisync command discoverability - #905

Merged
phernandez merged 1 commit into
mainfrom
feat/cli-discoverability
Jun 7, 2026
Merged

feat(cli): improve workspace and cloud bisync command discoverability#905
phernandez merged 1 commit into
mainfrom
feat/cli-discoverability

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

Two small, independent CLI UX wins that improve discoverability of cloud project sync and workspace commands.

What changed

Part A (#817) — --project alias for --name

  • src/basic_memory/cli/commands/cloud/project_sync.py: the cloud sync, cloud bisync, and cloud check commands now accept --project as an alias for --name. Typer binds both option strings to the same name argument, so there's zero downstream change and --name stays for back-compat. The bisync-reset / sync-setup commands take the project as a positional argument and are unchanged.

Part B (#821) — bm workspace redirects to bm cloud workspace

  • New src/basic_memory/cli/commands/workspace.py: a top-level workspace stub command. Previously bm workspace / bm workspace list emitted a bare No such command 'workspace'. (exit 2). The stub prints actionable guidance pointing to bm cloud workspace list / bm cloud workspace set-default <name> and exits 1. context_settings={"allow_extra_args": True, "ignore_unknown_options": True} is load-bearing — it ensures bm workspace, bm workspace list, and bm workspace set-default foo all reach the body instead of being rejected as bad usage.
  • Wiring: added workspace to skip_init_commands in cli/app.py (the stub doesn't need DB init), to the conditional import block in cli/main.py, and to cli/commands/__init__.py imports + __all__.
  • The real bm cloud workspace sub-typer is unaffected — the stub registers on the top-level app, not under cloud_app.

Testing (commands + results)

  • uv run ruff check . — clean for all changed files (3 pre-existing errors in integrations/hermes/tests/ are out of scope and untouched)
  • uv run ruff format . — changed files formatted
  • uv run pytest tests/cli/test_workspace_stub.py tests/cli/cloud/test_project_sync_command.py -q18 passed (includes 2 new --project parametrized variants and the new workspace stub test asserting exit 1 + bm cloud workspace guidance for all three forms)
  • uv run ty check src tests test-intAll checks passed!
  • Manual sanity: bm cloud workspace --help still resolves (exit 0, list verb present); bm cloud sync --help shows --project.

Integration-style CliRunner tests against the real app; no mocks added (the existing project_sync test fixtures' monkeypatches are reused for the alias variants since those tests exercise the dispatch path, not cloud I/O).

Risk

Low. --project is purely additive (Typer multi-name option). The workspace stub only intercepts a previously-failing invocation and registers on the top-level app without shadowing the real bm cloud workspace commands.

Closes #817
Closes #821

🤖 Generated with Claude Code

Add '--project' as an alias for '--name' on the cloud sync/bisync/check
commands so users who think in terms of projects can use either flag. Typer
binds both option strings to the same 'name' arg, so there is no downstream
change and '--name' stays for back-compat.

Add a top-level 'workspace' stub command that redirects users to the real
'bm cloud workspace' verbs. Previously 'bm workspace' (and 'bm workspace list'
etc.) emitted a bare "No such command 'workspace'." with exit 2. The stub uses
allow_extra_args + ignore_unknown_options so every 'bm workspace ...' form
reaches the body and prints actionable guidance with exit 1.

Closes #817

Closes #821

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

@phernandez
phernandez merged commit f7304bf into main Jun 7, 2026
25 checks passed
@phernandez
phernandez deleted the feat/cli-discoverability branch June 7, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Hint at 'bm cloud workspace' when user runs 'bm workspace' CLI: add --project alias for --name flag in bm cloud bisync

1 participant