Skip to content

Commit a94a717

Browse files
phernandezgroksrc
andauthored
feat(cli): add default-on auto-update system and bm update command (#643)
Signed-off-by: phernandez <paul@basicmachines.co> Signed-off-by: Drew Cain <groksrc@users.noreply.github.com> Co-authored-by: Drew Cain <groksrc@users.noreply.github.com>
1 parent 6e4bb72 commit a94a717

File tree

12 files changed

+1033
-5
lines changed

12 files changed

+1033
-5
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,36 @@ uv tool install basic-memory
7575

7676
You can view shared context via files in `~/basic-memory` (default directory location).
7777

78+
## Automatic Updates
79+
80+
Basic Memory includes a default-on auto-update flow for CLI installs.
81+
82+
- **Auto-install supported:** `uv tool` and Homebrew installs
83+
- **Default check interval:** every 24 hours (`86400` seconds)
84+
- **MCP-safe behavior:** update checks run silently in `basic-memory mcp` mode
85+
- **`uvx` behavior:** skipped (runtime is ephemeral and managed by `uvx`)
86+
87+
Manual update commands:
88+
89+
```bash
90+
# Check now and install if supported
91+
bm update
92+
93+
# Check only, do not install
94+
bm update --check
95+
```
96+
97+
Config options in `~/.basic-memory/config.json`:
98+
99+
```json
100+
{
101+
"auto_update": true,
102+
"update_check_interval": 86400
103+
}
104+
```
105+
106+
To disable automatic updates, set `"auto_update": false`.
107+
78108
## Why Basic Memory?
79109

80110
Most LLM interactions are ephemeral - you ask a question, get an answer, and everything is forgotten. Each conversation

llms-install.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ Or for a one-time sync:
5454
basic-memory sync
5555
```
5656

57+
### 4. Updating Basic Memory
58+
59+
Basic Memory supports automatic updates by default for `uv tool` and Homebrew installs.
60+
61+
For manual checks and upgrades:
62+
63+
```bash
64+
# Check now and install if supported
65+
bm update
66+
67+
# Check only, do not install
68+
bm update --check
69+
```
70+
71+
To disable automatic updates, set `"auto_update": false` in `~/.basic-memory/config.json`.
72+
5773
## Configuration Options
5874

5975
### Custom Directory
@@ -125,4 +141,4 @@ If you encounter issues:
125141
cat ~/.basic-memory/basic-memory.log
126142
```
127143

128-
For more detailed information, refer to the [full documentation](https://memory.basicmachines.co/).
144+
For more detailed information, refer to the [full documentation](https://docs.basicmemory.com/).

src/basic_memory/cli/app.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import typer # noqa: E402
1010

11+
from basic_memory.cli.auto_update import maybe_run_periodic_auto_update # noqa: E402
1112
from basic_memory.cli.container import CliContainer, set_container # noqa: E402
1213
from basic_memory.cli.promo import maybe_show_cloud_promo, maybe_show_init_line # noqa: E402
1314
from basic_memory.config import init_cli_logging # noqa: E402
@@ -52,10 +53,14 @@ def app_callback(
5253
# Outcome: one-time plain line printed before the subcommand runs.
5354
maybe_show_init_line(ctx.invoked_subcommand)
5455

55-
# Trigger: register promo as a post-command callback.
56-
# Why: promo output should appear after the command's own output, not before.
57-
# Outcome: promo panel renders below the command results (status tree, table, etc.).
58-
ctx.call_on_close(lambda: maybe_show_cloud_promo(ctx.invoked_subcommand))
56+
# Trigger: register post-command messaging callbacks.
57+
# Why: informational/promo/update output belongs below command results.
58+
# Outcome: command output remains primary, with optional follow-up notices afterwards.
59+
def _post_command_messages() -> None:
60+
maybe_show_cloud_promo(ctx.invoked_subcommand)
61+
maybe_run_periodic_auto_update(ctx.invoked_subcommand)
62+
63+
ctx.call_on_close(_post_command_messages)
5964

6065
# Run initialization for commands that don't use the API
6166
# Skip for 'mcp' command - it has its own lifespan that handles initialization
@@ -70,6 +75,7 @@ def app_callback(
7075
"tool",
7176
"reset",
7277
"reindex",
78+
"update",
7379
"watch",
7480
}
7581
if (

0 commit comments

Comments
 (0)