Skip to content

Commit 2f1ce1b

Browse files
committed
improve docs and make flush
1 parent b39cf09 commit 2f1ce1b

7 files changed

Lines changed: 160 additions & 4 deletions

File tree

CLAUDE.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Minds Platform
2+
3+
## Submodules
4+
5+
This repo has 4 submodules:
6+
7+
| Path | Repo | Tracking |
8+
|---|---|---|
9+
| `frontend` | `mindsdb/cowork` | tag-pinned |
10+
| `backend/core_api` | `mindsdb/cowork-server` | tag-pinned |
11+
| `backend/core_agent` | `mindsdb/anton` | tag-pinned |
12+
| `backend/data-vault` | `mindsdb/data-vault` | `main` branch |
13+
14+
### Clone (fresh)
15+
16+
```bash
17+
git clone --recurse-submodules https://github.com/mindsdb/minds-platform
18+
```
19+
20+
### Initialize after cloning without submodules
21+
22+
```bash
23+
git submodule update --init --recursive
24+
```
25+
26+
### Pull — sync to what the parent repo pins (default)
27+
28+
```bash
29+
git submodule update --recursive
30+
```
31+
32+
### Pull — advance all submodules to latest `main`
33+
34+
Only do this if you intend to develop across all repos. You'll need to commit the updated pointers in the parent repo afterward.
35+
36+
```bash
37+
git submodule foreach 'git checkout main && git pull origin main'
38+
```
39+
40+
### Make changes and push inside a submodule
41+
42+
1. Go into the submodule and get on a real branch first (all submodules start in detached HEAD):
43+
44+
```bash
45+
cd backend/data-vault # or whichever submodule
46+
git checkout main # or: git checkout -b your-feature-branch
47+
```
48+
49+
2. Make your changes, commit, and push:
50+
51+
```bash
52+
git add .
53+
git commit -m "your message"
54+
git push origin main
55+
```
56+
57+
3. Back in the parent repo, stage and commit the updated submodule pointer:
58+
59+
```bash
60+
cd ../..
61+
git add backend/data-vault
62+
git commit -m "bump data-vault to latest"
63+
git push
64+
```
65+
66+
> The parent repo stores a commit SHA pointer to each submodule, not the code itself. Always push from inside the submodule first, then update the pointer in the parent.
67+
68+
## Running locally (web browser mode)
69+
70+
After initializing submodules, start the full stack with:
71+
72+
```bash
73+
cd frontend
74+
npm install
75+
npm run dev:web
76+
```
77+
78+
Open `http://localhost:5173/`. The FastAPI backend starts automatically on `http://127.0.0.1:26866`.
79+
80+
### Skip Keycloak auth (required for local dev)
81+
82+
By default the web app redirects to MindsHub SSO on first load. To bypass this locally, create `frontend/src/renderer/.env` (Vite's root is `src/renderer`, not `frontend/`):
83+
84+
```bash
85+
echo "VITE_SKIP_AUTH=true" > frontend/src/renderer/.env
86+
```
87+
88+
Then restart `npm run dev:web`. The Keycloak redirect will be skipped and the app loads the onboarding screen directly where you can enter a BYOK API key.
89+
90+
### First-time symlink fix
91+
92+
The `dev:web` script expects the `uv`-installed tool at `~/.local/share/uv/tools/anton/`, but it may be installed as `anton-agent`. If you see "Anton Python interpreter not found", run:
93+
94+
```bash
95+
ln -s ~/.local/share/uv/tools/anton-agent ~/.local/share/uv/tools/anton
96+
```
97+
98+
## Flushing local installs (fresh start)
99+
100+
`make flush` wipes every local install **and** all app state, returning the machine to a pre-install condition. Use it to test the from-scratch install flow or to recover from a broken/half-installed environment.
101+
102+
```bash
103+
make flush # prompts before deleting
104+
make flush FORCE=1 # skip the prompt (CI / scripts)
105+
```
106+
107+
It removes:
108+
109+
| Removed | What it is |
110+
|---|---|
111+
| `cowork-server` uv tool (+ legacy `anton-agent`) | the runtime the **Electron app** installs via `uv tool install` |
112+
| `backend/core_api/.venv`, `backend/core_agent/.venv` | the venvs the **Makefile** dev flow builds via `uv sync` |
113+
| `~/.anton` | provider keys / `.env` |
114+
| `~/.cowork` | database, `hermes`, `projects` |
115+
116+
> ⚠️ Destructive — deletes conversations and saved provider keys, no undo. After flushing, the next `make setup` (or app launch) reinstalls everything from scratch.
117+
118+
> It deliberately leaves `uv` itself and uv-managed Python runtimes alone (shared infrastructure, not part of the anton/cowork install).

Makefile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _NPM_STAMP := $(FRONTEND)/node_modules/.package-lock.json
66
_API_STAMP := $(API)/.venv
77
_AGENT_STAMP := $(AGENT)/.venv
88

9-
.PHONY: setup dev dev-web build dist-mac dist-win docker-build docker-up docker-down
9+
.PHONY: setup dev dev-web build dist-mac dist-win docker-build docker-up docker-down flush
1010

1111
$(_NPM_STAMP): $(FRONTEND)/package-lock.json
1212
npm --prefix $(FRONTEND) ci
@@ -50,3 +50,28 @@ docker-up:
5050

5151
docker-down:
5252
docker compose down
53+
54+
# Wipe every local install + all app state, returning the machine to a
55+
# pre-install state. Covers BOTH runtime models (the Makefile dev venvs
56+
# AND the Electron app's `uv tool install cowork-server`) plus user data.
57+
# Removes:
58+
# • cowork-server uv tool (and the legacy anton-agent tool)
59+
# • submodule venvs: $(API)/.venv, $(AGENT)/.venv
60+
# • ~/.anton — provider keys / .env
61+
# • ~/.cowork — database, hermes, projects
62+
# The next `make setup` (or app launch) reinstalls from scratch.
63+
# Set FORCE=1 to skip the confirmation prompt (CI / scripts).
64+
flush:
65+
@echo "This will PERMANENTLY remove:"
66+
@echo " • cowork-server uv tool (+ legacy anton-agent)"
67+
@echo "$(API)/.venv and $(AGENT)/.venv"
68+
@echo " • ~/.anton (provider keys / .env)"
69+
@echo " • ~/.cowork (database, hermes, projects)"
70+
@if [ "$(FORCE)" != "1" ]; then \
71+
read -p "Proceed? [y/N] " ans; [ "$$ans" = y ] || [ "$$ans" = Y ] || { echo "Aborted."; exit 1; }; \
72+
fi
73+
-uv tool uninstall cowork-server
74+
-uv tool uninstall anton-agent
75+
rm -rf $(API)/.venv $(AGENT)/.venv
76+
rm -rf $$HOME/.anton $$HOME/.cowork
77+
@echo "✓ Flushed. Run 'make setup' (or relaunch the app) for a fresh install."

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ make setup
7777
| Production build | `make build` |
7878
| Package for macOS | `make dist-mac` |
7979
| Package for Windows | `make dist-win` |
80+
| Wipe all local installs + data (fresh start) | `make flush` |
81+
82+
> **Reset to a clean slate:** `make flush` uninstalls the local runtime (the `cowork-server` uv tool and the `backend/*/.venv`s) **and** deletes app state in `~/.anton` (provider keys) and `~/.cowork` (database, hermes, projects). Use it to test the from-scratch install flow or recover from a broken install. ⚠️ This deletes your conversations and saved keys. It prompts for confirmation; pass `FORCE=1` to skip it. The next `make setup` or app launch reinstalls everything.
8083
8184
---
8285

backend/core_agent

Submodule core_agent updated 82 files

backend/core_api

Submodule core_api updated 57 files

docs/setup.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,18 @@ <h2>All make commands</h2>
546546
<tr><td><code>make docker-build</code></td><td>Build the api and web Docker images.</td></tr>
547547
<tr><td><code>make docker-up</code></td><td>Start the Docker stack (<code>docker compose up</code>).</td></tr>
548548
<tr><td><code>make docker-down</code></td><td>Stop and remove containers.</td></tr>
549+
<tr><td><code>make flush</code></td><td>Wipe all local installs + app data for a fresh start (see below).</td></tr>
549550
</tbody>
550551
</table>
552+
553+
<h2>Reset to a clean slate</h2>
554+
<p><code>make flush</code> returns the machine to a pre-install state. It uninstalls the local runtime &mdash; the <code>cowork-server</code> uv tool <em>and</em> the <code>backend/core_api/.venv</code> + <code>backend/core_agent/.venv</code> &mdash; and deletes all app state: <code>~/.anton</code> (provider keys / <code>.env</code>) and <code>~/.cowork</code> (database, hermes, projects).</p>
555+
<p>Use it to test the from-scratch install flow or to recover from a broken install. It prompts for confirmation before deleting; pass <code>FORCE=1</code> to skip the prompt in scripts/CI. The next <code>make setup</code> (or app launch) reinstalls everything.</p>
556+
<div class="note">
557+
<strong>Destructive.</strong> This permanently deletes your conversations and saved provider keys. There is no undo.
558+
</div>
559+
<pre><code>make flush # prompts before wiping
560+
make flush FORCE=1 # no prompt (CI / scripts)</code></pre>
551561
</section>
552562
</main>
553563
</div>

frontend

Submodule frontend updated 392 files

0 commit comments

Comments
 (0)