2025-04-16 12:56:08 -04:00
|
|
|
{
|
|
|
|
|
"name": "@openai/codex",
|
2025-04-30 17:55:34 -07:00
|
|
|
"version": "0.1.2504301751",
|
2025-04-16 12:56:08 -04:00
|
|
|
"license": "Apache-2.0",
|
|
|
|
|
"bin": {
|
2025-04-18 14:35:51 -04:00
|
|
|
"codex": "bin/codex.js"
|
2025-04-16 12:56:08 -04:00
|
|
|
},
|
|
|
|
|
"type": "module",
|
|
|
|
|
"engines": {
|
|
|
|
|
"node": ">=22"
|
|
|
|
|
},
|
|
|
|
|
"scripts": {
|
|
|
|
|
"format": "prettier --check src tests",
|
|
|
|
|
"format:fix": "prettier --write src tests",
|
|
|
|
|
"dev": "tsc --watch",
|
|
|
|
|
"lint": "eslint src tests --ext ts --ext tsx --report-unused-disable-directives --max-warnings 0",
|
|
|
|
|
"lint:fix": "eslint src tests --ext ts --ext tsx --fix",
|
|
|
|
|
"test": "vitest run",
|
|
|
|
|
"test:watch": "vitest --watch",
|
|
|
|
|
"typecheck": "tsc --noEmit",
|
|
|
|
|
"build": "node build.mjs",
|
2025-04-16 13:21:22 -07:00
|
|
|
"build:dev": "NODE_ENV=development node build.mjs --dev && NODE_OPTIONS=--enable-source-maps node dist/cli-dev.js",
|
2025-05-01 08:36:07 -07:00
|
|
|
"stage-release": "./scripts/stage_release.sh"
|
2025-04-16 12:56:08 -04:00
|
|
|
},
|
|
|
|
|
"files": [
|
2025-05-12 13:38:10 -07:00
|
|
|
"bin",
|
2025-04-21 12:56:00 -04:00
|
|
|
"dist"
|
2025-04-16 12:56:08 -04:00
|
|
|
],
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"@inkjs/ui": "^2.0.0",
|
|
|
|
|
"chalk": "^5.2.0",
|
|
|
|
|
"diff": "^7.0.0",
|
2025-04-16 18:33:12 -04:00
|
|
|
"dotenv": "^16.1.4",
|
2025-05-16 12:28:54 -07:00
|
|
|
"express": "^5.1.0",
|
2025-04-16 20:52:35 -07:00
|
|
|
"fast-deep-equal": "^3.1.3",
|
refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446)
## Background
Addressing feedback from
https://github.com/openai/codex/pull/333#discussion_r2050893224, this PR
adds support for Bun alongside npm, pnpm while keeping the code simple.
## Summary
The update‑check flow is refactored to use a direct registry lookup
(`fast-npm-meta` + `semver`) instead of shelling out to `npm outdated`,
and adds a lightweight installer‑detection mechanism that:
1. Checks if the invoked script lives under a known global‑bin directory
(npm, pnpm, or bun)
2. If not, falls back to local detection via `getUserAgent()` (the
`package‑manager‑detector` library)
## What’s Changed
- **Registry‑based version check**
- Replace `execFile("npm", ["outdated"])` with `getLatestVersion()` and
`semver.gt()`
- **Multi‑manager support**
- New `renderUpdateCommand` handles update commands for `npm`, `pnpm`,
and `bun`.
- Detect global installer first via `detectInstallerByPath()`
- Fallback to local detection via `getUserAgent()`
- **Module cleanup**
- Extract `detectInstallerByPath` into
`utils/package-manager-detector.ts`
- Remove legacy `checkOutdated`, `getNPMCommandPath`, and child‑process
JSON parsing
- **Flow improvements in `checkForUpdates`**
1. Short‑circuit by `UPDATE_CHECK_FREQUENCY`
3. Fetch & compare versions
4. Persist new timestamp immediately
5. Render & display styled box only when an update exists
- **Maintain simplicity**
- All multi‑manager logic lives in one small helper and a concise lookup
rather than a complex adapter hierarchy
- Core `checkForUpdates` remains a single, easy‑to‑follow async function
- **Dependencies added**
- `fast-npm-meta`, `semver`, `package-manager-detector`, `@types/semver`
## Considerations
If we decide to drop the interactive update‑message (`npm install -g
@openai/codex`) rendering altogether, we could remove most of the
installer‑detection code and dependencies, which would simplify the
codebase further but result in a less friendly UX.
## Preview
* npm

