Skip to content

cli path & tilde expansion - #55

Closed
Dheerajsom wants to merge 3 commits into
openai:mainfrom
Dheerajsom:opus/cli-path-tilde-expansion
Closed

cli path & tilde expansion#55
Dheerajsom wants to merge 3 commits into
openai:mainfrom
Dheerajsom:opus/cli-path-tilde-expansion

Conversation

@Dheerajsom

Copy link
Copy Markdown

No description provided.

`codex-security scan` expands `~` in its repository, path, and
`--output-dir` arguments (targets.ts, runtime.ts), but the CLI layer
resolved several other user-supplied paths with a bare `resolve()`.
Because PowerShell never expands `~` for native command arguments -- and
no shell expands it inside quotes -- `~/security-scans` reached the CLI
verbatim and became a directory literally named `~` under the current
directory:

    codex-security bulk-scan repos.csv --output-dir ~/security-scans
    # wrote ./~/security-scans instead of $HOME/security-scans

Scan results landed somewhere the user did not expect, a stray `~`
directory was left behind, and resuming the campaign from another
directory could not find the ledger.

Route the affected arguments through a shared `resolveCliPath` helper so
they expand `~` like the rest of the toolchain: `bulk-scan <input>` and
`--output-dir`, `export <scan-dir>`, `--output`, and `--source-root`,
`scans list <repository>` and `--scan-root`, and the `install-hook`
repository. The interactive bulk-scan wizard expands the output
directory it prompts for as well.
The personal-account fix replaced the only multi-organization test, so
nothing checked that every organization still appears in the picker or
that the list stays sorted. Restore that case and add one for accounts
with no organizations, which must skip the prompt entirely.
@Dheerajsom Dheerajsom closed this Jul 29, 2026
@Dheerajsom
Dheerajsom deleted the opus/cli-path-tilde-expansion branch July 29, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant