-
Notifications
You must be signed in to change notification settings - Fork 0
Install and Update
A tool that is hard to install never gets adopted, and a tool that silently goes stale loses the trust that made it useful. Both the first install and every update are designed to be one command, with the surprising-failure modes engineered out.
curl -fsSL https://cdn.jsdelivr.net/npm/dreamcontext/install.sh | shinstall.sh ships inside the npm tarball and is served through the jsdelivr CDN. That detail matters: the CDN serves the published package, so the installer works even when the source repo is private — no GitHub access, no auth, no clone. The script is deliberately conservative:
-
POSIX
sh, not bash — runs on the default shell everywhere. - Node ≥ 18 gate. Checks the version up front and exits with a clear message rather than failing halfway.
-
No
sudo, noeval, no nested remote pipe. Nothing in the script escalates privileges or pipes a second remote payload into a shell. You can read the whole thing before running it. - Idempotent and non-TTY safe. Re-running it is harmless, and it works in CI or any non-interactive shell.
-
Install-or-update by detection. If
_dream_context/already exists, the script updates in place; otherwise it does a fresh install. The same one-liner is both your install and your upgrade path.
There are two distinct artifacts, and conflating them is the usual source of "I updated but nothing changed":
-
The CLI binary — installed globally via npm.
dreamcontext upgraderunsnpm install -g dreamcontext@latest.dreamcontext upgrade --checkprintscurrent: X latest: Yand exits without installing. -
The project's installed files — the skill, agents, and hooks copied into
.claude/or.agents/at install time. These are per-project snapshots; upgrading the global CLI does not retroactively rewrite them.dreamcontext updaterefreshes them to match the newly-installed CLI, preserving your own non-managed content.
So a full update is dreamcontext upgrade (get the new CLI) followed by dreamcontext update (propagate it into this project) — or just re-run the curl … | sh one-liner, which does both.
The hard constraint: tell the user about a new version without ever slowing session start. Session start is the hot path — it runs on every single session, and the whole point of dreamcontext is that the agent wakes up instantly with context already loaded. A blocking network call there would defeat the product.
The design separates the two concerns:
-
The SessionStart snapshot reads a cached result only.
buildNudge()looks at_dream_context/state/.version-check.jsonand, if a newer version is recorded, prepends a single-line nudge to the agent's context. It never makes a network call. If there is no cache, there is no nudge — session start is never blocked or slowed. -
The actual npm lookup runs off the hot path. The single network call fires from the
UserPromptSubmithook, at most once every 24 hours, and writes the result to the cache for the snapshot to read next time. It is wrapped in try/catch and fails silent — if npm is unreachable, nothing breaks and no error surfaces. -
Fully opt-out. Set
DREAMCONTEXT_VERSION_CHECK=0and no check ever runs.
One related fix shipped alongside this: the CLI version string used to be hardcoded (.version('0.1.0')), which drifted from package.json. It now reads from the manifest via dreamcontextVersion(), so --version, the nudge comparison, and the published package can never disagree.
- Why It Exists
- The Problem in Depth
- The Architecture
- The Hook Mechanism
- The Sleep Cycle
- Neuroscience-Inspired Memory
- The Dashboard
- Project task overrides
- Council Debates
- Memory Recall (BM25 over the curated corpus)
- Lab (Insights)
- Automations
- Federation
- Brain Cloud Sync
- Linked Repos
- Obsidian Integration
- CLI Design
- Install & Update
- The Desktop App
- Design Tradeoffs
- What Comes Next