|
| 1 | +--- |
| 2 | +title: Default environment variables for your codespace |
| 3 | +shortTitle: Default environment variables |
| 4 | +product: '{% data reusables.gated-features.codespaces %}' |
| 5 | +permissions: '{% data reusables.codespaces.availability %}' |
| 6 | +intro: '{% data variables.product.prodname_dotcom %} sets default environment variables for each codespace.' |
| 7 | +versions: |
| 8 | + fpt: '*' |
| 9 | + ghec: '*' |
| 10 | +type: overview |
| 11 | +topics: |
| 12 | + - Codespaces |
| 13 | + - Fundamentals |
| 14 | + - Developer |
| 15 | +--- |
| 16 | + |
| 17 | +## About default environment variables |
| 18 | + |
| 19 | +{% data variables.product.prodname_dotcom %} sets default environment variables for every codespace. Commands run in codespaces can create, read, and modify environment variables. |
| 20 | + |
| 21 | +{% note %} |
| 22 | + |
| 23 | +**Note**: Environment variables are case-sensitive. |
| 24 | + |
| 25 | +{% endnote %} |
| 26 | + |
| 27 | +## List of default environment variables |
| 28 | + |
| 29 | +| Environment variable | Description | |
| 30 | +| ---------------------|------------ | |
| 31 | +| `CODESPACE_NAME` | The name of the codespace For example, `monalisa-github-hello-world-2f2fsdf2e` | |
| 32 | +| `CODESPACES` | Always `true` while in a codespace | |
| 33 | +| `GIT_COMMITTER_EMAIL` | The email for the "author" field of future `git` commits. | |
| 34 | +| `GIT_COMMITTER_NAME` | The name for the "committer" field of future `git` commits. | |
| 35 | +| `GITHUB_API_URL` | Returns the API URL. For example, `{% data variables.product.api_url_code %}`. | |
| 36 | +| `GITHUB_GRAPHQL_URL` | Returns the GraphQL API URL. For example, `{% data variables.product.graphql_url_code %}`. | |
| 37 | +| `GITHUB_REPOSITORY` | The owner and repository name. For example, `octocat/Hello-World`. | |
| 38 | +| `GITHUB_SERVER_URL`| Returns the URL of the {% data variables.product.product_name %} server. For example, `https://{% data variables.product.product_url %}`. | |
| 39 | +| `GITHUB_TOKEN` | A signed auth token representing the user in the codespace. You can use this to make authenticated calls to the GitHub API. For more information, see "[Authentication](/codespaces/codespaces-reference/security-in-codespaces#authentication)." | |
| 40 | +| `GITHUB_USER` | The name of the user that initiated the codespace. For example, `octocat`. | |
0 commit comments