Installer et tester Codex CLI (OpenAI) sur Debian 13
Créé par Jean-Emmanuel Bissey le 17/09/2026 modifié le 21/10/2026 PubliéOpenAI met à disposition un CLI officiel pour interagir directement avec ses modèles depuis le terminal : Codex CLI. Cet outil permet d'analyser du code, d'exécuter des requêtes d'inspection et de manipuler des dépôts sans quitter la ligne de commande.
La procédure pas à pas pour l'installer et réaliser les premières analyses d'un projet.
1. Installation de Codex CLI
L'installation s'effectue simplement via le script officiel mis à disposition par OpenAI :
curl -fsSL https://chatgpt.com/codex/install.sh | sh
Au cours de l'exécution, le script détecte la plateforme (Linux x64), télécharge le binaire autonome et l'installe dans ~/.codex/packages/standalone/. Il ajoute également la variable PATH dans le fichier ~/.bashrc.
==> Installing Codex CLI
==> Detected platform: Linux (x64)
==> Resolved version: 0.154.0
==> Downloading Codex CLI
==> Installing standalone package to /home/jeb/.codex/packages/standalone/releases/0.154.0-x86_64-unknown-linux-musl
==> Current terminal: export PATH="/home/jeb/.local/bin:$PATH" && codex
==> Future terminals: open a new terminal and run: codex
==> PATH was added to /home/jeb/.bashrc
Codex CLI 0.154.0 installed successfully.
Start Codex now? [y/N]
Pour recharger immédiatement la configuration de votre terminal sans rouvrir de session :
source ~/.bashrc
2. Premier lancement et vérification de l'identité
Pour démarrer une session interactive, placez-vous dans votre projet puis lancez l'outil :
cd ~/Clones/GitHub/MyClub/
codex
L'interface du CLI s'ouvre, affichant le modèle actif (ex. gpt-5.6-terra) et le répertoire courant :
╭─────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.154.0) │
│ │
│ model: gpt-5.6-terra /model to change │
│ directory: ~/Clones/GitHub/MyClub/test │
╰─────────────────────────────────────────────╯
Tip: Use /fork to branch the current chat into a new thread.
› Ask Codex to do anything
Pour vérifier les droits d'accès et l'identité configurée sur le projet sans risquer de modifier vos fichiers, passez une consigne stricte de lecture seule :
› Who am I authenticated as, and what authentication method am I using?
Do not modify any files.
Codex exécute localement les commandes d'inspection (git config, gh auth status) et retourne le profil identifié :
• Git identity is configured as JEB (je.bissey@gmail.com).
The repository's GitHub remote is https://github.com/jebissey/MyClub.git, so it uses HTTPS authentication.
Pour quitter la session : saisissez exit ou faites Ctrl+D. Le CLI affiche alors un récapitulatif de la consommation de jetons (tokens) et fournit un identifiant d'extension si vous souhaitez reprendre la session plus tard avec codex resume .
3. Exemple pratique : Audit d'un projet complet
Codex s'avère particulièrement efficace pour comprendre l'architecture d'un projet existant. En vous positionnant à la racine de votre projet, vous pouvez lui demander un diagnostic global.
cd ~/Clones/GitHub/MyClub
› Analyze this repository without modifying any files.
Explain:
1. the purpose of the MyClub project,
2. the role of WebSite/ and test/,
3. the purpose of dev/,
4. how the test project interacts with WebSite/,
5. the current PHP version and main technologies,
6. how the automated route tests work.
Do not modify any files and do not run commands that modify the repository.
Résultat de l'analyse produite par Codex
En explorant le dépôt en mode lecture seule (ripgrep, lecture des fichiers composer.json, README.md et scripts d'architecture), Codex extrait rapidement les informations clés :
Objectif du projet : MyClub est un CMS léger et personnalisable destiné à la gestion d'associations (gestion des membres, événements, cotisations, droits, etc.).
Structure du code :
WebSite/ : Contient l'application PHP déployable (contrôleurs, vues Latte, assets et tests unitaires PHPUnit).
test/ : Un outil d'intégration sur mesure (indépendant de PHPUnit) qui simule des requêtes HTTP réelles sur l'application via cURL et valide l'état SQLite.
dev/ : Regroupe les scripts de maintenance, de formatage (beforeCommit.sh), de packaging (CreateFullInstall.sh) et de lancement de serveur local (StartPhpServer.sh).
Stack technique : Développé pour PHP 8.4+ (utilisant PHPUnit 13), le projet s'appuie sur FlightPHP (routage), Latte (moteur de rendu), Tracy (débogage) et FluentPDO / SQLite pour les données.
Bilan
L'installation de Codex CLI sous Debian 13 se fait en quelques secondes. C'est un assistant précieux en ligne de commande pour documenter du code, faire de l'audit de sécurité sans altérer l'arborescence ou générer des résumés d'architecture avant de commiter.
Faire la mise à jour
jeb@debian:~/Clones/GitHub/MyClub$ codex
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✨ Update available! 0.155.1 -> 0.163.0 │
│ Run sh -c 'curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh' to update. │
│ │
│ See full release notes: │
│ https://github.com/openai/codex/releases/latest │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.155.1) │
│ │
│ model: gpt-6-luna /model to change │
│ directory: ~/Clones/GitHub/MyClub │
╰──────────────────────────────────────────╯
Tip: New For a limited time, Codex is included in your plan for free – let’s build together.
Session ID: ...
jeb@debian:~/Clones/GitHub/MyClub$
Ctrl+D pour sortir du terminal, puis lancer la commande indiquée
jeb@debian:~/Clones/GitHub/MyClub$ sh -c 'curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh'
==> Updating Codex CLI from 0.155.1 to 0.163.0
==> Detected platform: Linux (x64)
==> Resolved version: 0.163.0
==> Downloading Codex CLI
==> Installing standalone package to /home/jeb/.codex/packages/standalone/releases/0.163.0-x86_64-unknown-linux-musl
==> /home/jeb/.local/bin is already on PATH
==> Current terminal: codex
==> Future terminals: open a new terminal and run: codex
Codex CLI 0.163.0 installed successfully.
jeb@debian:~/Clones/GitHub/MyClub$ codex
Détail de l'analyse pour MyClub
• I’ll inspect the repository’s documentation, manifests, configuration, and test sources read-only, then summarize the project structure and route-test flow.
• Ran pwd && rg --files -g '!*bin*' -g '!*.min.*' | sed -n '1,240p'
└ /home/jeb/Clones/GitHub/MyClub
LICENSE
… +237 lines (ctrl + t to view transcript)
WebSite/tests/models/PersonDataHelperTest.php
WebSite/tests/models/ArticleCrosstabDataHelperTest.php
• Ran sed -n '1,240p' README.md && printf '\n--- WebSite composer ---\n' && sed -n '1,220p' WebSite/composer.json && printf '\n--- root files ---\n' && find . -maxdepth 2 -type f \( -name 'composer.json' -o -name 'package.json' -o
│ -name 'phpunit.xml' -o -name 'README*' -o -name 'Makefile' \) -print
└ # MyClub – The ultra-light, fully customizable CMS for your association
… +278 lines (ctrl + t to view transcript)
./WebSite/phpunit.xml
./README.md
• Explored
└ Search route testing|FlightRouteTester|JsonGetParameters|JsonPostParameters|ExpectedResponseCode|test/ in README.md
Read FlightRouteTester.php
Read bootstrap.php
Read RouteTestFactory.php
• Ran printf '%s\n' '--- dev scripts ---'; for file in dev/*.sh dev/*.php dev/router.php; do [ -f "$file" ] && { printf '\n### %s\n' "$file"; sed -n '1,220p' "$file"; }; done; printf '%s\n' '--- route-test implementation ---'; sed -n
│ '1,280p' test/Infrastructure/RouteTestOrchestrator.php; sed -n '1,260p' test/Infrastructure/FlightRouteExtractor.php; sed -n '1,260p' test/Infrastructure/SimulationExtractor.php; sed -n '1,300p' test/Core/TestExecutor.php; sed
│ -n '1,220p' test/Infrastructure/CurrentWebSite.php
└ --- dev scripts ---
… +1031 lines (ctrl + t to view transcript)
}
}
• Explored
└ Search "php"|platform|flightphp/core|latte/latte|tracy/tracy|fluentpdo|phpunit/phpunit|guzzlehttp/guzzle|web-push|phpmailer in composer.lock
Read index.php
Read Routes.php
Read CurlHttpClient.php
Read SessionAuthenticator.php
Read SqliteTestDataRepository.php
Read SqliteMyClubDataRepository.php
Read UrlBuilder.php
Read TestDataValidator.php
• Ran php --version; printf '\n--- locked direct dependencies ---\n'; php -r '$j=json_decode(file_get_contents("WebSite/composer.lock"),true); foreach (array_merge($j["packages"],$j["packages-dev"]) as $p) { if (in_array($p["name"],
│ ["flightphp/core","latte/latte","tracy/tracy","envms/fluentpdo","ua-parser/uap-php","guzzlehttp/guzzle","minishlink/web-push","phpmailer/phpmailer","mailjet/mailjet-apiv3-php","getbrevo/brevo-php","phpunit/phpunit","phpstan/
│ phpstan","squizlabs/php_codesniffer","friendsofphp/php-cs-fixer"],true)) echo $p["name"]." ".$p["version"]."\n"; }'; printf '\n--- project tree summary ---\n'; find WebSite -maxdepth 2 -mindepth 1 -type d -printf '%p\n' | sort;
│ … +2 lines
└ envms/fluentpdo v2.2.4
flightphp/core v3.18.3
… +209 lines (ctrl + t to view transcript)
M dev/StartPhpServer.sh
M test/Database/tests.sqlite
• Explored
└ Search function init|static function init|MyClub\.sqlite|database/MyClub|copy\(|sqlite in Application.php
Read Application.php
List dev
Read depends.cmd
Read LinesByFiles.cmd
Read LinesByFiles.txt
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• No files were modified. The worktree already contains unrelated changes, which I left untouched.
1. Purpose of MyClub
MyClub is a lightweight, customizable CMS and club-management web application for associations. It manages articles, events/activities, members, groups, role-based permissions, registrations, user preferences, communications, media,
and administrative tools. Its application version is 0.90.1. README.md:1 and WebSite/app/helpers/Application.php:25
2. WebSite/ and test/
- WebSite/ is the deployable PHP application: entry point, domain code, HTTP routes/controllers/APIs, Latte views, database templates/data, assets, Composer dependencies, and PHPUnit unit tests.
- test/ is a separate, custom HTTP route-testing tool—not the PHPUnit suite. It discovers MyClub routes, sends real HTTP requests to a running WebSite instance, and uses its own SQLite file of route test cases/simulations.
WebSite/tests/ is the normal PHPUnit test suite; test/ is black-box/integration-style route testing. WebSite/phpunit.xml:1 and test/FlightRouteTester.php:1
3. dev/
dev/ contains developer and release operations tooling:
- StartPhpServer.sh: prepares writable directories/caches and starts PHP’s built-in server at localhost:8000 using router.php.
- beforeCommit.sh: runs formatting, PHPCS, PHPStan, checks that data helpers have tests, then runs PHPUnit.
- CreateFullInstall.sh: builds the distributable FullInstall.zip.
- CleanForNginx.sh: configures ownership and permissions for web-server deployment.
- Other scripts inspect translation coverage, dependencies, source line counts, and domain/DNS information.
dev/StartPhpServer.sh:1 and dev/beforeCommit.sh:1
4. How test/ interacts with WebSite/
The route tester reads route declarations from WebSite/app/config/Routes.php and WebSite/app/config/routes/*.php, then calls a running site over cURL (default http://localhost:8000). It retains cookies so a login request can
establish a session before testing an authenticated route. test/Infrastructure/RouteTestFactory.php:1 and test/Infrastructure/CurlHttpClient.php:1
Its default run also backs up and temporarily removes WebSite/data/MyClub.sqlite; on the next application request, MyClub recreates it from its bundled database model. It saves that exercised database as test/Database/
lastMyClubTest.sqlite and restores the original at the end. This means the route tester is intentionally stateful and should only be run in an appropriate test/development environment. test/Infrastructure/CurrentWebSite.php:1 and
WebSite/app/models/Database.php:55
5. PHP version and main technologies
The current CLI runtime is PHP 8.4.24. The README advertises PHP >= 8.1, but the locked development stack includes PHPUnit 13.3.2, which requires PHP >= 8.4.1; practically, this checkout’s full dev toolchain targets PHP 8.4+.
Main technologies:
- PHP with Composer/PSR-4
- FlightPHP 3.18.3 routing/web framework
- Latte 3.1.6 templates and Tracy 2.12.0 debugging
- SQLite via PDO, with FluentPDO
- PHPUnit 13, PHPStan, PHPCS, PHP-CS-Fixer
- cURL-based HTTP route runner
- Guzzle, PHPMailer, Mailjet/Brevo integrations, Web Push
- PWA assets/service worker
WebSite/composer.json:1
6. How automated route tests work
There are two complementary modes:
1. Route discovery tests
- A regex-based extractor scans the central route configuration, per-feature route files, and a few static/direct mappings.
- Each discovered route is matched to test/Database/tests.sqlite rows where Step is NULL.
- Parameterized routes must have JsonGetParameters; POST routes require valid JsonPostParameters.
- The tester substitutes Flight-style @parameter path placeholders, optionally logs in using JsonConnectedUser, executes the request, and checks ExpectedResponseCode.
- Optional SQL Query / QueryExpectedResponse assertions validate resulting database state.
2. Simulation tests
- Rows with a non-null Step are loaded in step order.
- Each represents a scripted request, including GET/POST data, authentication, expected HTTP response, and optional database assertion.
- These support workflows and permission permutations beyond individual route coverage.
test/Infrastructure/FlightRouteExtractor.php:1, test/Core/TestExecutor.php:1, and test/Database/tests.sqlite.sql:1
The route-test entry point supports filters such as --test, --simu, --start, --stop, plus JSON/CSV result exports. I did not execute it because its normal workflow modifies database files.
─ Worked for 1m 17s ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Token usage: total=55 378 input=51 643 (+ 203 776 cached) output=3 735 (reasoning 876)
To continue this session, run codex resume and select Analyze MyClub repository.