Ben Toms
Technical Lead — Solution Architect
Sixteen years in web engineering. Technical Lead at fusefabric, a Shopify Platinum Partner — I design the systems, steer the projects and lead the teams, and still build the quiet tooling that keeps it all fast and maintainable.
Shopify architect, mentor, builder.
01 — Work
Selected
work
By day I lead enterprise Shopify builds at fusefabric — solution design, architecture and delivery for fashion and lifestyle brands. Before that I led front-end engineering at MISSOMA and Dr. Martens, and agency teams in London.
Outside client work I build developer tools: Shopify theme asset compressors, Node CLI and config libraries, AI agent skills, and the occasional game.
Brands I've built for
- MISSOMA
- Topshop
- Dr. Martens
- Samsung
- Spotify
- Tesco
- Cafédirect
- ExxonMobil
- Hitachi
- London Real
Node.js
CLI Geniev2.0.0MIT
Easily create interactive command-line interfaces (CLIs) with a genie-style interface
$ npm i cli-genie- Last 30 days
- 264 downloads
- Published
- 3 Nov 2026
- Unpacked
- 175.2 KB
- Commands
- cli-genie
- Dependencies
- 1
- 
- # CLI Genie
- [](https://www.npmjs.com/package/cli-genie)
- [](https://github.com/bentoms-dev/cli-genie/actions/workflows/ci.yml)
- [](./LICENSE)
- Build guided, genie-style command-line wizards in a few lines. CLI Genie wraps
- [Inquirer](https://github.com/SBoudrias/Inquirer.js) with what most wizards need:
- - 🧞 10 prompt types: text, password, number, confirm, select, rawlist, checkbox, expand, search, editor
- - 🔀 Conditional and dynamic steps: when, message, default and choices can depend on earlier answers
- - 📋 Review screen where users can check and change any answer before finishing
- - 🤖 Non-interactive mode for CI and scripts: answers from flags, env vars or code, with type coercion and validation
- - 🪝 Hooks: transform, onAnswer, onComplete, onCancel
- - 📄 JSON wizards and a cli-genie command, so no code is needed
- - 🎨 Genie theme, progress counter, clean Ctrl+C handling
- - 🟦 Written in TypeScript, ships ESM + CommonJS with type definitions
- Requires Node.js 22.13+ or 24+.
- ## Installation
- ```bash
- npm install cli-genie
- ```
- ## Quick start
- ```js
- import { CliGenie, confirm, select, text } from 'cli-genie';
- // or: const { CliGenie, confirm, select, text } = require('cli-genie');
- const genie = new CliGenie({
- title: 'Welcome to CLI Genie',
- summary: true,
- steps: [
- text({ name: 'name', message: 'What is your name?', required: true }),
- confirm({ name: 'chooseColor', message: 'Do you want to choose a colour?' }),
- select({
- name: 'color',
- message: (answers) => `Pick a colour, ${answers.name}:`,
- choices: ['Red', 'Green', 'Blue'],
- when: (answers) => answers.chooseColor,
- }),
- ],
- });
- const answers = await genie.run();
- // { name: 'Ben', chooseColor: true, color: 'Green' }
- ```
- There are more examples in [examples/](./examples).
- ## Steps
- Each step builder takes the matching [Inquirer prompt options](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/prompts#prompts)
- plus these CLI Genie options:
- | Option | Type | Description |
- | ----------- | ------------------------------------ | ------------------------------------------------------------ |
- | `name` | `string` | **Required.** Key the answer is stored under. |
- | `message` | `string \| (answers) => string` | **Required.** The question. |
- | `default` | `value \| (answers) => value` | Default answer (also used in non-interactive mode). |
- | `when` | `(answers) => boolean` | Only ask when this returns `true`. |
- | `validate` | `(value, answers) => true \| string` | Return `true` or an error message. Receives earlier answers. |
- | `transform` | `(value, answers) => any` | Change the answer before it is stored. |
- | `label` | `string` | Label for the review screen (defaults to the message). |
- | `theme` | `object` | Per-step Inquirer theme overrides. |
- | Builder | Answer type | Notes |
- | ------------ | ----------- | ------------------------------------------------------------------------ |
- | `text()` | `string` | `required: true` rejects empty input. |
- | `password()` | `string` | `mask: true` shows `*` characters. |
- | `number()` | `number` | `min`, `max`, `step`. |
- | `confirm()` | `boolean` | |
- | `select()` | choice | `choices` may be a function of the answers. Supports `Separator`. |
- | `rawlist()` | choice | Numbered list. |
- | `checkbox()` | `array` | `default` is the list of pre-checked values. `validate` gets the values. |
- | `expand()` | choice | Choices have a `key`; `default` is a key. |
- | `search()` | choice | `source(term, { signal, answers })` returns choices. |
- | `editor()` | `string` | Opens `$EDITOR`. |
- ## Options
- ```ts
- new CliGenie({
- steps, // Step[]
- title, // banner shown before the first question
- progress: true, // show "(2/5)" before each question
- summary: false, // true | { title?, allowEdit?, format?(value, step) }
- theme: 'genie', // 'genie' | 'plain' | custom Inquirer theme object
- initialAnswers: {}, // pre-filled answers; matching steps are skipped
- interactive: 'auto', // true | false | 'auto' (prompt only when stdin is a TTY)
- hooks: { onAnswer, onComplete, onCancel },
- context: { input, output, signal }, // passed to every prompt
- });
- ```
- ### Review screen
- With summary: true, the genie lists every answer at the end. The user can confirm,
- change any answer or start over. When an answer changes, steps that depend on it
- are asked or removed automatically.
- ### Non-interactive mode and pre-filled answers
- ```js
- import { CliGenie, fromArgv, fromEnv } from 'cli-genie';
- const genie = new CliGenie({
- steps,
- // `--first-name=Ben`, `--no-git`, `GENIE_FIRST_NAME=Ben` all match a step named `firstName`
- initialAnswers: { ...fromEnv('GENIE_'), ...fromArgv() },
- });
- ```
- Supplied answers are converted to the step's type ("42" → 42, "yes" → true,
- "a,b" → ['a', 'b'], and a choice's name or value → its value) and then validated.
- When there's no TTY (CI, piped input) or interactive: false is set, any step without
- a supplied answer uses its default. If it has no default, a MissingAnswerError is thrown.
- ### Cancelling
- Pressing Ctrl+C (or aborting context.signal) rejects run() with a GenieCancelledError
- that contains the answers collected so far:
- ```js
- import { isCancelled } from 'cli-genie';
- try {
- await genie.run();
- } catch (error) {
- if (isCancelled(error)) process.exit(130);
- throw error;
- }
- ```
- Other errors: MissingAnswerError and InvalidAnswerError, both subclasses of GenieError.
- ### TypeScript
- ```ts
- interface Order {
- size: 'small' | 'large';
- extras: string[];
- }
- const order = await genie.run<Order>();
- ```
- ## JSON wizards and the `cli-genie` command
- Define a wizard as JSON. Functions are replaced by declarative options:
- ```json
- {
- "title": "Pizza order",
- "summary": true,
- "steps": [
- {
- "type": "text",
- "name": "email",
- "message": "Email",
- "pattern": "@",
- "patternMessage": "Invalid email"
- },
- { "type": "select", "name": "size", "message": "Size", "choices": ["small", "large"] },
- { "type": "confirm", "name": "delivery", "message": "Delivery?" },
- { "type": "text", "name": "address", "message": "Address", "when": { "delivery": true } }
- ]
- }
- ```
- when matches when every listed answer is equal; an array value means "any of".
- search steps aren't available in JSON because they need a function.
- Run it from code with await loadWizard('wizard.json') or defineWizard(object), or from the shell:
- ```bash
- npx cli-genie wizard.json # prompts on stderr, answers as JSON on stdout
- npx cli-genie wizard.json --size=large # pre-fill answers
- npx cli-genie wizard.json --non-interactive # never prompt (CI)
- ORDER=$(npx cli-genie wizard.json) # capture the answers
- ```
- ## Migrating from v1
- v1 code still works, with deprecation warnings in your editor:
- ```js
- const { CliGenie, textInputPrompt, listPrompt } = require('cli-genie');
- new CliGenie([textInputPrompt('Name?', 'name'), listPrompt('Colour?', 'color', ['Red'])]).run();
- ```
- Breaking changes in 2.0:
- - Node.js 22.13+ is required.
- - run() resolves with the answers and no longer prints them.
- - Errors are thrown (as GenieError subclasses) instead of being logged with process.exitCode = 1.
- - when now receives the earlier answers. In v1 it always received {}, so conditional questions never appeared.
- - styling is merged into the Inquirer theme. promptLibrary is ignored.
- ## Contributing
- See [CONTRIBUTING.md](./CONTRIBUTING.md).
- ## License
- MIT, see [LICENSE](./LICENSE).
02 — About
Part architect.Part problem-solver.Part mentor.
I've spent over sixteen years in web development and now work as a Technical Lead and eCommerce architect at fusefabric, a Shopify Platinum Partner — designing solutions, steering projects and leading teams to deliver work we can all be proud of.
When I get hands-on, it's usually Node-based tools, apps and backend processes, often for Shopify stores: the things that quietly power the front end and make a real difference to performance, maintainability and developer experience.
Working with
- Shopify Plus / Liquid
- Hydrogen & headless
- Node.js
- JavaScript / TypeScript
- React / Next.js
- Vue
- PostgreSQL
- WebGL
- Years in the industry
- 16+
- Projects
- 50+
- Teams led
- 6
- Users reached
- 1M+
03 — AI agent skills
Teach your
agent
- shopify-theme-architect4.6 KB
- shopify-app-builder3.7 KB
- shopify-headless-hydrogen3.1 KB
- shopify-performance-auditor2.8 KB
- nextjs-react-engineer3.2 KB
- web-accessibility-auditor2.5 KB
- technical-seo-engineer3.3 KB
- react-native-expo-engineer2.6 KB
- node-cli-toolsmith2.9 KB
- secure-api-engineer3.1 KB
- postgres-migrations-engineer4.8 KB
- ai-feature-engineer4.7 KB
- debugging-detective4.9 KB
- test-engineer4.1 KB
- legacy-refactoring-surgeon4.3 KB
- typescript-migration-engineer3.9 KB
- github-actions-cicd-engineer4.5 KB
- tech-lead-code-reviewer2.6 KB
- docs-readme-writer4.1 KB
Shopify
Shopify Theme Architect
Build and review Online Store 2.0 themes: Liquid sections, theme blocks, settings, performance and accessibility.
- ---
- name: shopify-theme-architect
- description: Build, refactor and review Shopify Online Store 2.0 themes. Use when creating or editing Liquid sections, blocks, snippets, templates, theme settings, locales, or theme CSS/JS, and when reviewing a theme for performance, accessibility or merchant editability.
- ---
- # Shopify Theme Architect
- You are a senior Shopify theme engineer. You build Online Store 2.0 themes that are fast, accessible and easy for merchants to customise in the theme editor.
- ## Before writing code
- 1. Inspect the theme structure: layout/, templates/ (JSON), sections/, blocks/, snippets/, assets/, config/, locales/.
- 2. Find an existing section or snippet that solves a similar problem and follow its conventions (naming, CSS approach, JS pattern).
- 3. Confirm which templates the change affects and whether it must work in the theme editor (it almost always must).
- ## Liquid rules
- - Use {% render 'snippet', var: value %}. Never use the deprecated {% include %}.
- - Every section and theme block has a valid {% schema %} with name, settings, and presets where it should be addable in the editor.
- - Prefer theme blocks (blocks/ folder) and {% content_for 'blocks' %} for composable layouts on themes that support them.
- - Output images with image_url + image_tag, always passing widths, sizes and a meaningful alt. Never hard-code CDN URLs.
- - Use {{ 'key' | t }} for every customer-facing string and add keys to locales/en.default.json. Schema labels go in *.schema.json locale files.
- - Escape untrusted output (| escape) when building attributes from merchant or customer input.
- - Keep {{ content_for_header }} and {{ content_for_layout }} in layout/theme.liquid.
- - Avoid expensive loops: do not iterate collections or all_products; paginate with {% paginate %} and keep limits small.
- ## Settings design
- - Expose only settings a merchant will genuinely change. Use sensible defaults so a newly added section looks finished.
- - Use the right input type: image_picker, video, collection, product, richtext, inline_richtext, color_scheme, range with min/max/step/unit.
- - Use visible_if to hide irrelevant settings instead of explaining them in info text.
- - Add {{ block.shopify_attributes }} to block wrappers so the editor can select them.
- ## CSS
- - Scope styles to the section (#shopify-section-{{ section.id }} or a section-specific class) to prevent leaks.
- - Mobile-first, using the theme's existing custom properties for spacing, colour schemes and typography.
- - Use {% stylesheet %} for small section CSS or a dedicated asset loaded only where needed. Do not load CSS globally for one section.
- ## JavaScript
- - Vanilla JS with custom elements (class Foo extends HTMLElement). No jQuery.
- - Load with defer or type="module". Never block rendering.
- - Re-initialise correctly in the editor: listen for shopify:section:load, shopify:section:unload, shopify:block:select.
- - Use the Section Rendering API (?sections= or ?section_id=) to refresh HTML after cart or filter changes instead of rebuilding markup in JS.
- - Use the Cart AJAX API (/cart/add.js, /cart/change.js, /cart.js) with routes.* URLs for locale-aware paths.
- ## Performance checklist
- - The LCP image is not lazy-loaded and uses fetchpriority="high"; everything below the fold uses loading="lazy".
- - No render-blocking third-party scripts in <head>. App embeds load only where used.
- - Fonts use font_url + font-display: swap and are preloaded only when above the fold.
- - Minify and compress theme assets before deploying (for example with the shopify-compressor npm package).
- - Run shopify theme check and fix every error before handing off.
- ## Accessibility checklist
- - Semantic landmarks, one <h1> per page, logical heading order.
- - All interactive elements are reachable and operable by keyboard with a visible focus style.
- - Drawers and modals trap focus, close on Escape and return focus to the trigger.
- - Colour contrast meets WCAG 2.2 AA in every colour scheme.
- - Announce cart updates with an aria-live region.
- ## Workflow
- 1. shopify theme dev --store <store> to preview locally.
- 2. Make the change, keeping diffs small and following existing patterns.
- 3. Test in the theme editor: add, reorder, remove the section/blocks; change every setting.
- 4. Test mobile, keyboard-only, and with a screen reader for interactive components.
- 5. shopify theme check, then push to an unpublished theme for review.
- ## Output
- When you finish, summarise: files changed, new settings added (with defaults), translation keys added, and anything the merchant must configure.
04 — Contact
Get in
touch
For Shopify builds, technical leadership, collaborations, or just to talk shop.