Repository navigation
Description
Problem
There's no way to create or revoke a public share of a note from the CLI. The cloud product fully supports public shares, and the cloud API already exposes the endpoints — but bm cloud has no command to reach them. Today sharing is only doable from the web UI.
Existing cloud share API (in basic-memory-cloud, apps/cloud/src/basic_memory_cloud/api/public_shares.py):
| Method | Path | Purpose |
|---|---|---|
| POST | /api/shares |
Create a share (project_name, note_permalink, optional expires_at) |
| GET | /api/shares |
List shares |
| PATCH | /api/shares/{token} |
Enable/disable, set expiration |
| DELETE | /api/shares/{token} |
Revoke/delete the share |
There is no share-related code in this repo (basic-memory) at all today — it's purely a cloud concern that the CLI has never surfaced.
Proposed solution
Add a bm cloud share subcommand group under src/basic_memory/cli/commands/cloud/ (new shares.py, registered with cloud_app.add_typer(..., name="share")), using the existing make_api_request() helper + ConfigManager().config.cloud_host pattern that snapshot.py / core_commands.py already use.
Suggested surface:
bm cloud share <project> <note-permalink> [--expires-at <date>]→ POST/api/shares; print the resultingshare_urlbm cloud share list [--project <name>]→ GET/api/shares- Unshare → DELETE
/api/shares/{token}. Two options on the table:bm cloud unshare <token>(dedicated command), orbm cloud share --delete <token>(flag on the share command)
Open questions
- Unshare ergonomics: dedicated
unsharecommand vs.share --delete? A dedicatedbm cloud share revoke <token>subcommand may read most consistently with the group style. - Revoke vs. disable: DELETE revokes; PATCH
{enabled:false}disables without deleting. Do we want both (revokeand an--enable/--disabletoggle), or is delete-only enough for v1? - Note identifier: the create endpoint takes
note_permalink+project_name. Should the CLI accept a friendlier note path/title and resolve it, or require the exact permalink?
Related
- basicmachines-co/basic-memory-cloud#1015 (Share note from the web context menu — same underlying share API)
Activity
claude commentedon Jun 1, 2026
Claude finished @groksrc's task in 1m 23s —— View job
Issue Triage
Analysis
Type: Feature Request — new CLI command group to surface existing cloud API endpoints
Priority: Medium — the cloud API already supports shares; this is a CLI convenience gap, not a blocker
Component: CLI / Cloud
Complexity: Medium — the implementation pattern is well-established (
snapshot.pyis a near-exact template), but there are open design questions that need resolution before coding beginsDuplicates: None found.
Implementation Notes
The
snapshot.py/workspace.pycommands are the right template. The pattern is:src/basic_memory/cli/commands/cloud/shares.pywith ashares_app = typer.Typer(...)create,list,revoke(and optionallydisable/enablevia PATCH)__init__.py:cloud_app.add_typer(shares_app, name="share")All auth, error handling, and config lookup (
ConfigManager().config.cloud_host) is already handled bymake_api_request()inapi_client.py.Open Design Questions (from the issue)
These should be resolved before implementation:
Unshare ergonomics —
bm cloud share revoke <token>reads cleanly as a subcommand of thesharegroup, consistent withbm cloud snapshot delete. Recommend this over a top-levelbm cloud unshare.Revoke vs. disable — For v1, delete-only (
DELETE /api/shares/{token}) is sufficient. A--enable/--disabletoggle (PATCH) can come later if there's demand.Note identifier — Accepting a friendly title/path and resolving it to a permalink adds complexity. For v1, requiring the exact permalink keeps scope minimal and avoids a round-trip lookup. The
listoutput can display permalinks so users can copy-paste.Suggested minimal v1 surface:
feat(cli): add bm cloud share command group (#880)
feat(cli): add bm cloud share command group (#880)