Skip to main content

Overview

The tuist plugin command provides tools for plugin development and management. Plugins extend Tuist’s functionality with custom tasks and integrations.

Usage

Subcommands

tuist plugin archive

Archives a plugin into a NameOfPlugin.tuist-plugin.zip file for distribution.

tuist plugin build

Builds a plugin.

tuist plugin run

Runs a plugin task.

tuist plugin test

Tests a plugin.

Common Options

string
default:"."
The path to the directory that contains the definition of the plugin.
string
Short form of --path.
string
default:"debug"
Choose configuration: debug or release.
string
Short form of --configuration.

Options (for plugin archive)

string
default:"."
The path to the directory that contains the definition of the plugin.
string
Short form of --path.

Options (for plugin build)

boolean
default:"false"
Build both source and test targets.
boolean
default:"false"
Print the binary output path.
string[]
Build the specified targets.
string[]
Build the specified products.

Options (for plugin run)

boolean
default:"false"
Build both source and test targets.
boolean
default:"false"
Skip building the plugin before running.

Arguments (for plugin run)

string
required
The plugin task to run.
string[]
The arguments to pass to the plugin task.

Options (for plugin test)

boolean
default:"false"
Build both source and test targets.
string[]
Test the specified products.

Examples

Build a plugin

Builds the plugin in debug configuration.

Build plugin in release mode

Builds an optimized release version of the plugin.

Build specific targets

Builds only the specified plugin targets.

Run a plugin task

Executes the my-task plugin task with arguments.

Run without building

Runs the task without rebuilding the plugin first.

Test a plugin

Runs all tests for the plugin.

Test specific products

Runs tests only for the specified test products.

Archive a plugin

Creates a distributable .tuist-plugin.zip archive.

Archive from specific path

Archives a plugin located in a specific directory.

Plugin development workflow

1. Create a plugin

Plugins are Swift packages that define custom tasks:

2. Implement tasks

Create executable targets for your tasks:

3. Build and test

Develop your plugin iteratively:

4. Archive and distribute

When ready to share:
This creates a .tuist-plugin.zip file you can distribute.

Plugin types

Task plugins

Executable tasks that extend Tuist functionality:

Helper plugins

Libraries that provide reusable code:

Using plugins

Reference plugins in your Tuist.swift or Project.swift:

Configuration options

Debug vs. Release

  • Debug: Faster builds, includes debug symbols
  • Release: Optimized builds, smaller binaries

Build tests

Include test targets in the build:

Show binary path

Useful for integrating with other tools:

Best practices

Small, focused tasks

Create plugins for specific, reusable tasks rather than monolithic tools.

Test thoroughly

Use tuist plugin test to ensure reliability before distribution.

Version plugins

Use semantic versioning and git tags for plugin releases.

Document tasks

Provide clear documentation for task arguments and usage.

Common plugin use cases

Code generation

Generate boilerplate code, models, or templates:

Code formatting

Format code using custom rules:

Integration with tools

Integrate third-party tools into your workflow:

Custom validations

Validate project structure or conventions:

Plugin development tips

Access project information

Use ProjectAutomation framework to access project data:

Handle arguments

Parse task arguments using Swift’s ArgumentParser:

Error handling

Provide clear error messages: