We'll be using npx
on this page to run the examples without installing anything.
See installation.md for local install instructions.
npx @scffld/cli github:scffld-dev/cli/examples/simple \
--name="My Awesome Component" \
-o ./my-project/src/
(Windows users will need to remove \
and put everything on one line)
Files will be created in my-project/src
Use the web-app template without the required name
prop:
npx @scffld/cli github:scffld-dev/cli/examples/web-app -o ./my-web-app/src/
A few things to note:
- It will prompt you for the missing name, and allow you to change the defaults of any other template options
- Will prompt to overwrite any existing files
- Displays a custom post install message
- Prompts you to allow running of custom post install commands
npx @scffld/cli template [options]
- Grab one of the example templates & save it locally, or create your own (see templates.md for details)
- Run this command, replacing
examples/simple
with your template name
npx @scffld/cli examples/simple \
--name="My Awesome Component" \
-o ./my-project/src/
Files will be created in my-project/src
Show supported options for the template:
npx @scffld/cli examples/simple \
--help
Try it out with a few options different to the defaults:
npx @scffld/cli examples/simple \
--name="My Other Component" \
--includeStyle=false \
--yeah=false \
--nah=true \
-o ./my-project/src/
or leave out all options to be prompted for them:
npx @scffld/cli examples/simple
Templates can be loaded from a remote URL:
npx @scffld/cli https://raw.githubusercontent.com/scffld-dev/cli/develop/examples/simple.md \
--name="My Remote Component"
or from GitHub:
npx @scffld/cli github:scffld-dev/cli/examples/simple \
--name="My Remote Component"
and with a specific commit/tag/branch:
npx @scffld/cli github:scffld-dev/cli/examples/[email protected] \
--name="My Remote Component"
Option | Details |
---|---|
-h --help |
Show available options for the template |
-o --outputDirectory |
Base directory where files should be written Defaults to the outputDirectory defined in the template |
--overwrite |
true : overwrite existing filesfalse : exit instead of overwriting |