codex-xai-oauth 0.1.0 → 0.2.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-xai-oauth",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "Use xAI/Grok OAuth or API-key credentials from Codex through local MCP tools.",
5
5
  "author": {
6
6
  "name": "ilseoblee"
@@ -13,15 +13,16 @@
13
13
  "mcpServers": "./.mcp.json",
14
14
  "interface": {
15
15
  "displayName": "xAI Grok OAuth",
16
- "shortDescription": "Generate with Grok, including images, from Codex.",
17
- "longDescription": "Adds local Codex MCP tools for xAI/Grok text, web search, X search, image generation, TTS, video generation, and credential status using OAuth or XAI_API_KEY.",
16
+ "shortDescription": "Generate with Grok, including artifact-backed images, from Codex.",
17
+ "longDescription": "Adds local Codex MCP tools for xAI/Grok text, web search, X search, artifact-backed image generation, TTS, video generation, and credential status using OAuth or XAI_API_KEY.",
18
18
  "developerName": "ilseoblee",
19
19
  "category": "Productivity",
20
20
  "capabilities": ["MCP", "Local tools", "Image generation"],
21
21
  "defaultPrompt": [
22
- "Generate an image with xAI.",
22
+ "Use xai_image_generate with artifact_dir to generate an image and save local artifacts.",
23
23
  "Check my xAI credential status.",
24
- "Search the web with Grok."
24
+ "Search the web with Grok.",
25
+ "Call the OpenAI-compatible /v1/images/generations proxy with n, resolution, size, and response_format."
25
26
  ],
26
27
  "brandColor": "#111111"
27
28
  }
package/README.md CHANGED
@@ -13,7 +13,7 @@ Codex plugin that exposes xAI/Grok tools through a local stdio MCP server. It is
13
13
  - `xai_tts`
14
14
  - `xai_video_generate`
15
15
 
16
- `xai_image_generate` calls xAI `/images/generations`. Default model is `grok-imagine-image`, default response format is `url`, and `resolution` supports `1k` or `2k`.
16
+ `xai_image_generate` calls xAI `/images/generations`. Default model is `grok-imagine-image`, default response format is `url`, and `resolution` supports `1k` or `2k`. Pass `artifact_dir` to save returned URL or `b64_json` images locally and include artifact metadata in the tool result.
17
17
 
18
18
  ## Unofficial / Use At Your Own Risk
19
19
 
@@ -29,6 +29,8 @@ npm run build
29
29
  python3 /Users/ilseoblee/.codex/skills/.system/plugin-creator/scripts/validate_plugin.py .
30
30
  ```
31
31
 
32
+ Release notes are tracked in [RELEASE_NOTES.md](RELEASE_NOTES.md).
33
+
32
34
  ## Install / Doctor
33
35
 
34
36
  From a checkout:
@@ -57,6 +59,8 @@ codex-xai-oauth doctor
57
59
 
58
60
  ## Authentication
59
61
 
62
+ The default OAuth store is the shared xAI OIDC file at `~/.grok/auth.json`. This project reads and writes that shared store by default; it does not require a specific Grok CLI build. `CODEX_XAI_OAUTH_AUTH_FILE` is available only when you intentionally want a separate package-specific auth file.
63
+
60
64
  Browser OAuth login:
61
65
 
62
66
  ```bash
@@ -81,22 +85,42 @@ Status:
81
85
  npx codex-xai-oauth status
82
86
  ```
83
87
 
84
- OAuth credentials are stored at:
88
+ Generate an image directly from the NPX CLI:
85
89
 
86
- ```text
87
- ~/.config/codex-xai-oauth/auth.json
90
+ ```bash
91
+ npx codex-xai-oauth image --prompt "minimal blue dot icon" --resolution 2k
92
+ ```
93
+
94
+ Save generated image payloads to local artifacts:
95
+
96
+ ```bash
97
+ npx codex-xai-oauth image --prompt "minimal blue dot icon" --response-format b64_json --artifact-dir .codex-xai-artifacts
88
98
  ```
89
99
 
90
- If that file is absent and no custom auth file is configured, the tools also read the Grok CLI OIDC session from:
100
+ OAuth credentials are stored by default as an xAI OIDC entry in:
91
101
 
92
102
  ```text
93
103
  ~/.grok/auth.json
94
104
  ```
95
105
 
106
+ Legacy package-specific OAuth credentials are still read as a fallback from:
107
+
108
+ ```text
109
+ ~/.config/codex-xai-oauth/auth.json
110
+ ```
111
+
112
+ Credential precedence:
113
+
114
+ - `CODEX_XAI_OAUTH_AUTH_FILE`, when explicitly set.
115
+ - `~/.grok/auth.json`.
116
+ - `~/.config/codex-xai-oauth/auth.json` legacy fallback.
117
+ - `XAI_API_KEY`.
118
+ - Codex model provider `experimental_bearer_token`.
119
+
96
120
  Overrides:
97
121
 
98
- - `CODEX_XAI_OAUTH_AUTH_FILE`: custom OAuth auth JSON path.
99
- - `CODEX_XAI_OAUTH_GROK_AUTH_FILE`: custom Grok CLI auth JSON path, mainly for tests or nonstandard installs.
122
+ - `CODEX_XAI_OAUTH_AUTH_FILE`: custom package-format OAuth auth JSON path.
123
+ - `CODEX_XAI_OAUTH_GROK_AUTH_FILE`: custom shared xAI OIDC auth JSON path, mainly for tests or nonstandard installs.
100
124
  - `XAI_API_KEY`: API-key fallback.
101
125
  - `XAI_BASE_URL`: custom xAI-compatible base URL.
102
126
 
@@ -121,12 +145,58 @@ The proxy exposes:
121
145
  - `/v1/responses`
122
146
  - `/v1/images/generations`
123
147
 
148
+ `/v1/images/generations` and `/images/generations` forward `prompt`, `model`, `n`, `size`, `resolution`, and `response_format`. Invalid `n`, `resolution`, or `response_format` values return a 400 response before any upstream xAI call.
149
+
124
150
  ## Codex Plugin Surface
125
151
 
126
152
  - `.codex-plugin/plugin.json` declares the plugin metadata, skill bundle, and MCP config.
127
153
  - `.mcp.json` starts the stdio MCP server from `dist/mcp/server.js`.
128
154
  - `skills/xai-grok/SKILL.md` tells Codex when to use the tools and how to avoid leaking secrets.
129
155
 
156
+ ## Built-In Skills
157
+
158
+ The plugin bundles a general skill plus one dedicated skill for each MCP tool listed in What Works:
159
+
160
+ - `xai-grok`: umbrella skill for plugin overview, setup orientation, or multi-tool requests when no dedicated `xai_*` skill is a better fit.
161
+ - `xai_status`: dedicated trigger for `xai_status`.
162
+ - `xai_login_instructions`: dedicated trigger for `xai_login_instructions`.
163
+ - `xai_generate_text`: dedicated trigger for `xai_generate_text`.
164
+ - `xai_web_search`: dedicated trigger for `xai_web_search`.
165
+ - `xai_x_search`: dedicated trigger for `xai_x_search`.
166
+ - `xai_image_generate`: dedicated trigger for `xai_image_generate`.
167
+ - `xai_tts`: dedicated trigger for `xai_tts`.
168
+ - `xai_video_generate`: dedicated trigger for `xai_video_generate`.
169
+
170
+ The dedicated `xai_image_generate` skill lets Codex route natural-language image requests to `xai_image_generate`.
171
+
172
+ MCP tool arguments:
173
+
174
+ ```json
175
+ {
176
+ "prompt": "tiny minimalist blue dot icon on white background",
177
+ "resolution": "2k",
178
+ "artifact_dir": ".codex-xai-artifacts"
179
+ }
180
+ ```
181
+
182
+ Equivalent CLI:
183
+
184
+ ```bash
185
+ npx codex-xai-oauth image \
186
+ --prompt "tiny minimalist blue dot icon on white background" \
187
+ --resolution 2k \
188
+ --artifact-dir .codex-xai-artifacts
189
+ ```
190
+
191
+ For base64 image payloads saved locally:
192
+
193
+ ```bash
194
+ npx codex-xai-oauth image \
195
+ --prompt "a cinematic robot reading a book" \
196
+ --response-format b64_json \
197
+ --artifact-dir .codex-xai-artifacts
198
+ ```
199
+
130
200
  Build before installing or using the MCP server:
131
201
 
132
202
  ```bash
@@ -0,0 +1,13 @@
1
+ # Release Notes
2
+
3
+ ## 0.2.2
4
+
5
+ - Changed the default OAuth read/write path to the shared xAI OIDC store at `~/.grok/auth.json`.
6
+ - Kept `CODEX_XAI_OAUTH_AUTH_FILE` as an explicit package-format override and `~/.config/codex-xai-oauth/auth.json` as a legacy fallback.
7
+ - Updated README, MCP login instructions, and bundled skills to explain that `~/.grok/auth.json` is a shared xAI OIDC auth store, not a requirement to use a specific Grok CLI build.
8
+
9
+ ## 0.2.1
10
+
11
+ - Added dedicated built-in skills for every README-listed MCP tool: `xai_status`, `xai_login_instructions`, `xai_generate_text`, `xai_web_search`, `xai_x_search`, `xai_image_generate`, `xai_tts`, and `xai_video_generate`.
12
+ - Narrowed `xai-grok` to an umbrella skill for plugin overview, setup orientation, and multi-tool requests so specific `xai_*` skills can load only when needed.
13
+ - Updated README skill documentation to match the plugin surface promised by the MCP tool list.