Files
malkuthro-ComfyUI-Koolook/.env.example
T
malkuthroandClaude Opus 4.7 0d4c81295b chore(sync): --init flag for first-run dev-sync setup + Mac path docs (#61)
Background
----------
Setting up `scripts/sync_to_dev.py` on a fresh machine required two
pre-steps the script didn't help with: (1) editing `.env` to point at
a path that didn't exist yet, then (2) `mkdir -p` on that path before
the first sync would work. The script errored out cleanly with
"target does not exist" but didn't tell the user the obvious next
move was to create it. This was particularly silent on Mac where the
ComfyUI install path differs from the Windows examples in `.env.example`.

Changes
-------
- **`--init` flag** on `scripts/sync_to_dev.py`. When the target
  directory doesn't exist and `--init` is passed, the script creates
  it and proceeds with the sync. Without `--init`, it errors out with
  the same "first time on this machine?" hint pointing at the new flag.
- **Safety guards** on `--init`. Refuses (exit 3) if:
  - the parent directory doesn't exist, OR
  - the parent doesn't look like a ComfyUI `custom_nodes/` folder
    (heuristic: parent is named `custom_nodes` OR sits inside a
    directory named `ComfyUI`).
  This prevents a typo in `KOLOOK_COMFYUI_DEV_PATH` from quietly
  creating a `ComfyUI-Koolook/` somewhere unexpected on disk. The
  refusal message includes a manual escape hatch (`mkdir -p` + retry
  without `--init`) for the case where the parent really IS the
  ComfyUI install but doesn't match the heuristic.
- **Drop stale `k_easy_version.py`** from `RUNTIME_PATHS`. The file
  was deleted in v0.1.10 (PR #41); the script's `if not src.exists()`
  guard meant it was a no-op every run, but the entry was misleading.
- **`.env.example`** gains explicit macOS / Linux / Windows path
  examples for `KOLOOK_COMFYUI_DEV_PATH` and a 3-step first-run
  recipe (cp .env.example → edit → `--init`).
- **`docs/maintainers/dev-iteration-loop.md`** gains a "First-time
  setup on a new machine" section with the per-OS path table and the
  same 3-step recipe.

Verification
------------
- `python scripts/sync_to_dev.py --dry-run` against a missing target
  → exit 2, hint at `--init`.
- `python scripts/sync_to_dev.py --init` against a real ComfyUI
  `custom_nodes/` parent → creates the leaf, copies 9 entries, exits 0.
- `python scripts/sync_to_dev.py` (no flag) re-run after `--init` →
  re-syncs cleanly, idempotent.
- `python scripts/sync_to_dev.py --init` against `/tmp/not-custom-nodes`
  → exit 3, "parent does not exist".
- `python scripts/sync_to_dev.py --init` against an existing
  `/tmp/wrong-parent` (not custom_nodes) → exit 3, "doesn't look like
  a ComfyUI custom_nodes/ folder", manual escape hatch in the message.
- `python -c "import ast; ast.parse(open('scripts/sync_to_dev.py').read())"`
  → syntax OK.
- `python tools/preflight_release.py --skip manager-meta -v` → PASS.

No CHANGELOG entry — dev-tooling under `scripts/` doesn't ship to
users of the published package. Avoiding noise on the [Unreleased]
section that PRs #59 / #60 also touch.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 08:58:24 +02:00

51 lines
2.3 KiB
Bash

# ComfyUI-Koolook environment variables
#
# Copy this file to `.env` and fill in real paths for your machine.
# `.env` is gitignored — never commit real absolute paths to the public repo.
#
# Convention: KOLOOK_* prefix. Paths can be absolute or relative to MAIN.
# When unset, code/docs fall back to the documented portable default
# (when one exists).
# --- External forks root ----------------------------------------------------
# Where raw third-party clones live (outside MAIN). See forks/README.md.
# Default if unset: ../ComfyUI-Forks
KOLOOK_FORKS_DIR=
# --- Sibling projects -------------------------------------------------------
# Sibling projects are related repositories/folders we consult but do not
# fork or vendor. See README.md "Sibling Projects".
# ComfyUI knowledge database — sibling repository of ComfyUI references,
# workflow notes, and recipe research. Used by docs/agent skills as a
# read-only knowledge source.
# Default if unset: ../ComfyUI_knowledge___DB
KOLOOK_COMFYUI_KB_DIR=
# Personal knowledge database (Obsidian or similar) — entirely user-specific.
# Optional. Leave unset on shared/public clones; agents must treat the
# absence of this var as "no personal KB available".
# No default.
KOLOOK_PERSONAL_KB_DIR=
# --- Local dev sync ---------------------------------------------------------
# Path to the eventual Koolook subdirectory inside your live ComfyUI
# `custom_nodes/` folder, where `scripts/sync_to_dev.py` copies runtime
# files for fast local iteration (skip the publish-and-update round-trip
# for one-line fixes). Point at the leaf, NOT the parent — the parent
# `custom_nodes/` must already exist; the script can create the leaf
# itself with `--init` on first run. Leave unset to disable; the script
# errors out cleanly if invoked without it. Forward slashes work on
# Windows too. No default — entirely user-specific.
#
# Examples:
# macOS: /Volumes/Data/ComfyUI/custom_nodes/ComfyUI-Koolook
# Linux: /home/<user>/ComfyUI/custom_nodes/ComfyUI-Koolook
# Windows: C:/ComfyUI_portable/ComfyUI/custom_nodes/ComfyUI-Koolook
#
# First-run on a fresh machine:
# 1. Set the variable here.
# 2. `python scripts/sync_to_dev.py --init` (creates the leaf folder)
# 3. From then on, plain `python scripts/sync_to_dev.py` is enough.
KOLOOK_COMFYUI_DEV_PATH=