create-example-app v0.2.0
Create Example App
This simple CLI tool enables you to quickly start building a new application from an existing repository or directory on GitHub. To get started, use the following command:
npx create-example-app -e vercel/next.js -b canary -e amp amp-app
To create a new app in a specific folder, you can send a name as an argument. For example, the following command will create a new example app called amp-app
in a folder with the same name:
npx create-example-app -e vercel/next.js/examples/amp -b canary amp-app
Or if you need to use a custom branch, you can add to the name or use the full GitHub URL:
npx create-example-app -e vercel/next.js/tree/canary/examples/amp amp-app
npx create-example-app -e https://github.com/vercel/next.js/tree/canary/examples/amp amp-app
You can also use the yarn create
syntax like:
yarn create example-app -r vercel/next.js -b /examples/gcloud-okta-webhook
Options
create-example-app
comes with the following options:
- -e, --example name|github-url - An example to bootstrap the app with. You can use an example GitHub repo or full URL. The URL can use any branch.
- -r, --repo org/repo - A repo to pull examples from
- -b, --branch branch - A branch to use when downloading examples
- -p, --example-path <path-to-example> - In a rare case, your GitHub URL might contain a branch name with a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). In this case, you must specify the path to the example separately:
--example-path foo/bar
Why use Create Example App?
create-example-app
allows you to create a new example app within seconds and includes a few benefits:
- Interactive Experience: Running
npx create-example-app
(with no arguments) launches an interactive experience that guides you through setting up a project. - Small, Single Binary: Initializing a project is as quick as one second. Create Example App has few dependencies and bundled into a single file.
- Works For Any Project: While the tooling is initially oriented for JavaScript projects, the downloading capabilities can work any kind of project. Follow this issue for more info.
Acknowledgements
This project is based on the experience of create-next-app
originally inspired by Create React App, created by Fouad at Segment, and then adopted by Vercel. Currently, this project is maintained by Indent.