Skip to content

Commit 92fa7e9

Browse files
dapiriangitbook-bot
authored andcommitted
GITBOOK-790: Codex
1 parent 96a420e commit 92fa7e9

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
description: Trunk Code Quality for OpenAI Codex
3+
---
4+
5+
# OpenAI Codex Support
6+
7+
This document provides guidance for integrating Trunk Code Quality into OpenAI Codex environments.
8+
9+
### Requirements
10+
11+
Ensure you’re running the following minimum versions in your `.trunk/trunk.yaml` file:
12+
13+
* Trunk CLI: v1.24.0 or later
14+
* Trunk Plugins: v1.7.0 or later
15+
16+
### Installation
17+
18+
In your Codex environment setup script, include:
19+
20+
```
21+
# Install Trunk CLI and dependent tools
22+
curl https://get.trunk.io -fsSL | bash
23+
trunk install
24+
```
25+
26+
It's important to pre-install all trunk dependencies during the setup because codex environments are network-isolated post-setup.
27+
28+
#### Debugging Installation
29+
30+
If the environment setup is slow, run the following to diagnose:
31+
32+
```
33+
trunk install --debug
34+
```
35+
36+
This command will detail installation timings and potential bottlenecks.
37+
38+
### Handling Network Isolation
39+
40+
Codex environments are network-isolated post-setup. Linters requiring network access must be excluded from running explicitly:
41+
42+
Example:
43+
44+
```
45+
trunk check --filter=-trufflehog,-semgrep
46+
```
47+
48+
### Teaching Codex how to use Trunk
49+
50+
Codex can automatically run trunk commands for you, by informing it to do so in your AGENTS.md file:
51+
52+
```
53+
## AGENTS Instructions
54+
55+
### Formatting and Linting
56+
- Run `trunk check -y --filter=-trufflehog,-semgrep` after modifying code to format and fix linting issues.
57+
- Review and verify changes before committing.
58+
- If only formatting is required, run `trunk fmt`.
59+
- Exclude linters requiring network access by adding them to the negative filter list as shown above.
60+
```

summary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
* [Linting in CI](code-quality/setup-and-installation/prevent-new-issues.md)
115115
* [Migration Guide](code-quality/setup-and-installation/prevent-new-issues/migration-guide.md)
116116
* [Nightly Report (Deprecated)](code-quality/ci-setup/github-integration.md)
117+
* [OpenAI Codex Support](code-quality/setup-and-installation/openai-codex-support.md)
117118
* [IDE Integration](code-quality/ide-integration/README.md)
118119
* [VSCode](code-quality/ide-integration/vscode.md)
119120
* [Neovim](code-quality/ide-integration/neovim.md)

0 commit comments

Comments
 (0)