The project now runs on a lightweight Rust backend (Actix Web + SQLx + PostgreSQL) with a Svelte UI. The terminal autocompleter still talks to the same API surface (/api/suggest, /api/learn, etc.) but everything is backed by Rust.
- Backend: Rust, Actix Web, SQLx, PostgreSQL
- Frontend: SvelteKit, Vite
- Auth: API tokens via
Authorization: Bearer <token>header - Terminal: Zsh plugin in
autocompleter/still works against the new API
Legacy Next.js files have been parked under legacy-next/ for reference.
-
Env: copy
.env.exampleto.envand set:DATABASE_URL=postgres://USER:PASSWORD@HOST:5432/cmvaultADMIN_API_TOKEN=<strong token>(bootstraps an API token)- Frontend reads
VITE_API_URLandVITE_API_TOKENfor requests.
-
Backend (Actix):
cd backend cargo runMigrations run automatically on startup. Default bind is
0.0.0.0:8080. -
Frontend (Svelte):
cd frontend npm install npm run dev -- --hostPoint the UI at the backend via
VITE_API_URL/VITE_API_TOKEN(read from the repo root.envbecause Vite is configured withenvDir: '..').
- Migrations live in
backend/migrations/and are applied automatically when you runcargo runinbackend/. - To run them manually, install SQLx CLI and execute:
cd backend cargo install sqlx-cli --no-default-features --features native-tls,postgres sqlx migrate run
GET /health– heartbeatGET /api/commands?q=– list commands (public + your token)POST /api/commands– create command (requires token)DELETE /api/commands/:id– delete your commandPOST /api/suggest– suggestion strings for the autocompleterPOST /api/learn– log executed commandGET /api/learned– list learned snippets (paginated vialimit/offset)POST /api/learned/:id/promote– turn learned item into a saved commandPOST /api/device-codes– create a 6-digit code for pairingPOST /api/exchange-token– swap a code for an API tokenPOST /api/register– email/password signup, returns a personal API tokenPOST /api/login– email/password login, returns a fresh API token
The Zsh plugin in autocompleter/install.sh keeps working. Flow with the new auth:
- Get a token: login/register in the web UI, then create an API token (or create a 6-digit device code via the UI/API).
- Run the installer and paste the token or device code when prompted; device codes are swapped via
POST /api/exchange-token. - Suggestions:
POST /api/suggestwith your token. - Learning mode:
POST /api/learn.
MIT – see LICENSE.