---
title: Command
framework: swift-package-manager
role: symbol
role_heading: Enumeration
path: swift-package-manager/documentation/packageplugin/command
---

# Command

A command to run during the build.

## Declaration

```swift
enum Command
```

## Overview

Overview A command includes the executable, command lines, environment variables, initial working directory, and so on. All paths should be based on the ones that SwiftPM passes to the plugin in the target build context.

## Topics

### Types of Build Commands

- [Command.buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)](swift-package-manager/documentation/packageplugin/command/buildcommand(displayname:executable:arguments:environment:inputfiles:outputfiles:)-swift.enum.case.md)
- [Command.prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)](swift-package-manager/documentation/packageplugin/command/prebuildcommand(displayname:executable:arguments:environment:outputfilesdirectory:)-swift.enum.case.md)
- [buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)](swift-package-manager/documentation/packageplugin/command/buildcommand(displayname:executable:arguments:environment:inputfiles:outputfiles:)-swift.type.method.md)
- [prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)](swift-package-manager/documentation/packageplugin/command/prebuildcommand(displayname:executable:arguments:environment:outputfilesdirectory:)-swift.type.method.md)

## See Also

### Implementing Build Plugins

- [BuildToolPlugin](swift-package-manager/documentation/packageplugin/buildtoolplugin.md)
- [PluginContext](swift-package-manager/documentation/packageplugin/plugincontext.md)
- [Target](swift-package-manager/documentation/packageplugin/target.md)
