Skip to content

Commit 594604f

Browse files
mldangelo-oaicodex
andauthored
feat(cli): make project setup and authentication easier to inspect (#2581)
* feat(cli): expose identifiers for saved scan follow-up * test(sdk): exercise dedupe representatives in publication * feat(cli): make project setup and authentication easier to inspect * docs(cli): distinguish sign-in flows and credential sources * feat(cli): link interrupted scans and imported evidence to their next commands * fix(cli): make command help and discovery reflect runnable workflows * build(sdk): include the command argument helper in package checks * refactor(cli): reuse shell path quoting for project previews * docs(cli): identify the shell used for Windows preview commands * test(cli): account for the internal publication CSV in help coverage * fix(cli): scope recovery hints to supported sessions and shells * fix(cli): declare exclusive scan import sources in the schema * refactor(cli): share credential locking and project preview preparation * fix(cli): resolve repository arguments consistently during scan discovery * refactor(cli): simplify the result handoffs and verify PowerShell recovery * fix(cli): check sign-in from the same directory in every format * fix(cli): preserve diagnostics when project initialization fails --------- Co-authored-by: Codex <noreply@openai.com>
1 parent 507e10a commit 594604f

8 files changed

Lines changed: 336 additions & 122 deletions

File tree

‎docs/project-configuration.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ codex-security info -c codex-security.yaml --json
3636
codex-security scan . -c codex-security.yaml --dry-run --json
3737
```
3838

39+
The init command prints a preview command using the file it created. On Windows the displayed command uses PowerShell syntax. It includes an editor schema hint when the package is installed in the project. With a global installation the starter contains an empty mapping, which you can replace with your settings. The CLI always validates the file with its bundled schema.
40+
3941
Check that the preview shows your intended repository and scope. To start the
4042
scan with those settings, keep the same file selection:
4143

‎sdk/typescript/TESTING.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@ pnpm --dir ../../plugins/codex-security/mcp-app install --frozen-lockfile
1212

1313
The commands below run from `sdk/typescript` unless a different directory is named. For a test that builds or loads the bundled plugin, first [download the universal native payload](../../plugins/codex-security/native/README.md#package-inputs). The SDK’s `test`, `test:ci`, `test:mcp` and `prepack` scripts all build that bundle.
1414

15+
## Run the CLI from your checkout
16+
17+
From the repository root, use the source entry point to iterate on commands and help:
18+
19+
```sh
20+
bun sdk/typescript/src/cli.ts scan --help
21+
```
22+
23+
For the Node launcher that npm installs as `cs`, build the SDK first:
24+
25+
```sh
26+
pnpm --dir sdk/typescript run build
27+
node sdk/typescript/bin/codex-security.mjs scan --help
28+
node sdk/typescript/bin/codex-security.mjs scan . --dry-run --json
29+
```
30+
31+
Saved history, exports, and commands that run the bundled plugin also need the native payload described above and `pnpm --dir sdk/typescript run build:plugin`. The `build:ci` script compiles the repository’s CI helpers.
32+
1533
## Run a focused test
1634

1735
Run the file for the behavior you changed. This example exercises progress parsing:

‎sdk/typescript/docs/cli.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ If Codex Security reports that the refresh token was already used, run
156156
`codex-security logout`, then `codex-security login`. If your Codex CLI or app
157157
reports that error, sign out and sign back in there.
158158

159+
Use `codex-security login status --json` in automation. Its stdout reports `authenticated`, the effective authentication `method`, and the environment variable name when an API key takes precedence. Native diagnostics go to stderr. The command keeps the exit status of the human-readable status check.
160+
159161
For other refresh errors, check `codex-security login status`. Retry if the
160162
sign-in recently changed. Otherwise run `codex-security logout`, then
161163
`codex-security login`.

0 commit comments

Comments
 (0)