zarz 0.5.0-alpha → 0.5.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +69 -34
  3. package/package.json +3 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ ## 0.5.0-ALPHA
4
+
5
+ ### New Native tooling
6
+ - Added native `read_file`, `list_dir`, `grep_files`, and `apply_patch` handlers; the AI no longer needs to shell out to `bash` for routine context gathering.
7
+ - `apply_patch` now applies Zarz-style diffs directly (Add/Update/Delete blocks) with safe path resolution.
8
+ - Tool invocations log like “• Explored…” summaries so the terminal stays concise while OpenAI still receives the full output.
9
+
10
+ ### Prompt and UX cleanup
11
+ - Updated README.md to describe the new tool stack and exploration logs.
12
+
13
+ ### Codex authentication
14
+ - Added full ChatGPT OAuth wizard, including PKCE, `originator=zarz_cli`, and first-party success page branded “Signed in to ZarzCLI”.
15
+ - Stored access/refresh/id tokens plus `project_id`, `organization_id`, and `chatgpt_account_id` in `~/.zarz/config.toml` with automatic refresh before every run.
16
+ - Exported Codex environment variables (`OPENAI_API_URL`, `OpenAI-Beta`, `originator`, etc.) so GPT‑5 presets transparently call the ChatGPT backend without requiring an API key.
17
+
18
+ ### Responses API compatibility
19
+ - OpenAI provider now detects when Codex headers are required, converts system prompts into Codex “instructions”, filters unsupported roles, and parses SSE responses with encrypted reasoning content.
20
+ - Removed legacy tool-call throttling and forced filler replies—models can keep invoking tools with clean, autonomous logs.
21
+
22
+ ### User-facing polish
23
+ - login-success HTML (with ZarzCLI branding) for a consistent OAuth experience.
24
+ - Documented the new flow, GPT‑5 presets, and References workspace inside `README.md`.
25
+ - Ignored `References/` in git so upstream mirrors don’t pollute commits.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # ZarzCLI
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/zarz.svg)](https://www.npmjs.com/package/zarz)
4
- [![npm downloads](https://img.shields.io/npm/dd/zarz.svg)](https://www.npmjs.com/package/zarz)
4
+ [![npm downloads](https://img.shields.io/npm/dw/zarz.svg)](https://www.npmjs.com/package/zarz)
5
5
  [![GitHub release](https://img.shields.io/github/v/release/zarzet/ZarzCLI.svg)](https://github.com/zarzet/ZarzCLI/releases)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
@@ -12,10 +12,11 @@
12
12
  ### Core Capabilities
13
13
  - **Interactive Chat** - Real-time streaming responses with multiple AI models
14
14
  - **Multi-Provider Support** - Claude (Anthropic), GPT (OpenAI), and GLM (Z.AI)
15
- - **Bash Tool Calling** - AI can autonomously execute bash commands to understand your codebase
15
+ - **Built-In Tools** - `read_file`, `list_dir`, `grep_files`, and `apply_patch` run natively
16
16
  - **File Operations** - Direct file editing, creation, and management
17
17
  - **Smart Context** - Automatic symbol search and relevant file detection
18
18
  - **MCP Support** - Model Context Protocol integration for extended capabilities
19
+ - **ChatGPT OAuth (Codex backend)** - `/login` signs into ChatGPT Plus/Pro, tokens auto-refresh, and GPT‑5 presets call the same Codex endpoint as OpenAI’s CLI
19
20
  - **Auto Update** - Automatic update checks and notifications for new versions
20
21
  - **Cross-Platform** - Works seamlessly on Windows, Linux, and macOS
21
22
 
@@ -28,14 +29,27 @@ ZarzCLI v0.3.4+ includes autonomous bash tool execution, allowing AI models to:
28
29
  - **Navigate structure**: `ls -la src/` or `tree -L 2`
29
30
  - **Check git**: `git log --oneline -10` or `git diff`
30
31
 
31
- The AI automatically decides when to execute commands for better context - no manual `/run` needed!
32
-
33
32
  ### User Experience
34
33
  - **Status Line** - Shows current mode and notifications
35
34
  - **Double Ctrl+C** - Confirmation before exit (prevents accidental exits)
36
35
  - **Colored Diff Display** - Beautiful file change visualization with context
36
+ - **Exploration Logs** - File reads, directory listings, and searches are summarized concisely (no more full file dumps unless requested)
37
37
  - **Persistent Sessions** - Resume previous conversations anytime
38
38
 
39
+ ### Built-In Tools
40
+ ZarzCLI now has tool set:
41
+
42
+ | Tool | Description |
43
+ |------|-------------|
44
+ | `read_file` | Reads files with optional line slices; stdout just shows a summary |
45
+ | `list_dir` | Returns file/dir counts with a short preview instead of dumping everything |
46
+ | `grep_files` | Greps inside a file (simple substring match) |
47
+ | `apply_patch` | Applies Zarz-style `*** Begin Patch` diffs directly on disk |
48
+
49
+ These tools run natively in Rust, so the terminal output is clean and the model still receives full context in the background.
50
+
51
+ > **No more artificial tool-call limits** – ZarzCLI lets the agent keep digging until it’s satisfied. The old “Stopping tool execution after 3 calls” guardrails have been removed.
52
+
39
53
  ## Installation
40
54
 
41
55
  ### Via NPM (Recommended)
@@ -93,14 +107,25 @@ zarz
93
107
  # Quick one-shot question
94
108
  zarz --message "fix this bug"
95
109
 
96
- # Use specific model
97
- zarz --model claude-sonnet-4-5-20250929
98
-
99
- # Manage configuration
100
- zarz config --show # Show current config
101
- zarz config --reset # Reconfigure API keys
102
- zarz config --login-chatgpt # Sign in via ChatGPT OAuth to fetch an OpenAI key
103
- ```
110
+ # Use specific model
111
+ zarz --model claude-sonnet-4-5-20250929
112
+
113
+ # Manage configuration
114
+ zarz config --show # Show current config
115
+ zarz config --reset # Reconfigure API keys
116
+ zarz config --login-chatgpt # Sign in via ChatGPT OAuth to fetch an OpenAI key
117
+ ```
118
+
119
+ ### ChatGPT OAuth (Codex-compatible)
120
+
121
+ When you run `zarz config --login-chatgpt` or `/login` → “Sign in with ChatGPT”, ZarzCLI mirrors the official Codex CLI flow:
122
+
123
+ 1. OpenAI’s OAuth screen appears (PKCE + `originator=zarz_cli`).
124
+ 2. After you approve, ZarzCLI shows the **“Signed in to ZarzCLI”** success page.
125
+ 3. The CLI stores the returned `access_token`, `refresh_token`, `id_token`, plus `project_id`, `organization_id`, and `chatgpt_account_id` in `~/.zarz/config.toml`.
126
+ 4. Before every run, ZarzCLI automatically refreshes the token if it’s near expiry and exports
127
+
128
+ All GPT‑5 presets then hit the ChatGPT Codex backend (`OpenAI-Beta: responses=experimental`, `originator: codex_cli_rs`) with the official Codex instructions so behavior matches OpenAI’s CLI exactly.
104
129
 
105
130
  ## Available Commands
106
131
 
@@ -114,14 +139,14 @@ Once inside the interactive chat:
114
139
  | `/undo` | Clear pending changes |
115
140
  | `/edit <file>` | Load a file for editing |
116
141
  | `/search <symbol>` | Search for a symbol in codebase |
117
- | `/context <query>` | Find relevant files for a query |
118
- | `/files` | List currently loaded files |
119
- | `/model <name>` | Switch to a different AI model |
120
- | `/login` | Open auth wizard (API keys or ChatGPT OAuth) |
121
- | `/mcp` | Show MCP servers and available tools |
122
- | `/resume` | Resume a previous chat session |
123
- | `/clear` | Clear conversation history |
124
- | `/exit` | Exit the session |
142
+ | `/context <query>` | Find relevant files for a query |
143
+ | `/files` | List currently loaded files |
144
+ | `/model <name>` | Switch to a different AI model |
145
+ | `/login` | Open auth wizard (API keys or ChatGPT OAuth) |
146
+ | `/mcp` | Show MCP servers and available tools |
147
+ | `/resume` | Resume a previous chat session |
148
+ | `/clear` | Clear conversation history |
149
+ | `/exit` | Exit the session |
125
150
 
126
151
  ## Supported AI Models
127
152
 
@@ -131,20 +156,20 @@ Best for coding tasks and autonomous agents:
131
156
  - `claude-haiku-4-5` (Fast, cost-effective)
132
157
  - `claude-opus-4-1` (Most powerful)
133
158
 
134
- ### OpenAI GPT (ChatGPT OAuth)
135
- Run `zarz config --login-chatgpt` to fetch an OpenAI key, then choose any of these GPT‑5 variants optimized for OAuth access:
136
- - `gpt-5-codex` – Default coding agent
137
- - `gpt-5-codex-low` – Lower reasoning effort
138
- - `gpt-5-codex-medium` – Balanced reasoning depth
139
- - `gpt-5-codex-high` – High reasoning effort with detailed summaries
140
- - `gpt-5-minimal` – Minimal reasoning, terse responses
141
- - `gpt-5-low` – Low-effort general GPT-5
142
- - `gpt-5-medium` – Balanced GPT-5 experience
143
- - `gpt-5-high` – High reasoning-effort GPT-5
144
- - `gpt-5-mini` – Lightweight GPT-5 for quick tasks
145
- - `gpt-5-nano` – Fastest GPT-5 tier with minimal reasoning
146
-
147
- When you run `/model gpt-5-*`, ZarzCLI now prompts you to pick a **reasoning effort** (Auto, Minimal, Low, Medium, High). The choice is saved to `~/.zarz/config.toml` and applied to every Responses API call along with `text.verbosity = "medium"` and `include = ["reasoning.encrypted_content"]`, matching the Codex OAuth defaults.
159
+ ### OpenAI GPT (ChatGPT OAuth)
160
+ Run `zarz config --login-chatgpt` to fetch an OpenAI key, then choose any of these GPT‑5 variants optimized for OAuth access:
161
+ - `gpt-5-codex` – Default coding agent
162
+ - `gpt-5-codex-low` – Lower reasoning effort
163
+ - `gpt-5-codex-medium` – Balanced reasoning depth
164
+ - `gpt-5-codex-high` – High reasoning effort with detailed summaries
165
+ - `gpt-5-minimal` – Minimal reasoning, terse responses
166
+ - `gpt-5-low` – Low-effort general GPT-5
167
+ - `gpt-5-medium` – Balanced GPT-5 experience
168
+ - `gpt-5-high` – High reasoning-effort GPT-5
169
+ - `gpt-5-mini` – Lightweight GPT-5 for quick tasks
170
+ - `gpt-5-nano` – Fastest GPT-5 tier with minimal reasoning
171
+
172
+ When you run `/model gpt-5-*`, ZarzCLI now prompts you to pick a **reasoning effort** (Auto, Minimal, Low, Medium, High). The choice is saved to `~/.zarz/config.toml` and applied to every Responses API call along with `text.verbosity = "medium"` and `include = ["reasoning.encrypted_content"]`, matching the Codex OAuth defaults.
148
173
 
149
174
  ### GLM (Z.AI)
150
175
  Cost-effective coding with 200K context window:
@@ -196,6 +221,16 @@ ZarzCLI automatically checks for updates on startup and notifies you when a new
196
221
 
197
222
  > **Note**: Rust is **NOT required** for installation. Pre-built binaries are automatically downloaded for your platform (Windows, macOS, Linux).
198
223
 
224
+ ### References workspace
225
+
226
+ Need to keep upstream repos (Codex, plugins, docs) handy? Drop them into `References/`:
227
+
228
+ ```bash
229
+ git clone https://github.com/openai/codex References/codex-main
230
+ ```
231
+
232
+ The folder is `.gitignore`d, so you can mirror large sources locally without polluting commits. ZarzCLI’s Codex instructions and login success page were generated from those references.
233
+
199
234
  ## Contributing
200
235
 
201
236
  Contributions are welcome! ZarzCLI is now open source under MIT license.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarz",
3
- "version": "0.5.0-alpha",
3
+ "version": "0.5.1-alpha",
4
4
  "description": "Fast AI coding assistant for terminal built with Rust",
5
5
  "main": "bin/zarz.js",
6
6
  "bin": {
@@ -41,7 +41,8 @@
41
41
  "files": [
42
42
  "bin/",
43
43
  "scripts/",
44
- "README.md"
44
+ "README.md",
45
+ "CHANGELOG.md"
45
46
  ],
46
47
  "dependencies": {},
47
48
  "devDependencies": {},