* bun

## Simple Flow Chart
```mermaid
flowchart TD
A(Start) --> B[Read state]
B --> C{Recent check?}
C -- Yes --> Z[End]
C -- No --> D[Fetch latest version]
D --> E[Save check time]
E --> F{Version data OK?}
F -- No --> Z
F -- Yes --> G{Update available?}
G -- No --> Z
G -- Yes --> H{Global install?}
H -- Yes --> I[Select global manager]
H -- No --> K{Local install?}
K -- No --> Z
K -- Yes --> L[Select local manager]
I & L --> M[Render update message]
M --> N[Format with boxen]
N --> O[Print update]
O --> Z
```
2025-04-21 15:00:20 +08:00
|
|
|
"fast-npm-meta": "^0.4.2",
|
2025-04-18 06:28:58 +10:00
|
|
|
"figures": "^6.1.0",
|
2025-04-16 12:56:08 -04:00
|
|
|
"file-type": "^20.1.0",
|
2025-05-02 12:08:13 -07:00
|
|
|
"https-proxy-agent": "^7.0.6",
|
2025-04-16 12:56:08 -04:00
|
|
|
"ink": "^5.2.0",
|
2025-04-18 06:28:58 +10:00
|
|
|
"js-yaml": "^4.1.0",
|
2025-04-16 12:56:08 -04:00
|
|
|
"marked": "^15.0.7",
|
|
|
|
|
"marked-terminal": "^7.3.0",
|
|
|
|
|
"meow": "^13.2.0",
|
|
|
|
|
"open": "^10.1.0",
|
2025-04-18 18:13:34 -07:00
|
|
|
"openai": "^4.95.1",
|
refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446)
## Background
Addressing feedback from
https://github.com/openai/codex/pull/333#discussion_r2050893224, this PR
adds support for Bun alongside npm, pnpm while keeping the code simple.
## Summary
The update‑check flow is refactored to use a direct registry lookup
(`fast-npm-meta` + `semver`) instead of shelling out to `npm outdated`,
and adds a lightweight installer‑detection mechanism that:
1. Checks if the invoked script lives under a known global‑bin directory
(npm, pnpm, or bun)
2. If not, falls back to local detection via `getUserAgent()` (the
`package‑manager‑detector` library)
## What’s Changed
- **Registry‑based version check**
- Replace `execFile("npm", ["outdated"])` with `getLatestVersion()` and
`semver.gt()`
- **Multi‑manager support**
- New `renderUpdateCommand` handles update commands for `npm`, `pnpm`,
and `bun`.
- Detect global installer first via `detectInstallerByPath()`
- Fallback to local detection via `getUserAgent()`
- **Module cleanup**
- Extract `detectInstallerByPath` into
`utils/package-manager-detector.ts`
- Remove legacy `checkOutdated`, `getNPMCommandPath`, and child‑process
JSON parsing
- **Flow improvements in `checkForUpdates`**
1. Short‑circuit by `UPDATE_CHECK_FREQUENCY`
3. Fetch & compare versions
4. Persist new timestamp immediately
5. Render & display styled box only when an update exists
- **Maintain simplicity**
- All multi‑manager logic lives in one small helper and a concise lookup
rather than a complex adapter hierarchy
- Core `checkForUpdates` remains a single, easy‑to‑follow async function
- **Dependencies added**
- `fast-npm-meta`, `semver`, `package-manager-detector`, `@types/semver`
## Considerations
If we decide to drop the interactive update‑message (`npm install -g
@openai/codex`) rendering altogether, we could remove most of the
installer‑detection code and dependencies, which would simplify the
codebase further but result in a less friendly UX.
## Preview
* npm

* bun

