@tinloof/remix-cli
CLI for creating and updating Remix projects created by Tinloof.
Getting started
Start with npm install -g @tinloof/remix-cli@latest
to have the CLI available globally.
💡 You should re-run the install command above whenever there's a new version of the CLI.
Then, you can run tinloof-remix
from a terminal for a list of the available commands. Each action is self-documented & guided through prompts.
Architecture
We're using inquirer as the CLI library for prompting users for the input required for the different commands available.
In src/index.ts
, we start by checking what is the user's target action and running the appropriate command. Currently, the CLI has the following commands:
new
: duplicates the template
folder into the user's target directory, injecting configuration values like the site's name and the Sanity project ID.build
: generates routing-related files. Should be ran before the front-end's build so Remix can access these routes properly.dev
: watches your project folder and (1) submits singletons to Sanity, (2) auto-generates routing-related filescreateBlock
: guides you through setting up a new block type in Sanity and the front-endcreateDocument
: similar to createBlock
, but for documents