init
Initialize a new Teardown React Native project.
The init command creates a new Teardown React Native project with all necessary configuration files and folder structure.
Usage
teardown init <name> [options]Arguments
| Argument | Description |
|---|---|
name | App name (required) |
Options
| Option | Description | Default |
|---|---|---|
-f, --force | Overwrite existing files | false |
--skip-src | Skip generating src folder | false |
--skip-git | Skip generating .gitignore | false |
--skip-install | Skip installing dependencies | false |
-v, --verbose | Show detailed output | false |
Examples
Basic Initialization
teardown init MyAppCreates a new project with:
teardown.config.ts- App configurationsrc/folder with routes and components- Config files (metro, babel, react-native)
.gitignore- Dependencies installed
Force Overwrite
teardown init MyApp --forceOverwrites existing files if present.
Skip Steps
# Initialize without installing dependencies
teardown init MyApp --skip-install
# Initialize without src folder
teardown init MyApp --skip-src
# Initialize without .gitignore
teardown init MyApp --skip-gitGenerated Files
teardown.config.ts
Main configuration file:
import { defineConfig } from "@teardown/cli";
export default defineConfig({
name: "MyApp",
slug: "myapp",
version: "1.0.0",
ios: {
bundleIdentifier: "com.example.myapp",
buildNumber: 1,
deploymentTarget: "15.0",
},
android: {
packageName: "com.example.myapp",
versionCode: 1,
minSdkVersion: 24,
targetSdkVersion: 34,
},
plugins: [],
});src/ Folder Structure
src/
├── _routes/
│ ├── _layout.tsx # Root layout
│ └── index.tsx # Home screen
├── app/
│ └── index.tsx # Router setup
├── components/ # Shared components
├── core/ # Core utilities
└── providers/
└── app.provider.tsx # App providersConfig Files
| File | Purpose |
|---|---|
metro.config.js | Metro bundler configuration |
babel.config.js | Babel transpiler configuration |
react-native.config.js | React Native CLI configuration |
Gemfile | Ruby dependencies for CocoaPods |
dev-client.config.ts | Development client settings |
.gitignore
Includes patterns for:
ios/andandroid/(generated native code)node_modules/.teardown/(generated types)- Build artifacts
- Environment files
What's Next
After initialization:
- Configure plugins - Add native capabilities in
teardown.config.ts
export default defineConfig({
// ...
plugins: [
"camera",
"location",
],
});- Generate native projects
teardown prebuild- Run on device
teardown run ios
# or
teardown run androidTroubleshooting
Config Already Exists
Configuration file already existsUse --force to overwrite, or manually update the existing config.
Dependencies Failed to Install
If bun install fails, try:
teardown init MyApp --skip-install
cd MyApp
bun install # or npm installExisting src/ Folder
The command preserves existing src/ if present. Use --force to overwrite.