Install the Valdi CLI from npm. This guide assumes you install the CLI with
npm install -g @snap/valdi. If you are contributing to Valdi itself, see DEV_SETUP.md instead.
This guide will help you set up your development environment and get started with your first project.
Install Xcode from the App Store - this is required for iOS development.
No prerequisites! The Valdi CLI will install everything you need.
That's it! The valdi dev_setup command handles all other dependencies automatically, including:
- Homebrew (macOS)
- Bazelisk
- Java JDK 17
- Android SDK command-line tools
- Git LFS
- Watchman
- Shell autocomplete, JDK symlink (macOS), Android env vars, and platform-specific extras (e.g. ios-webkit-debug-proxy on macOS; adb, zlib/fontconfig dev libs on Linux)
npm install -g @snap/valdi# Set up your development environment (installs all dependencies)
valdi dev_setup
# Verify everything is working
valdi doctorNote
The first time you run valdi dev_setup, it will download and install several gigabytes of dependencies. This may take 10-20 minutes depending on your internet connection.
Tip
Contributing to Valdi? If you're developing Valdi itself (not just using it), clone the repository and install from source:
git clone git@github.com:Snapchat/Valdi.git
cd Valdi/npm_modules/cli/
npm run cli:installThe best way to start a new project is to bootstrap it using the Valdi CLI. The bootstrap command will create all of the necessary directories, source, and configuration files.
# Create and enter your project directory
mkdir my_project
cd my_project
# Initialize a new Valdi project
valdi bootstrapThis will create all necessary files for a new Valdi project in your current directory.
Choose your target platform and install dependencies:
# For iOS
valdi install ios
# For Android
valdi install androidNote
The first build may take several minutes as it sets up the bazel WORKSPACE.
Once your app is running in a simulator or emulator, start the hot reloader to see your changes in real-time:
valdi hotreloadValdi provides editor extensions for syntax highlighting, debugging, and device logs during hot reload.
- VSCode: Download from code.visualstudio.com
- Cursor: Download from cursor.com
For VSCode:
- Launch VSCode
- Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
- Type
shell commandand select> Install 'code' command in PATH - Restart your terminal
For Cursor:
- Launch Cursor
- Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
- Type
shell commandand select> Install 'cursor' command in PATH - Restart your terminal
Download the extension files from the latest release:
valdi-vivaldi.vsix- Device logs and Valdi language supportvaldi-debug.vsix- JavaScript debugger for Valdi apps
Install the extensions:
# For VSCode
code --install-extension /path/to/valdi-vivaldi.vsix
code --install-extension /path/to/valdi-debug.vsix
# For Cursor
cursor --install-extension /path/to/valdi-vivaldi.vsix
cursor --install-extension /path/to/valdi-debug.vsixAfter creating your first Valdi project:
- Open any TypeScript file (.tsx) in your project
- Press
Cmd+Shift+P(or Ctrl+Shift+P) - Select "TypeScript: Select TypeScript Version..."
- Choose
Use Workspace Version
Important
Selecting the workspace TypeScript version is crucial for proper development and cannot be automated.
When you make changes to any of the following:
- Dependencies
- Localization files
- Resource files
Run this command to update your project configuration:
valdi projectsyncIf you encounter any issues during setup:
-
Run diagnostics:
valdi doctor
This will check your environment and provide specific fix suggestions.
-
Check prerequisites:
- macOS: Ensure Xcode is installed and configured (
sudo xcode-select -s /Applications/Xcode.app) - All platforms: Ensure you have a stable internet connection for downloading dependencies
- macOS: Ensure Xcode is installed and configured (
-
Review detailed setup guides:
-
Get help:
- Join our Discord community
- Check Troubleshooting Guide
Ready to start building? Check out: