docs: update README and CLAUDE.md for install script and backup
- README: add Setup/Install section (install.py), Development Workflow (dev-restart.sh), and Backup (restic/backup.sh) sections; fix .env.example reference → .env.default - CLAUDE.md: replace stale Docker start command with install.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -98,8 +98,8 @@ Cortex_and_Inara_dev/
|
||||
## Run Commands
|
||||
|
||||
```bash
|
||||
# Start (Docker)
|
||||
docker compose up -d
|
||||
# First-time setup or update on any machine
|
||||
python3 install.py
|
||||
|
||||
# Restart service (after any Python change)
|
||||
systemctl --user restart cortex
|
||||
|
||||
44
README.md
44
README.md
@@ -46,6 +46,20 @@ with a letter or underscore; max 32 characters. Example: `scott`, `holly`, `my_a
|
||||
|
||||
---
|
||||
|
||||
## Setup / Install
|
||||
|
||||
Run `install.py` on any machine to set up or update Cortex. It is idempotent — safe to re-run.
|
||||
|
||||
```bash
|
||||
python3 install.py # install / update everything
|
||||
python3 install.py --check # status check only, no changes
|
||||
```
|
||||
|
||||
What it does: creates the Python venv, installs dependencies, writes the systemd user service,
|
||||
enables linger, starts/restarts the service, checks LLM CLI auth, and sets up the daily backup timer.
|
||||
|
||||
Config: copy `cortex/.env.default` to `cortex/.env` and fill in secrets before first run.
|
||||
|
||||
## Running Cortex
|
||||
|
||||
Cortex runs as a **systemd user service** (no sudo required).
|
||||
@@ -67,7 +81,35 @@ http://localhost:8000 (or cortex.dgrzone.com on WireGuard)
|
||||
The service starts automatically at boot via `loginctl enable-linger`.
|
||||
Service file: `~/.config/systemd/user/cortex.service`
|
||||
|
||||
Config lives in `cortex/config.py` and `cortex/.env` (not tracked — see `cortex/.env.example`).
|
||||
Config lives in `cortex/config.py` and `cortex/.env` (not tracked — see `cortex/.env.default`).
|
||||
|
||||
## Development Workflow
|
||||
|
||||
The codebase lives in `agents_sync/` and syncs to all fleet machines via Syncthing.
|
||||
Edit code on any machine; use `dev-restart.sh` to apply changes on the host running the service.
|
||||
|
||||
```bash
|
||||
./dev-restart.sh # restart service, show last 30 log lines
|
||||
./dev-restart.sh logs # tail live logs (ctrl-c to stop)
|
||||
./dev-restart.sh status # show service status only
|
||||
```
|
||||
|
||||
## Backup
|
||||
|
||||
Persona data (`home/`) is excluded from git and backed up with restic.
|
||||
`install.py` sets up a systemd timer that runs `backup.sh` daily at 03:00.
|
||||
|
||||
```bash
|
||||
./backup.sh # run a backup manually
|
||||
|
||||
# Inspect snapshots (set env vars or export them)
|
||||
RESTIC_REPOSITORY=~/backups/cortex-home-restic \
|
||||
RESTIC_PASSWORD_FILE=~/.config/cortex/restic-password \
|
||||
restic snapshots
|
||||
```
|
||||
|
||||
The restic password is generated at `~/.config/cortex/restic-password` on first install.
|
||||
Back it up separately — it is required to restore from any snapshot.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user