Skip to content

New for...in loops in kitflows#35

Open
javisperez wants to merge 6 commits intomainfrom
new-for-loops-in-kitflows
Open

New for...in loops in kitflows#35
javisperez wants to merge 6 commits intomainfrom
new-for-loops-in-kitflows

Conversation

@javisperez
Copy link
Copy Markdown
Collaborator

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

    • Added a new docs/kitflow/cli.md file 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

    • Added docs/kitflow/commands-kit.md with detailed reference for all kit.* commands (pull, push, pack, unpack, tag, diff, remove, init, info, inspect, login, logout), including YAML syntax, parameter tables, and security notes.
  • Filesystem Command Reference

    • Added docs/kitflow/commands-filesystem.md covering built-in filesystem operations (mkdir, write, copy, move, read, echo), with clear examples and parameter descriptions.
  • Control Flow Features

    • Added docs/kitflow/commands-control-flow.md documenting conditional step execution with when and looping with for, including evaluation rules, variable scoping, and usage patterns.

javisperez added 3 commits May 5, 2026 16:33
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for step handling; updated kit parameter parsing/flag formatting to match kitops-ts parameter names and CLI expectations.
  • Updated bundled kitflows/*.yaml templates 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.

Comment thread src/stores/kitStore.ts
Comment thread src/stores/kitStore.ts
Comment thread src/components/modals/ConfirmModal.vue
Comment thread docs/kitflow/getting-started.md Outdated
Comment thread docs/kitflow/technical.md Outdated
Comment thread src/lib/kitflow-validator.ts Outdated
Comment thread src/composables/useKitFlow.ts Outdated
Signed-off-by: Javis Pérez <javis@jozu.com>
Comment thread docs/kitflow/cli.md
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These documentation files (all the .md) were 100% Claude generated

javisperez added 2 commits May 8, 2026 11:25
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants