[privacy-export] Propose CLI command schema for Codex local export#29461
Draft
marco-openai wants to merge 1 commit into
Draft
[privacy-export] Propose CLI command schema for Codex local export#29461marco-openai wants to merge 1 commit into
marco-openai wants to merge 1 commit into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
71a6acc to
2097ec6
Compare
2097ec6 to
a790400
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR proposes the CLI contract before exposing or implementing it. The planned local export should stay close to the existing Codex DSR shape: task identity/title/archive state plus ordered user and assistant turns, rather than becoming a general backup of
~/.codex.The implementation should remain deliberately small: copy files that already match the task/turn intent, modify only included files with a concrete credential-leak risk, and leave everything else out - the files are already available to the user, this is a simpler and safer alternative for them to access their local Codex files.
This PR still adds no production command, dispatch, or export behavior.
Proposed CLI
The command schema is test-only. Snapshots make the proposed command name, subcommand, positional argument, and help text reviewable without releasing them.
Proposed file scope
1. Ready as-is
sessions/**/*.jsonl: active task conversations, including user and assistant turns and their associated tool activity.archived_sessions/**/*.jsonl: archived task conversations. The directory location preserves archived state.session_index.jsonl: task/session ID, thread title, and update time.history.jsonl: user-entered text keyed by session ID and timestamp.AGENTS.md: global user-authored instructions, analogous to custom instructions in user turns. Include only when the file exists.These files are copied without record-level transformation. User-provided content is the subject of the export, so this phase does not attempt heuristic redaction of prompts, responses, or tool output.
2. Needs modification before inclusion
config.tomlrequires transformation before export. Remove literal values from MCP env andhttp_headers, and model-providerexperimental_bearer_tokenandhttp_headers. Preserve environment-variable references.3. Not included
auth.json,.credentials.json,app-server-signing-secret,secrets/**,.sandbox-secrets/**, and similar files if present.state_5.sqlite*,.codex-global-state.json,.codex-global-state.json.bak,memories_1.sqlite*,goals_1.sqlite*,logs_2.sqlite*,codex-dev.db, and SQLite WAL/SHM files.codex.jsontask/turn intent:memories/**,agents/**,automations/**,rules/**,computer-use/**, andambient-suggestions/**.installation_id,version.json,models_cache.json, cloud cache files, native-host config, and migration markers.log/**,shell_snapshots/**,node_repl/**,process_manager/**,host-cache/**, andvisualizations/**.cache/**,plugins/**,skills/**,vendor_imports/**,worktrees/**,avatars/**,pets/**,.tmp/**,tmp/**, Git metadata, and symlinks.User impact
None.
privacyis explicitly absent from the production command tree.Validation
just test -p codex-cli privacycodex privacyandcodex privacy export <PATH>