New for...in loops in kitflows#35
Open
javisperez wants to merge 6 commits intomainfrom
Open
Conversation
Add loop expansion to flatten `for`-defined steps into concrete steps so counts can be evaluated against resolved vars. Introduces expandSteps in bin/kitflow.js (runtime) and in src/composables/useKitFlow.ts (UI), evaluates `count` via interpolate, and preserves/assigns loop variables for each iteration. Runtime changes: print step counts after expansion, iterate over flatSteps, set loop var into vars before running a step, and update skip handling to use the flattened list. UI changes: buildStepStates now accepts vars and expands loops so stepStates reflect actual iterations; loadFlow resolves default and derived vars to compute initialVars for expansion; initUserVars and reset rebuild step states after vars are resolved. Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Add comprehensive KitFlow documentation (CLI reference, commands, examples, getting-started, syntax/control-flow/filesystem/shell, index) and many example kitflow templates. Update bin/kitflow.js to convert camelCase YAML flag names to kebab-case for the kit CLI, introduce KIT_POSITIONALS to map YAML param names to positional CLI args, and tighten path resolution when building kit subcommand arguments. Also include assorted updates to kitflows, package metadata, and UI/store/composable files to align with these changes. Signed-off-by: Javis Pérez <javis@jozu.com>
There was a problem hiding this comment.
Pull request overview
This PR updates KitFlow across the desktop UI and CLI runner to better support new flow semantics (notably for steps) and aligns kit.* step parameters with @kitops/kitops-ts signatures, while also adding a substantial KitFlow documentation set and updating the bundled example flows accordingly.
Changes:
- Added a full KitFlow docs section (syntax, variables, commands, CLI reference, pitfalls, technical details, examples).
- Updated KitFlow UI/runner behavior around step naming/interpolation and
forstep handling; updated kit parameter parsing/flag formatting to match kitops-ts parameter names and CLI expectations. - Updated bundled
kitflows/*.yamltemplates to use the new positional parameter names (e.g.path,directory,source) and camelCase flags (e.g.tlsVerify), plus a few small UI tweaks.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/HomeView.vue | Updates Pull button click handler invocation. |
| src/style.css | Adjusts scrollbar dimensions. |
| src/stores/kitStore.ts | Updates kitfile/manifest lookup and pull call structure; adds untagged ref handling. |
| src/lib/kitflow-validator.ts | Changes positional key validation behavior to rely on schema positionals. |
| src/composables/useKitFlow.ts | Updates initial output formatting and step state building (incl. for step labeling and name interpolation). |
| src/components/modals/DeleteModelKitConfirm.vue | Adjusts long-press duration for delete confirmation. |
| src/components/modals/ConfirmModal.vue | Changes long-press confirm behavior and mouseup handling. |
| bin/kitflow.js | Adds for step execution semantics, kit arg construction updates, and flag formatting changes. |
| package.json | Bumps tooling deps (e.g. vite, wait-on, @tailwindcss/vite) and reorders/normalizes config formatting. |
| pnpm-lock.yaml | Lockfile updates for dependency bumps. |
| kitflows/validate-and-promote.yaml | Migrates kit.* step params from legacy args/ref to kitops-ts parameter names. |
| kitflows/test-prompt-in-ollama.yaml | Migrates kit.* params; simplifies Modelfile generation steps. |
| kitflows/stamp-model-card.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/registry-sync.yaml | Migrates kit.* params; replaces legacy TLS flags with tlsVerify. |
| kitflows/push-to-kind-cluster.yaml | Migrates kit.* params and TLS flag naming. |
| kitflows/pull-for-fine-tuning.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/pull-and-inspect.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/pack-and-push.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/full-kitfile.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/experiment-snapshot.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/dataset-publish.yaml | Migrates kit.* params to kitops-ts parameter names. |
| kitflows/compare-versions.yaml | Migrates kit.diff to reference1/reference2. |
| docs/kitflow/index.md | Adds KitFlow documentation landing page and map. |
| docs/kitflow/getting-started.md | Adds getting started guide for writing/running flows. |
| docs/kitflow/syntax.md | Adds full YAML schema/syntax reference. |
| docs/kitflow/variables.md | Adds variable/interpolation/filter reference. |
| docs/kitflow/commands-kit.md | Adds detailed kit.* command reference mapped to kitops-ts signatures. |
| docs/kitflow/commands-filesystem.md | Adds filesystem command reference (mkdir, write, copy, move, read, echo). |
| docs/kitflow/commands-shell.md | Adds run command reference. |
| docs/kitflow/commands-control-flow.md | Adds when/for control flow reference. |
| docs/kitflow/examples.md | Adds annotated end-to-end examples. |
| docs/kitflow/pitfalls.md | Adds common pitfalls guide. |
| docs/kitflow/cli.md | Adds CLI reference and JSON event protocol documentation. |
| docs/kitflow/technical.md | Adds architectural/technical deep dive. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Javis Pérez <javis@jozu.com>
javisperez
commented
May 7, 2026
Collaborator
Author
There was a problem hiding this comment.
These documentation files (all the .md) were 100% Claude generated
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds comprehensive documentation for KitFlow's CLI and command syntax, greatly expanding the user-facing reference material. The new docs cover running flows from the command line, filesystem commands, kit commands, and advanced control flow features. These updates provide clear, example-driven explanations for all supported commands and options, making it much easier for users to understand and use KitFlow in both interactive and automated environments.
New Documentation:
CLI Usage and Integration
docs/kitflow/cli.mdfile detailing how to run KitFlow flows from the command line, including argument descriptions, interactive vs. JSON modes, variable handling, exit codes, and CI/CD integration examples.Kit Command Reference
docs/kitflow/commands-kit.mdwith detailed reference for allkit.*commands (pull, push, pack, unpack, tag, diff, remove, init, info, inspect, login, logout), including YAML syntax, parameter tables, and security notes.Filesystem Command Reference
docs/kitflow/commands-filesystem.mdcovering built-in filesystem operations (mkdir,write,copy,move,read,echo), with clear examples and parameter descriptions.Control Flow Features
docs/kitflow/commands-control-flow.mddocumenting conditional step execution withwhenand looping withfor, including evaluation rules, variable scoping, and usage patterns.