---
title: "prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)"
framework: swift-package-manager
role: symbol
role_heading: Type Method
path: "swift-package-manager/documentation/packageplugin/command/prebuildcommand(displayname:executable:arguments:environment:outputfilesdirectory:)-swift.type.method"
---

# prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)

Returns a command that runs unconditionally before every build.

## Declaration

```swift
static func prebuildCommand(displayName: String?, executable: Path, arguments: [any CustomStringConvertible], environment: [String : any CustomStringConvertible] = [:], outputFilesDirectory: Path) -> Command
```

## See Also

### 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)
