<!--
{
  "availability" : [
    "SwiftPM: 5.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Context",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription7ContextV"
  },
  "title" : "Context"
}
-->

# Context

The context information for a Swift package.

```
struct Context
```

## Overview

The context encapsulates states that are known when Swift Package Manager interprets the package manifest,
for example the location in the file system where the current package resides.

## Topics

### Type Properties

[`static var environment: [String : String]`](/documentation/PackageDescription/Context/environment)

Snapshot of the system environment variables.

[`static var gitInformation: GitInformation?`](/documentation/PackageDescription/Context/gitInformation)

Information about the git status of a given package, if available.

[`static var packageDirectory: String`](/documentation/PackageDescription/Context/packageDirectory)

The directory that contains `Package.swift`.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)