Onboarding notes for anyone (human or automated agent) making changes to
comfy-cli — a Python/Typer CLI for installing
and running ComfyUI. This is a quick-start; see CONTRIBUTING.md
for the fuller development and contribution guide.
Requires Python >= 3.10 (CI targets 3.10, the minimum supported version). Install the package with its dev extras in editable mode:
pip install -e '.[dev]'This pulls in the runtime dependencies plus the dev toolchain (ruff, pytest,
pytest-cov, pre-commit, jsonschema).
Before opening a PR, run the same three checks CI enforces:
ruff check . # lint
ruff format --check . # formatting (CI runs `ruff format --diff`)
pytest # unit testsAll three must pass. Keep changes formatted with ruff format and imports sorted
(ruff's isort rules are enabled) so the format check stays green.
The repo ships a pre-commit config that runs ruff (lint
- format) and a few file hygiene hooks on every commit. Install it once so commits are auto-checked:
pre-commit installThe default branch is main — branch off main and open PRs against it.
Gotcha: a local checkout may already sit on a working branch (e.g.
agent-cli), notmain. Don't assume the current branch is the base. Create your branch (or worktree) offorigin/mainexplicitly:git fetch origin git switch -c my-feature origin/main # or, without disturbing the current checkout: git worktree add ../comfy-cli-my-feature -b my-feature origin/main
- Use
typerfor command/argument handling andrichfor console output. - New commands are registered in
comfy_cli/cmdline.py; subcommands live undercomfy_cli/command/<name>/. SeeCONTRIBUTING.mdfor the boilerplate. - End-to-end tests are disabled by default; enable them with
TEST_E2E=true pytest tests/e2e/(seedocs/TESTING-e2e.md).