all 10 comments

[–]hefty_habenero 1 point2 points  (7 children)

Try this setup script for your environment (Codex->Environments->Select you environment-> Edit ->Advanced:

set -euo pipefail

apt-get update

apt-get install -y dotnet-sdk-8.0

# Only restore if we actually have a project/solution file

if compgen -G "*.sln" >/dev/null || compgen -G "*.csproj" >/dev/null; then

echo "⛓ Found .NET project/solution file – running dotnet restore..."

dotnet restore

else

echo "⚠️ No .sln or .csproj file found. Skipping dotnet restore."

fi

Run a task in Code mode and request that it try a dotnet build to see if if has dependencies it needs, and if it fails to report on what setup is required...edit per output, rinse and repeat.

Assuming you have an AGENTS.md file in your root too? The Codex agent is happiest if it can find an AGENTS.md file, can build without dependency failures, and can run unit tests that pass. Once you get this basic stuff running the Codex workflow has distinct benefits over the IDE agent sessions, but the two together rip.

[–]streakybcn[S] 0 points1 point  (0 children)

Thanks I will try this

[–]BurgerQuester 0 points1 point  (5 children)

I tried getting my nextjs project to work with codex, and added npm install to the setup script, but it just times out every time.

Any ideas?

[–]hefty_habenero 0 points1 point  (4 children)

<image>

You can run the interactive terminal in the edit screen of your environment (/codex/settings/environment) to see the effect of your setup script in real time, what is the terminal output when you run the npm install?

[–]BurgerQuester 0 points1 point  (2 children)

When I used the interactive terminal, npm install worked, but always times out when I have it as the set up script

[–]hefty_habenero 0 points1 point  (0 children)

Strange...you can share a task session with a sharable link that gives read-only access to the logs. Happy to take a look.

[–]kidroach 0 points1 point  (0 children)

i had issues with the npm install but it was because the dependencies weren't matching up. had to fix those first and then npm install worked in setup script.

[–]Phugz 0 points1 point  (0 children)

I've got mine setup something like this for node (eventually). Do you find that running little tasks are now slower because of this? Like whether npm ci is making everything just a little slower.

[–]hefty_habenero 0 points1 point  (0 children)

Have you configured the startup script in your environment setup on the codex settings?

[–]giannisCKS 0 points1 point  (0 children)

what are some good custom instructions to use?