gemini-cli-usage 0.1.3__tar.gz → 0.1.5__tar.gz
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.
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/PKG-INFO +1 -1
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/pyproject.toml +1 -1
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/src/gemini_cli_usage/__init__.py +48 -6
- gemini_cli_usage-0.1.5/src/gemini_cli_usage/__main__.py +2 -0
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/uv.lock +1 -1
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/.github/workflows/publish.yml +0 -0
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/.gitignore +0 -0
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/README.md +0 -0
- {gemini_cli_usage-0.1.3 → gemini_cli_usage-0.1.5}/tests/test_gemini_cli_usage.py +0 -0
|
@@ -190,14 +190,56 @@ def _write_oauth_credentials(creds: dict):
|
|
|
190
190
|
|
|
191
191
|
|
|
192
192
|
def _get_gemini_cli_oauth2_path() -> Path | None:
|
|
193
|
+
oauth2_rels = [
|
|
194
|
+
Path("node_modules") / "@google" / "gemini-cli-core" / "dist" / "src" / "code_assist" / "oauth2.js",
|
|
195
|
+
Path("node_modules") / "@google" / "gemini-cli" / "node_modules" / "@google" / "gemini-cli-core" / "dist" / "src" / "code_assist" / "oauth2.js",
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
candidates: list[Path] = []
|
|
199
|
+
|
|
200
|
+
# 1. Try shutil.which
|
|
193
201
|
gemini_bin = shutil.which("gemini")
|
|
194
|
-
if
|
|
195
|
-
|
|
202
|
+
if gemini_bin:
|
|
203
|
+
resolved = Path(gemini_bin).resolve()
|
|
204
|
+
candidates.extend([resolved.parent, resolved.parent.parent])
|
|
205
|
+
|
|
206
|
+
# 2. On Windows, scan fnm node version directories
|
|
207
|
+
if sys.platform == "win32":
|
|
208
|
+
fnm_dir = Path.home() / "AppData" / "Roaming" / "fnm" / "node-versions"
|
|
209
|
+
if fnm_dir.exists():
|
|
210
|
+
for version_dir in fnm_dir.iterdir():
|
|
211
|
+
candidates.append(version_dir / "installation")
|
|
212
|
+
|
|
213
|
+
# Also check AppData/Local fnm multishells
|
|
214
|
+
fnm_multi = Path.home() / "AppData" / "Local" / "fnm_multishells"
|
|
215
|
+
if fnm_multi.exists():
|
|
216
|
+
for shell_dir in fnm_multi.iterdir():
|
|
217
|
+
candidates.append(shell_dir)
|
|
218
|
+
|
|
219
|
+
# 3. Unix: check common global npm/nvm paths
|
|
220
|
+
else:
|
|
221
|
+
for p in [
|
|
222
|
+
Path("/usr/lib"),
|
|
223
|
+
Path("/usr/local/lib"),
|
|
224
|
+
Path.home() / ".nvm" / "versions",
|
|
225
|
+
]:
|
|
226
|
+
if p.exists():
|
|
227
|
+
if "nvm" in str(p):
|
|
228
|
+
for v in p.rglob("node"):
|
|
229
|
+
candidates.append(v / "lib")
|
|
230
|
+
else:
|
|
231
|
+
candidates.append(p)
|
|
232
|
+
|
|
233
|
+
for root in candidates:
|
|
234
|
+
for oauth2_rel in oauth2_rels:
|
|
235
|
+
oauth2_path = root / oauth2_rel
|
|
236
|
+
if oauth2_path.exists():
|
|
237
|
+
return oauth2_path
|
|
238
|
+
oauth2_path = root / "lib" / oauth2_rel
|
|
239
|
+
if oauth2_path.exists():
|
|
240
|
+
return oauth2_path
|
|
196
241
|
|
|
197
|
-
|
|
198
|
-
package_root = resolved.parent.parent
|
|
199
|
-
oauth2_path = package_root / "node_modules" / "@google" / "gemini-cli-core" / "dist" / "src" / "code_assist" / "oauth2.js"
|
|
200
|
-
return oauth2_path if oauth2_path.exists() else None
|
|
242
|
+
return None
|
|
201
243
|
|
|
202
244
|
|
|
203
245
|
def _get_gemini_cli_oauth_client_credentials() -> tuple[str, str] | None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|