create-remix
create-react-router CLIを使用して新しいプロジェクトを開始する必要があります。
create-remix CLI は、新しい Remix プロジェクトを作成します。引数を渡さずにこのコマンドを実行すると、新しいプロジェクトを構成し、指定されたディレクトリにセットアップするためのインタラクティブな CLI が起動します。
npx create-remix@latestオプションで、目的のディレクトリパスを引数として渡すことができます。
npx create-remix@latest <projectDir>デフォルトのアプリケーションは、組み込みの Remix App Server を使用した TypeScript アプリです。異なるセットアップに基づいてアプリケーションを作成したい場合は、--template フラグを使用できます。
npx create-remix@latest --template <templateUrl>利用可能なコマンドとフラグの完全なリストを取得するには、以下を実行します。
npx create-remix@latest --helpパッケージマネージャー
create-remix は、さまざまなパッケージマネージャーを使用して呼び出すこともでき、インストールプロセスを管理するために npm、Yarn、pnpm、および Bun から選択できます。
npm create remix@latest <projectDir>
# または
yarn create remix@latest <projectDir>
# または
pnpm create remix@latest <projectDir>
# または
bunx create-remix@latest <projectDir>create-remix --template
利用可能なテンプレートの詳細なガイドについては、テンプレートページ を参照してください。
有効なテンプレートは次のとおりです。
- GitHub リポジトリの短縮形 —
:username/:repoまたは:username/:repo/:directory - GitHub リポジリ(またはその中のディレクトリ)の URL —
https://github.com/:username/:repoまたはhttps://github.com/:username/:repo/tree/:branch/:directory- この形式を使用する場合、ブランチ名(
:branch)に/を含めることはできません。これは、create-remixがブランチ名とディレクトリパスを区別できないためです。
- この形式を使用する場合、ブランチ名(
- リモート tarball の URL —
https://example.com/remix-template.tar.gz - ファイルのディレクトリへのローカルファイルパス —
./path/to/remix-template - tarball へのローカルファイルパス —
./path/to/remix-template.tar.gz
npx create-remix@latest ./my-app --template remix-run/grunge-stack
npx create-remix@latest ./my-app --template remix-run/remix/templates/remix
npx create-remix@latest ./my-app --template remix-run/examples/basic
npx create-remix@latest ./my-app --template :username/:repo
npx create-remix@latest ./my-app --template :username/:repo/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/archive/refs/tags/:tag.tar.gz
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/releases/latest/download/:tag.tar.gz
npx create-remix@latest ./my-app --template https://example.com/remix-template.tar.gz
npx create-remix@latest ./my-app --template ./path/to/remix-template
npx create-remix@latest ./my-app --template ./path/to/remix-template.tar.gzcreate-remix --overwrite
create-remix がテンプレートとアプリを作成するディレクトリの間でファイルの衝突を検出した場合、それらのファイルをテンプレートバージョンで上書きしてもよいかどうかの確認を求められます。--overwrite CLI フラグを使用すると、このプロンプトをスキップできます。