Daisy SDK CLI for auth and image fetch
Project description
daisy-sdk
Quickstart (for Daisy users)
- Prereqs: Docker running; Python 3.11+.
- Install CLI:
pip install daisy-sdk - Enable
host.docker.internal(required by the app in the container):- macOS/Linux:
sudo sh -c "echo '127.0.0.1 host.docker.internal' >> /etc/hosts" - Windows (Admin PowerShell):
Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value "rn127.0.0.1 host.docker.internal"
- macOS/Linux:
- Run Daisy:
daisy run(UI at http://localhost:8080, control at http://127.0.0.1:3282). - Stop Daisy:
daisy stop(or Ctrl+C if in foreground).
Contributing
Setup
mise install
uv sync --dev
If uv is not installed, you can install it with mise or pipx:
# with mise
mise use -g uv@0.2
# or with pipx
pipx install uv
Usage (dev)
PYTHONPATH=src uv run python -m daisy_sdk.cli run
Tokens must be stored in ~/.daisy/config.toml:
access_token = "..."
refresh_token = "..."
On each run, the CLI validates the access token with Supabase; if it is invalid or expired, it refreshes and writes the new tokens back to the same file.
Control server and hot restarts
daisy run now launches a lightweight control server (default bind 0.0.0.0:3282, reachable at http://127.0.0.1:3282 on the host) and starts the Daisy Docker container in the background (container name daisy-local by default). The Daisy image expects to reach the host API at http://host.docker.internal:3282/; changing the port requires rebuilding the main image with a new VITE_HOST_API_BASE.
- Health:
GET /healthreturns container status and the active image tag. - Restart with updated mounts:
POST /restart(body:{"project_path": "/path/just/added"}) restarts the container after re-reading~/.daisy/projects.tomland broadcasts a refresh event to connected clients. - Events:
GET /eventsstreams server-sent events; refresh events includeactiveProjectwhen provided in the restart request.
Flags:
--porthost port for the Daisy UI (default8080).--control-hostto choose how the CLI talks to the control server (default127.0.0.1);--control-bindto choose what the server binds to (default0.0.0.0);--control-portdefaults to3282and should stay in sync withVITE_HOST_API_BASE.--platformto override the docker platform; leave unset to use Docker's default for the host.--project-config-pathto point at a non-defaultprojects.toml.- If a Daisy container with the default name is already running,
daisy runwill just point you to the mapped port instead of restarting it. --imagelets you force a specific local image tag; no pull will be attempted (docker run uses--pull=never).- Advanced: run the control server directly via
python -m daisy_sdk.server --image <tag> [--detach]; it now uses FastAPI + uvicorn. Default keeps it foreground (stops the container when terminated).daisy runalso defaults to foreground; pass--detach-controlto background it. In foreground mode,Ctrl+Cstops both server and container.
Host control API (used by the frontend inside the container, via host.docker.internal:3282):
POST /projectswith{"name": "...", "path": "/abs/path", "bi_paths": [...]}registers/updates a project, validates the host path, writesprojects.toml, and restarts the container with new mounts.PATCH /projects/{name}updates an existing project entry with the same validation/restart behavior.POST /restartforces a restart and emits a refresh event;GET /eventsstreams refresh events;GET /healthreports status.- Container logs are forwarded to stdout with prefix
[daisy-container]while the control server is running. - CORS: control server responds with
Access-Control-Allow-Origin: *and handlesOPTIONSso the web app athttp://localhost:8080can reach it.
Stopping:
daisy stopsends/shutdownto the control server and also force-removes the container (docker rm -f daisy-localby default).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daisy_sdk-0.2.0.tar.gz.
File metadata
- Download URL: daisy_sdk-0.2.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10ecbd6bb2219e8eacce3417229724a8eea255be0ec9db09c6d923eafecf337
|
|
| MD5 |
c0e9c59216d1ba1fda983756d34df4f1
|
|
| BLAKE2b-256 |
b8f3a9436a8cad7aecaecd87124e2475880bb0c73c3ba4c49822b76886ad5d53
|
File details
Details for the file daisy_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: daisy_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd678742c9804e52e4f754485a88c871d42fd650bb25386cd82b49b034471638
|
|
| MD5 |
deb54b48241c5cd5d3ebe5762b2cc1d7
|
|
| BLAKE2b-256 |
34f4dfafcc2d5f335de9d71d4f117ee5bb83274bb886cabb94e2ca17d1d0a5e4
|