create-target CLI tool helps you quickly scaffold Apple targets (widgets, app clips, extensions, etc.) in your Expo project.
Usage
Interactive mode
Run without arguments to select from a list of available target types:Direct creation
Specify a target type directly to skip the interactive prompt:Options
Skip installing
@bacons/apple-targets package. Use this if the package is already installed.Display the CLI version number.Alias:
-vShow usage information and available options.Alias:
-hPackage manager detection
The CLI automatically detects which package manager you’re using based on how you invoke it:| Package Manager | Command |
|---|---|
| npm | npx create-target |
| yarn | yarn create target |
| pnpm | pnpm create target |
| bun | bun create target |
What gets created
When you runcreate-target, the following happens:
1. Package installation
If@bacons/apple-targets is not already installed:
2. Config plugin setup
The plugin is automatically added to yourapp.json or app.config.js:
app.json
3. Target directory structure
A new directory is created at/targets/<target-name>/ with the following files:
Example: Widget target
Example: Share extension
Example: App Clip
Generated config file
Each target includes a pre-configuredexpo-target.config.js with sensible defaults:
targets/widget/expo-target.config.js
targets/watch/expo-target.config.js
targets/share/expo-target.config.js
Interactive prompts
Target selection
When running without arguments, you’ll see a searchable list of all available target types:Overwrite confirmation
If the target directory already exists and is not empty:- Yes: Removes existing files and creates fresh target
- No: Exits without making changes
- CI mode: Automatically fails (no interactive prompts)
Next steps
After creating a target:Terminal output
- Configure the target by editing
/targets/<name>/expo-target.config.js - Generate the Xcode project:
- Open in Xcode:
- Develop your target inside the
expo:targets/<name>folder in Xcode
Available target types
The CLI supports 40+ target types. Runnpx create-target to see the full list, including:
- widget - Home screen widgets with WidgetKit
- clip - App Clips for instant experiences
- share - Share extensions
- action - Action extensions
- notification-content - Custom notification UI
- notification-service - Notification service extensions
- intent / intent-ui - Siri shortcuts
- safari - Safari extensions
- keyboard - Custom keyboards
- watch / watch-widget - Apple Watch apps
- content-blocker - Safari content blockers
- And many more network, authentication, and system extensions
Troubleshooting
Invalid target error
If you specify an invalid target:Output
Project not found
package.json and app.json).
CI environment
Interactive prompts are disabled in CI environments. Always specify the target type:Environment variables
Enable debug logging to see detailed information about the creation process.
Automatically detected. When set, disables all interactive prompts.
Examples
Create a widget with debug output
Create without installing dependencies
Create multiple targets
Using with different package managers
npm
yarn
pnpm
bun