## Simple Flow Chart
```mermaid
flowchart TD
A(Start) --> B[Read state]
B --> C{Recent check?}
C -- Yes --> Z[End]
C -- No --> D[Fetch latest version]
D --> E[Save check time]
E --> F{Version data OK?}
F -- No --> Z
F -- Yes --> G{Update available?}
G -- No --> Z
G -- Yes --> H{Global install?}
H -- Yes --> I[Select global manager]
H -- No --> K{Local install?}
K -- No --> Z
K -- Yes --> L[Select local manager]
I & L --> M[Render update message]
M --> N[Format with boxen]
N --> O[Print update]
O --> Z
```
2025-04-21 15:00:20 +08:00
|
|
|
"package-manager-detector": "^1.2.0",
|
2025-04-16 12:56:08 -04:00
|
|
|
"react": "^18.2.0",
|
|
|
|
|
"shell-quote": "^1.8.2",
|
2025-04-18 06:28:58 +10:00
|
|
|
"strip-ansi": "^7.1.0",
|
2025-04-16 20:52:35 -07:00
|
|
|
"to-rotated": "^1.0.0",
|
2025-04-18 06:28:58 +10:00
|
|
|
"use-interval": "1.4.0",
|
|
|
|
|
"zod": "^3.24.3"
|
2025-04-16 12:56:08 -04:00
|
|
|
},
|
|
|
|
|
"devDependencies": {
|
|
|
|
|
"@eslint/js": "^9.22.0",
|
|
|
|
|
"@types/diff": "^7.0.2",
|
2025-05-16 12:28:54 -07:00
|
|
|
"@types/express": "^5.0.1",
|
2025-04-16 12:56:08 -04:00
|
|
|
"@types/js-yaml": "^4.0.9",
|
|
|
|
|
"@types/marked-terminal": "^6.1.1",
|
|
|
|
|
"@types/react": "^18.0.32",
|
refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446)
## Background
Addressing feedback from
https://github.com/openai/codex/pull/333#discussion_r2050893224, this PR
adds support for Bun alongside npm, pnpm while keeping the code simple.
## Summary
The update‑check flow is refactored to use a direct registry lookup
(`fast-npm-meta` + `semver`) instead of shelling out to `npm outdated`,
and adds a lightweight installer‑detection mechanism that:
1. Checks if the invoked script lives under a known global‑bin directory
(npm, pnpm, or bun)
2. If not, falls back to local detection via `getUserAgent()` (the
`package‑manager‑detector` library)
## What’s Changed
- **Registry‑based version check**
- Replace `execFile("npm", ["outdated"])` with `getLatestVersion()` and
`semver.gt()`
- **Multi‑manager support**
- New `renderUpdateCommand` handles update commands for `npm`, `pnpm`,
and `bun`.
- Detect global installer first via `detectInstallerByPath()`
- Fallback to local detection via `getUserAgent()`
- **Module cleanup**
- Extract `detectInstallerByPath` into
`utils/package-manager-detector.ts`
- Remove legacy `checkOutdated`, `getNPMCommandPath`, and child‑process
JSON parsing
- **Flow improvements in `checkForUpdates`**
1. Short‑circuit by `UPDATE_CHECK_FREQUENCY`
3. Fetch & compare versions
4. Persist new timestamp immediately
5. Render & display styled box only when an update exists
- **Maintain simplicity**
- All multi‑manager logic lives in one small helper and a concise lookup
rather than a complex adapter hierarchy
- Core `checkForUpdates` remains a single, easy‑to‑follow async function
- **Dependencies added**
- `fast-npm-meta`, `semver`, `package-manager-detector`, `@types/semver`
## Considerations
If we decide to drop the interactive update‑message (`npm install -g
@openai/codex`) rendering altogether, we could remove most of the
installer‑detection code and dependencies, which would simplify the
codebase further but result in a less friendly UX.
## Preview
* npm

* bun

