Skip to content
React Native command line tools
Branch: master
Clone or download
Latest commit f89819e Jul 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci feat(breaking): link only assets by default; add `--all` flag (#416) Jun 6, 2019
.github docs: add issue and PR templates (#121) Jan 24, 2019
.vscode chore: migrate `tools` to TypeScript (#296) May 17, 2019
__e2e__ fix: config on Windows & warnings breaking config JSON output on… (#464) Jul 3, 2019
__mocks__ feat: extract iOS and Android specific linking files out of the core (#… Apr 5, 2019
docs chore: better description for `sourceDir` config (#539) Jul 16, 2019
flow-typed/npm feat: upgrade envinfo for better output of info command (#265) Mar 28, 2019
jest chore: standardise network requests layer (#463) Jul 16, 2019
packages v2.7.0 Jul 18, 2019
scripts chore: migrate `tools` to TypeScript (#296) May 17, 2019
types feat: support local RN libraries in autolinking (#451) Jul 2, 2019
.editorconfig Set up Yarn workspaces and basic repo structure Sep 28, 2018
.eslintignore feat: build before publishing (#104) Jan 21, 2019
.eslintrc.js chore: migrate `tools` to TypeScript (#296) May 17, 2019
.flowconfig chore: move shared types to root; moar link styles; bye promiseWaterf… Apr 16, 2019
.gitattributes fix: line endings on Windows (#136) Jan 31, 2019
.gitignore chore: migrate `tools` to TypeScript (#296) May 17, 2019
.prettierrc.js chore: Update prettier config (#379) May 8, 2019
CODEOWNERS chore: add CODEOWNERS file (#404) May 30, 2019
CONTRIBUTING.md chore: fix typo in contribution guide (#501) Jul 8, 2019
LICENSE Set up Yarn workspaces and basic repo structure Sep 28, 2018
README.md docs: fix link in README.md to 1.x branch (#548) Jul 17, 2019
azure-pipelines.yml Fix trigger on azure pipelines (#543) Jul 16, 2019
babel.config.js chore: migrate `tools` to TypeScript (#296) May 17, 2019
jest.config.js chore: migrate `tools` to TypeScript (#296) May 17, 2019
lerna.json v2.7.0 Jul 18, 2019
package.json adjust build-clean and publish scirpts Jul 11, 2019
tsconfig.json chore: migrate `tools` to TypeScript (#296) May 17, 2019
yarn.lock chore(deps): bump fstream from 1.0.11 to 1.0.12 (#556) Jul 17, 2019

README.md

React Native CLI

Command line tools that ship with react-native in form of the @react-native-community/cli package.

It exposes react-native binary, so your can call yarn react-native or npx react-native directly from your project.

Build Status Version MIT License PRs Welcome

Note: CLI has been extracted from core react-native as a part of "Lean Core" effort. Please read this blog post for more details.

Contents

Compatibility

Our release cycle is independent of react-native. We follow semver and here is the compatibility table:

@react-native-community/cli react-native
^2.0.0 ^0.60.0
^1.0.0 ^0.59.0

Documentation

About

This repository contains tools and helpers for React Native projects in form of a command line tool. There's been quite some confusion around that since the extraction from React Native core. Let's clear them up:

  • There are currently two CLIs:
  • When we say "the CLI" we mean @react-native-community/cli.
  • We update the CLI independently of React Native itself. Please see how to use the latest version.
  • This is a monorepo to keep stuff organized.

We're actively working to make any indirections gone.

Creating a new React Native project

There are two ways to start a React Native project.

Using npx (recommended)

Available since react-native@0.60

This method is preferred if you don't want to install global packages.

npx react-native init MyApp

Using global CLI (legacy)

You'll need to install a global module react-native-cli and follow instructions there.

We strongly encourage you to only use global react-native-cli for bootstrapping new projects. Use local version for everything else.

You can find out more about init command from the documentation

Usage in an existing React Native project

Once you're inside an existing project, a local react-native binary will be available for you to use. Feel free to use Yarn to call it directly.

Example running start command in terminal:

yarn react-native start
# or:
npx react-native start
# or
node ./node_modules/.bin/react-native start

You can also add npm scripts to call it with whichever package manager you use:

{
  "scripts": {
    "start": "react-native start"
  }
}

Updating the CLI

Because we release independently of react-native, it happens that you may be locked on a version without fixes for bugs that affect you. Here's how to get it sorted:

  1. If you use lock files (yarn.lock or package-lock.json) - find the @react-native-community/cli entry, remove it, run yarn install / npm install once again.
  2. If you don't use lock files – remove node_modules and run yarn install / npm install again.
  3. Run yarn list @react-native-community/cli or npm list @react-native-community/cli and verify you're on the latest version.

After performing these steps you should be on the latest CLI version. Feel free to do it once in a while, because we release often.

Maintainers

License

Everything inside this repository is MIT licensed.

You can’t perform that action at this time.