Script Forge
Converts visual workflows into zero-dependency Bash and PowerShell scripts. No runtime required — contributors run native shell scripts.
Architecture
The converter is a pure function: read a workflow index, walk each project and environment, and return a list of {path, content} tuples. The Tauri backend handles actual file I/O.
src/converter/
index.ts # Entry: reads index, walks projects/envs, returns files
bash.ts # Recursive tree walker -> state-machine Bash dispatch
powershell.ts # Same -> PowerShell dispatch
orchestrator.ts # .project-igniter/setup.sh (flag parsing, drift, routing)
utils.ts # Variable interpolation, escaping, sanitization
steps/ # Per-step-type converters
information.ts
input.ts
choice.ts
command.ts
check.ts
condition.ts
file.ts
flow.ts
osBranch.tsGenerated File Structure
For each project-environment pair, the Forge generates a Bash and PowerShell script. Three layers of scripts work together:
<project-root>/
setup.sh # Root wrapper (Bash) — run this
setup.ps1 # Root wrapper (PowerShell)
.project-igniter/
workflows.json # Index (schema, projects, environments)
workflows/ # Individual workflow JSON files
setup.sh # Orchestrator (Bash)
setup.ps1 # Orchestrator (PowerShell)
scripts/
<project>/
<env>/
setup.sh # Environment script (Bash)
setup.ps1 # Environment script (PowerShell)No chmod +x needed — the chain uses exec bash (Bash) and & (PowerShell) throughout.
project root
Thin entry point that contributors run directly. Delegates to `.project-igniter/setup.sh`.
.project-igniter/
Locates the .project-igniter directory, maps cwd to the correct project key, parses CLI flags, manages state (schema, drift detection, reset), then routes to the per-environment script.
.project-igniter/scripts/<project>/<env>/
The actual setup workflow compiled into a state-machine shell script. Uses a NEXT variable and while loop to dispatch through step entries by ID.
State Machine Dispatch
Every generated environment script uses a state machine pattern. A NEXTvariable tracks the current step. A while loop dispatches to the matching case branch, which executes the step logic then sets NEXTto the next step ID.
# State machine pattern
NEXT="{first-step-id}"
while [ -n "$NEXT" ]; do
case "$NEXT" in
{step-id})
# step logic
NEXT="{next-step-id}"
;;
esac
doneBranching steps (check, condition, command, file, osBranch) each contain nested sub-workflows. The tree walker recursively generates case entries for every step in every branch.
Drift Detection
Every time scripts are regenerated, the schema version in workflows.jsonis incremented. The orchestrator compares this against the stored schema in the user's state directory (~/.local/share/project-igniter/<project>/<env>/meta). If they differ, an info message is printed and the stored schema is auto-updated — no user action required.
State Persistence
User inputs are persisted as flat files under a human-readable path:
~/.local/share/project-igniter/
frontend/
prod/
meta # SCHEMA=5, LAST_RUN=2026-06-23
NODE_VERSION # 20
DB_PASSWORD # secret123The path is <project-key>/<env> with non-alphanumeric characters replaced by underscores. Consistent between orchestrator and per-env scripts — both derive project and env from their path.
Input Sanitization
User-provided values (defaultValue, prompt, content, title, step.value, search/replace patterns) are escaped in generated scripts to prevent code injection. Bash: double quotes, backslashes,$, and backticks are escaped. PowerShell: single quotes are doubled. Sed patterns use | delimiter.
Contributor Commands
Linux / macOS
Windows (PowerShell)
Flags
| Flag | Description |
|---|---|
| (no flags) | Runs the default environment (dev) setup. |
| --env <name> | Target a specific environment (e.g. --env staging). |
| --reset | Clear all saved configuration for this project/env. |
| --status | Show current config — project, env, schema, last run, stored values. |
| --help | Print usage information. |