## Simple Flow Chart
```mermaid
flowchart TD
A(Start) --> B[Read state]
B --> C{Recent check?}
C -- Yes --> Z[End]
C -- No --> D[Fetch latest version]
D --> E[Save check time]
E --> F{Version data OK?}
F -- No --> Z
F -- Yes --> G{Update available?}
G -- No --> Z
G -- Yes --> H{Global install?}
H -- Yes --> I[Select global manager]
H -- No --> K{Local install?}
K -- No --> Z
K -- Yes --> L[Select local manager]
I & L --> M[Render update message]
M --> N[Format with boxen]
N --> O[Print update]
O --> Z
```
2025-04-21 15:00:20 +08:00
|
|
|
"@types/semver": "^7.7.0",
|
2025-04-16 12:56:08 -04:00
|
|
|
"@types/shell-quote": "^1.7.5",
|
2025-04-19 08:00:45 +08:00
|
|
|
"@types/which": "^3.0.4",
|
2025-04-16 12:56:08 -04:00
|
|
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
|
|
|
"@typescript-eslint/parser": "^7.18.0",
|
2025-04-19 08:00:45 +08:00
|
|
|
"boxen": "^8.0.1",
|
2025-04-16 13:47:36 -07:00
|
|
|
"esbuild": "^0.25.2",
|
2025-04-16 12:56:08 -04:00
|
|
|
"eslint-plugin-import": "^2.31.0",
|
|
|
|
|
"eslint-plugin-react": "^7.32.2",
|
|
|
|
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
|
|
|
"eslint-plugin-react-refresh": "^0.4.19",
|
2025-04-17 14:18:43 +00:00
|
|
|
"husky": "^9.1.7",
|
2025-04-16 12:56:08 -04:00
|
|
|
"ink-testing-library": "^3.0.0",
|
2025-04-25 22:21:50 +08:00
|
|
|
"prettier": "^3.5.3",
|
2025-04-16 12:56:08 -04:00
|
|
|
"punycode": "^2.3.1",
|
refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446)
## Background
Addressing feedback from
https://github.com/openai/codex/pull/333#discussion_r2050893224, this PR
adds support for Bun alongside npm, pnpm while keeping the code simple.
## Summary
The update‑check flow is refactored to use a direct registry lookup
(`fast-npm-meta` + `semver`) instead of shelling out to `npm outdated`,
and adds a lightweight installer‑detection mechanism that:
1. Checks if the invoked script lives under a known global‑bin directory
(npm, pnpm, or bun)
2. If not, falls back to local detection via `getUserAgent()` (the
`package‑manager‑detector` library)
## What’s Changed
- **Registry‑based version check**
- Replace `execFile("npm", ["outdated"])` with `getLatestVersion()` and
`semver.gt()`
- **Multi‑manager support**
- New `renderUpdateCommand` handles update commands for `npm`, `pnpm`,
and `bun`.
- Detect global installer first via `detectInstallerByPath()`
- Fallback to local detection via `getUserAgent()`
- **Module cleanup**
- Extract `detectInstallerByPath` into
`utils/package-manager-detector.ts`
- Remove legacy `checkOutdated`, `getNPMCommandPath`, and child‑process
JSON parsing
- **Flow improvements in `checkForUpdates`**
1. Short‑circuit by `UPDATE_CHECK_FREQUENCY`
3. Fetch & compare versions
4. Persist new timestamp immediately
5. Render & display styled box only when an update exists
- **Maintain simplicity**
- All multi‑manager logic lives in one small helper and a concise lookup
rather than a complex adapter hierarchy
- Core `checkForUpdates` remains a single, easy‑to‑follow async function
- **Dependencies added**
- `fast-npm-meta`, `semver`, `package-manager-detector`, `@types/semver`
## Considerations
If we decide to drop the interactive update‑message (`npm install -g
@openai/codex`) rendering altogether, we could remove most of the
installer‑detection code and dependencies, which would simplify the
codebase further but result in a less friendly UX.
## Preview
* npm

* bun

## Simple Flow Chart
```mermaid
flowchart TD
A(Start) --> B[Read state]
B --> C{Recent check?}
C -- Yes --> Z[End]
C -- No --> D[Fetch latest version]
D --> E[Save check time]
E --> F{Version data OK?}
F -- No --> Z
F -- Yes --> G{Update available?}
G -- No --> Z
G -- Yes --> H{Global install?}
H -- Yes --> I[Select global manager]
H -- No --> K{Local install?}
K -- No --> Z
K -- Yes --> L[Select local manager]
I & L --> M[Render update message]
M --> N[Format with boxen]
N --> O[Print update]
O --> Z
```
2025-04-21 15:00:20 +08:00
|
|
|
"semver": "^7.7.1",
|
2025-04-16 12:56:08 -04:00
|
|
|
"ts-node": "^10.9.1",
|
|
|
|
|
"typescript": "^5.0.3",
|
2025-05-02 09:30:08 -07:00
|
|
|
"vite": "^6.3.4",
|
|
|
|
|
"vitest": "^3.1.2",
|
2025-04-19 08:00:45 +08:00
|
|
|
"whatwg-url": "^14.2.0",
|
|
|
|
|
"which": "^5.0.0"
|
2025-04-16 12:56:08 -04:00
|
|
|
},
|
2025-04-16 13:00:18 -04:00
|
|
|
"repository": {
|
|
|
|
|
"type": "git",
|
|
|
|
|
"url": "https://github.com/openai/codex"
|
2025-04-16 12:56:08 -04:00
|
|
|
}
|
|
|
|
|
}
|