---
title: "createBuildCommands(context:target:)"
framework: swift-package-manager
role: symbol
role_heading: Instance Method
path: "swift-package-manager/documentation/packageplugin/buildtoolplugin/createbuildcommands(context:target:)"
---

# createBuildCommands(context:target:)

Invoked by the package manager to create build commands for a particular target.

## Declaration

```swift
func createBuildCommands(context: PluginContext, target: any Target) async throws -> [Command]
```

## Discussion

Discussion The context parameter contains information about the package and its dependencies, as well as other environmental inputs. This function should create and return build commands or prebuild commands, configured based on the information in the context. Note that the plugin does not directly run those commands.
