Overview
Thetuist install command installs remote content (e.g., dependencies) necessary to interact with your project. It fetches and resolves dependencies defined in your project manifests, such as Swift packages and other remote resources.
Usage
Options
The path to the directory or a subdirectory of the project.
Short form of
--path.Instead of simple install, update external content when available.
Short form of
--update.Arguments
Arguments to pass to the underlying
swift package invocation. These are captured and passed through to the Swift Package Manager.Examples
Install all dependencies
Install and update dependencies
Install for specific project path
Pass arguments to Swift Package Manager
swift package command.
How it works
Thetuist install command:
- Reads your project manifests (
Project.swift,Package.swift, etc.) - Identifies all remote dependencies (Swift packages, etc.)
- Resolves dependency versions
- Downloads and caches dependencies locally
- Prepares the project for generation
Dependencies
Tuist supports several types of remote dependencies:Swift packages
Declare Swift package dependencies in yourProject.swift:
External dependencies
Other types of external content that might be installed:- Tuist plugins
- Template repositories
- Project resources
Install vs. Update
The difference between install and update modes:Install (default)
- Uses existing resolved versions when possible
- Only fetches new dependencies
- Respects lock files and version constraints
- Faster for unchanged dependencies
Update (--update)
- Checks for newer versions of all dependencies
- Updates to latest compatible versions
- Updates lock files
- Takes longer but ensures latest dependencies
Workflow integration
Typical workflow withtuist install:
- After cloning: Run
tuist installto fetch dependencies - Adding dependencies: Update manifests, then run
tuist install - Updating dependencies: Run
tuist install --updateperiodically - Before generating: Ensure dependencies are installed with
tuist install
tuist install explicitly can be useful for:
- Pre-downloading dependencies before generation
- Updating dependencies independently
- CI/CD pipelines where you want explicit control
Best practices
Install before generate
Run
tuist install before tuist generate to ensure all dependencies are ready.Update periodically
Use
--update regularly to keep dependencies current with security fixes.CI caching
Cache installed dependencies in CI to speed up builds.
Lock file commits
Commit dependency lock files to ensure consistent builds across team.