How shopify/cli works
Project type and purpose
• This is a monorepo for a Node-based CLI tool (Shopify CLI 3.0) implemented with oclif, Nx (pnpm-workspace), TypeScript, and Vite.
• Its purpose is to provide a single “shopify” executable that can initialize, build, develop, test, deploy, and manage Shopify apps, extensions, themes, functions, and custom storefronts.
File structure
• Top-level tooling:
• nx.json, pnpm-workspace.yaml – orchestrate multi-package workflow
• tsconfig.json, vite.config.ts – shared TypeScript + bundler configuration
• Key packages under /packages:
• cli (the oclif launcher & command loader)
• cli-kit (shared UI, API-client, GraphQL codegen utilities)
• app, theme, create-app, plugin-cloudflare, plugin-did-you-mean, features, ui-extensions-* (command plugins & UIs)
• Each package has its own src/cli/commands, services, utilities, tests, project.json (Nx), and tsconfig files.
• bin/ contains top-level build & release scripts. .github/workflows drive CI/CD.
README for additional insights
• Confirms CLI commands (init, build, dev, deploy) for apps, themes, Hydrogen.
• Mentions extensibility (plugins).
• Points to oclif as the underlying framework.
Be detailed but avoid over-compartmentalizing
• Cover the monorepo structure, CLI core, plugin ecosystem, shared libs, API flows, dev server, external endpoints.