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 resulting share_url
bm cloud share list [--project <name>] → GET /api/shares
- Unshare → DELETE
/api/shares/{token}. Two options on the table:
bm cloud unshare <token> (dedicated command), or
bm cloud share --delete <token> (flag on the share command)
Open questions
- Unshare ergonomics: dedicated
unshare command vs. share --delete? A dedicated bm 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 (revoke and an --enable/--disable toggle), 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)
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 cloudhas 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):/api/sharesproject_name,note_permalink, optionalexpires_at)/api/shares/api/shares/{token}/api/shares/{token}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 sharesubcommand group undersrc/basic_memory/cli/commands/cloud/(newshares.py, registered withcloud_app.add_typer(..., name="share")), using the existingmake_api_request()helper +ConfigManager().config.cloud_hostpattern thatsnapshot.py/core_commands.pyalready 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/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
unsharecommand vs.share --delete? A dedicatedbm cloud share revoke <token>subcommand may read most consistently with the group style.{enabled:false}disables without deleting. Do we want both (revokeand an--enable/--disabletoggle), or is delete-only enough for v1?note_permalink+project_name. Should the CLI accept a friendlier note path/title and resolve it, or require the exact permalink?Related