BlogsShopifyShopify CLI Rewrite and Modernization

Shopify CLI Rewrite and Modernization

Shopify CLI Rewrite and Modernization

1
posts
2023

This feature thread tracks the evolution of the Shopify CLI, from its Ruby origins to a modern Node.js-based application. Initial efforts focused on unifying theme and app development tools into a single Ruby CLI. The rewrite to Node.js was driven by a desire for fewer system requirements, improved developer experience, and better alignment with web technologies. Key developments include establishing a consistent foundation with shared NPM packages, ensuring cross-OS compatibility through dedicated modules and comprehensive testing, migrating to a monorepo for atomic contributions, and embracing functional programming principles to enhance code reasoning and testability. Future work aims to fully remove the Ruby dependency for theme developers.

2023

From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience - Shopify

1/10/2023

This post details the complete rewrite of the Shopify CLI from Ruby to Node.js (TypeScript). It explains the rationale behind the decision, including reducing system requirements, improving developer experience, and aligning with web technologies. Key technical decisions and principles are highlighted: establishing a consistent foundation via the `@shopify/cli-kit` NPM package, ensuring cross-OS support through dedicated modules and CI testing, migrating to a monorepo (`shopify/cli`) for atomic contributions, and adopting functional programming paradigms to minimize side effects and improve code reasoning. The post also touches upon UI patterns using Ink and conventions for consistency.