You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #2 from seabearDEV/claude/verify-codexcli-readme-qVZ44
- Remove redundant resolveKey() call in editEntry (caller already resolves)
- Add edit/e command and --json/-j flag to tab completions
- Interpolate values in --json output mode for get command
- Set process.exitCode=1 for not-found keys in JSON mode
- Log debug warning instead of silently swallowing lock failures
- Add TOCTOU mitigation comment on stale lock removal
- Replace deprecated rmdirSync with rmSync
- Replace dynamic imports with static fs/os/path imports in editEntry
- Reset confirm keys when importing type=all without confirm key present
- Always include searched sub-keys in JSON search output (even when empty)
- Add comment explaining intentional undefined fallthrough in stdin path
- Add backup rotation keeping only 10 most recent backups")
Message now shows the correct command: `set <key> <value> -a <alias>`.
26
+
27
+
### 4. ~~`data export all -o <file>` overwrites same file three times~~ FIXED
28
+
29
+
**File:**`src/commands/data-management.ts`
30
+
31
+
When `type === 'all'` and `-o` is specified, filenames are suffixed with the type (e.g., `backup-entries.json`, `backup-aliases.json`, `backup-confirm.json`).
`codex_run` now imports `hasConfirm` and checks confirm metadata before executing. If an entry has confirm set and `force` is not `true` (and not a dry run), execution is refused with an error message. Added `force` parameter to the tool schema.
42
+
43
+
### 6. ~~Windows clipboard is unsupported~~ FIXED
44
+
45
+
**File:**`src/utils/clipboard.ts`
46
+
47
+
Added `win32` platform support using `clip` command.
48
+
49
+
### 7. ~~Data files use default permissions (0644)~~ FIXED
Added `edit` (alias `e`) command: `ccli edit <key>` opens the value in `$EDITOR`/`$VISUAL`. Supports `--decrypt` for encrypted entries.
68
+
69
+
### 10. ~~MCP has no encryption support (set/get)~~ FIXED
70
+
71
+
`codex_set` now accepts `encrypt` and `password` parameters. `codex_get` now accepts `decrypt` and `password` parameters.
72
+
73
+
### 11. ~~`confirm` is not a standalone export/import type~~ FIXED
74
+
75
+
`confirm` is now a valid standalone type for `data export`, `data import`, and `data reset`. Also added to MCP `codex_export`, `codex_import`, and `codex_reset`.
76
+
77
+
### 12. ~~No file locking for concurrent access~~ FIXED
78
+
79
+
Added advisory file locking (`src/utils/fileLock.ts`) using `.lock` files with atomic `O_CREAT|O_EXCL`. Integrated into `saveJsonSorted` — all writes are now lock-protected. Stale locks (>10s) are automatically broken.
80
+
81
+
### 13. ~~No auto-backup before destructive operations~~ FIXED
82
+
83
+
Added `src/utils/autoBackup.ts`. Automatic backups are created in `~/.codexcli/.backups/` before `data reset` and non-merge `data import`.
84
+
85
+
### 14. ~~No `--json` output format~~ FIXED
86
+
87
+
Added `--json` / `-j` flag to `get` and `find` commands for machine-readable JSON output.
88
+
89
+
---
90
+
91
+
## P3 — Nice-to-Have Features
92
+
93
+
### 15. Fish/PowerShell shell completion
94
+
95
+
Only Bash and Zsh are supported. Fish and PowerShell users get no completions or wrapper.
96
+
97
+
### 16. No `copy`/`cp` command
98
+
99
+
Cannot duplicate an entry to a new key without get + set.
100
+
101
+
### 17. No import preview/diff
102
+
103
+
`data import --merge` silently overwrites conflicting keys with no way to preview what will change.
104
+
105
+
### 18. No advanced search (regex, boolean operators)
106
+
107
+
`find` only does case-insensitive substring matching. No regex, field-specific search, or boolean operators.
108
+
109
+
### 19. No backup rotation / automatic backup management
110
+
111
+
No built-in way to maintain a set of N recent backups.
112
+
113
+
### 20. No command output capture
114
+
115
+
`run` inherits stdio — no way to capture command output for chaining.
116
+
117
+
### 21. No change log / audit trail
118
+
119
+
No record of what was added, changed, or deleted over time.
120
+
121
+
### 22. No fuzzy finder integration
122
+
123
+
No `fzf` or similar interactive selection for keys.
124
+
125
+
### 23. No conditional interpolation
126
+
127
+
No `${ref:-default}` or `${ref:?error}` syntax for fallback values.
128
+
129
+
### 24. No batch operations
130
+
131
+
Cannot set multiple entries in one command.
132
+
133
+
---
134
+
135
+
## Summary
136
+
137
+
| Priority | Count | Description |
138
+
|----------|-------|-------------|
139
+
|**P0**| 4 |~~Bugs showing incorrect info or causing data loss~~ ALL FIXED |
140
+
|**P1**| 3 |~~Security and platform gaps~~ ALL FIXED |
-**Search**: Find entries by searching keys or values
43
44
-**Tree Visualization**: Display nested data in a tree-like structure
44
-
-**Clipboard Integration**: Copy values directly to clipboard
45
+
-**Clipboard Integration**: Copy values directly to clipboard (macOS, Linux, Windows)
46
+
-**Inline Editing**: Open entries in `$EDITOR` / `$VISUAL` for quick edits
47
+
-**JSON Output**: Machine-readable `--json` flag on `get` and `find` for scripting
48
+
-**Stdin Piping**: Pipe values into `set` from other commands
49
+
-**Auto-Backup**: Automatic timestamped backups before destructive operations
50
+
-**File Locking**: Advisory locking prevents data corruption from concurrent access
45
51
-**Shell Tab-Completion**: Full tab-completion for Bash and Zsh (commands, flags, keys, aliases)
46
52
-**MCP Server**: Expose CodexCLI as a tool for AI agents (Claude Code, Claude Desktop) via the Model Context Protocol
47
53
@@ -84,6 +90,8 @@ ccli
84
90
85
91
### Install from Source
86
92
93
+
> **Note:** Installing from source registers the development binary `cclid` (not `ccli`). All examples in this README use `ccli`, but substitute `cclid` if you installed from source. The production `ccli` binary is available via Homebrew or the GitHub Releases download above.
94
+
87
95
Ensure npm's global binaries are in your PATH by adding the following to your shell profile (`.bashrc`, `.zshrc`, or equivalent):
88
96
89
97
```bash
@@ -98,7 +106,7 @@ npm run build
98
106
npm install -g .
99
107
```
100
108
101
-
If `ccli` is not found after installing, verify that npm's global bin directory is in your PATH:
109
+
If `cclid` is not found after installing, verify that npm's global bin directory is in your PATH:
102
110
103
111
```bash
104
112
echo$PATH| grep -o "$(npm config get prefix)/bin"
@@ -135,6 +143,12 @@ ccli set commands.deploy "./deploy.sh" --confirm
135
143
136
144
# Remove the confirmation requirement from an entry
137
145
ccli set commands.deploy --no-confirm
146
+
147
+
# Pipe a value from stdin
148
+
echo"my value"| ccli set mykey
149
+
150
+
# Pipe from another command
151
+
curl -s https://api.example.com/token | ccli set api.token
138
152
```
139
153
140
154
After setting an entry, you'll be asked interactively whether it should require confirmation to run. Use `--confirm` or `--no-confirm` to skip the prompt.
@@ -166,6 +180,9 @@ ccli get api.key -d
166
180
# Copy value to clipboard
167
181
ccli get server.ip -c
168
182
183
+
# Output as JSON (for scripting)
184
+
ccli get server --json
185
+
169
186
# Show aliases only
170
187
ccli get -a
171
188
```
@@ -218,6 +235,9 @@ ccli find ip -a
218
235
219
236
# Show results as a tree
220
237
ccli find server -t
238
+
239
+
# Output as JSON (for scripting)
240
+
ccli find prod --json
221
241
```
222
242
223
243
### Aliases
@@ -260,6 +280,18 @@ ccli rename -a oldalias newalias
260
280
ccli rename server.old server.new --set-alias sn
261
281
```
262
282
283
+
### Editing Data
284
+
285
+
Open a stored value in your `$EDITOR` (or `$VISUAL`) for inline editing:
286
+
287
+
```bash
288
+
# Edit an entry in your default editor
289
+
ccli edit server.production.ip
290
+
291
+
# Edit an encrypted entry (decrypts before editing, re-encrypts on save)
292
+
ccli edit api.key --decrypt
293
+
```
294
+
263
295
### Removing Data
264
296
265
297
Removing an entry prompts for confirmation. Use `-f` to skip.
> **Auto-backup:** Before destructive operations (`data reset`, non-merge `data import`), CodexCLI automatically creates a timestamped backup in `~/.codexcli/.backups/`.
417
+
378
418
### Shell Wrapper
379
419
380
420
By default, `ccli run` executes commands in a child process. This means shell builtins like `cd`, `export`, and `alias` have no effect on your current shell.
0 commit comments