1# Local environments – Codex app1# Local environments
2 2
3Local environments let you configure setup steps for worktrees as well as common actions for a project.3Local environments let you configure setup steps for worktrees as well as common actions for a project.
4 4
5You configure your local environments through the [Codex app settings](codex://settings) pane. You can check the generated file into your project’s Git repository to share with others.5Local environments are available only in Codex in the ChatGPT desktop app.
6 Select **Codex** before you configure or use a local environment.
7
8You configure your local environments through the [ChatGPT desktop app settings](codex://settings) pane. You can check the generated file into your project's Git repository to share with others.
6 9
7Codex stores this configuration inside the `.codex` folder at the root of your10Codex stores this configuration inside the `.codex` folder at the root of your
8project. If your repository contains more than one project, open the project11project. If your repository contains more than one project, open the project
10 13
11## Setup scripts14## Setup scripts
12 15
13Since worktrees run in different directories than your local tasks, your project might not be fully set up and might be missing dependencies or files that aren’t checked into your repository. Setup scripts run automatically when Codex creates a new worktree at the start of a new thread.16Since worktrees run in different directories than your local tasks, your project might not be fully set up and might be missing dependencies or files that aren't checked into your repository. Setup scripts run automatically when Codex creates a new worktree at the start of a new task.
14 17
15Use this script to run any command required to configure your environment, such as installing dependencies or running a build process.18Use this script to run any command required to configure your environment, such as installing dependencies or running a build process.
16 19
17For example, for a TypeScript project you might want to install the dependencies and do an initial build using a setup script:20For example, for a TypeScript project you might want to install the dependencies and do an initial build using a setup script:
18 21
19```22```bash
20npm install23npm install
21npm run build24npm run build
22```25```
25 28
26## Actions29## Actions
27 30
28Use actions to define common tasks like starting your app’s development server or running your test suite. These actions appear in the Codex app top bar for quick access. The actions will be run within the app’s [integrated terminal](https://developers.openai.com/codex/app/features#integrated-terminal).31<section class="feature-grid">
32
33<div>
34Use actions to define common tasks like starting your app's development server or running your test suite. These actions appear in the ChatGPT desktop app top bar for quick access. The actions run within the app's [integrated terminal](https://learn.chatgpt.com/docs/integrated-terminal).
29 35
30Actions are helpful to keep you from typing common actions like triggering a build for your project or starting a development server. For one-off quick debugging you can use the integrated terminal directly.36Actions are helpful to keep you from typing common actions like triggering a build for your project or starting a development server. For one-off quick debugging you can use the integrated terminal directly.
31 37
3238</div>
33 39
34For example, for a Node.js project you might create a “Run” action that contains the following script:40<CodexScreenshot
41 alt="Project actions list shown in ChatGPT desktop app settings"
42 lightSrc="/images/codex/app/actions-light.webp"
43 darkSrc="/images/codex/app/actions-dark.webp"
44 maxHeight="400px"
45 class="mb-4 lg:mb-0"
46/>
35 47
36```48</section>
49
50For example, for a Node.js project you might create a "Run" action that contains the following script:
51
52```bash
37npm start53npm start
38```54```
39 55
41 57
42To identify your actions, choose an icon associated with each action.58To identify your actions, choose an icon associated with each action.
43 59
60## Use built-in Git tools
61
62<div class="my-8 grid gap-6 md:grid-cols-[minmax(0,1fr)_minmax(16rem,42%)] md:items-center">
63
64<div>
65
66In Codex, the ChatGPT desktop app provides common Git controls alongside each
67local project and worktree. The diff pane shows changes in the current checkout
68and lets you add inline comments for Codex to address. You can stage or revert individual
69chunks, stage or revert entire files, commit changes, push a branch, and create
70a pull request without leaving the app.
71
72Use the [integrated terminal](https://learn.chatgpt.com/docs/integrated-terminal) for Git
73operations that aren't exposed in the app. To isolate concurrent changes from
74your local checkout, start the task in a [worktree](https://learn.chatgpt.com/docs/environments/git-worktrees).
75
76</div>
77
78<Illustration description="Codex environment summary panel">
79 <EnvironmentPanelIllustration ariaLabel="Codex environment summary panel" />
80</Illustration>
81
82</div>