code-aide 1.20.0__tar.gz → 1.20.1__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.
Files changed (74) hide show
  1. {code_aide-1.20.0 → code_aide-1.20.1}/PKG-INFO +1 -1
  2. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/__init__.py +1 -1
  3. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/commands_tools.py +16 -0
  4. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/status.py +19 -6
  5. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_commands_tools.py +45 -0
  6. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_npm_cache.py +5 -2
  7. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_status.py +28 -0
  8. {code_aide-1.20.0 → code_aide-1.20.1}/.github/workflows/ci.yml +0 -0
  9. {code_aide-1.20.0 → code_aide-1.20.1}/.github/workflows/publish.yml +0 -0
  10. {code_aide-1.20.0 → code_aide-1.20.1}/.gitignore +0 -0
  11. {code_aide-1.20.0 → code_aide-1.20.1}/.gitlab-ci.yml +0 -0
  12. {code_aide-1.20.0 → code_aide-1.20.1}/.pre-commit-config.yaml +0 -0
  13. {code_aide-1.20.0 → code_aide-1.20.1}/AGENTS.md +0 -0
  14. {code_aide-1.20.0 → code_aide-1.20.1}/CLAUDE.md +0 -0
  15. {code_aide-1.20.0 → code_aide-1.20.1}/LICENSE +0 -0
  16. {code_aide-1.20.0 → code_aide-1.20.1}/Makefile +0 -0
  17. {code_aide-1.20.0 → code_aide-1.20.1}/README.md +0 -0
  18. {code_aide-1.20.0 → code_aide-1.20.1}/TODO.md +0 -0
  19. {code_aide-1.20.0 → code_aide-1.20.1}/pyproject.toml +0 -0
  20. {code_aide-1.20.0 → code_aide-1.20.1}/script-archive/README.md +0 -0
  21. {code_aide-1.20.0 → code_aide-1.20.1}/script-archive/amp-install.sh +0 -0
  22. {code_aide-1.20.0 → code_aide-1.20.1}/script-archive/antigravity-install.sh +0 -0
  23. {code_aide-1.20.0 → code_aide-1.20.1}/script-archive/claude-install.sh +0 -0
  24. {code_aide-1.20.0 → code_aide-1.20.1}/script-archive/cursor-install.sh +0 -0
  25. {code_aide-1.20.0 → code_aide-1.20.1}/specs/2026-05-03-qwen3.6-code-quality-analysis-original.md +0 -0
  26. {code_aide-1.20.0 → code_aide-1.20.1}/specs/2026-05-03-qwen3.6-code-quality-analysis.md +0 -0
  27. {code_aide-1.20.0 → code_aide-1.20.1}/specs/antigravity-cli-integration.md +0 -0
  28. {code_aide-1.20.0 → code_aide-1.20.1}/specs/auto-migrate-deprecated-installs.md +0 -0
  29. {code_aide-1.20.0 → code_aide-1.20.1}/specs/claude-native-installer-migration.md +0 -0
  30. {code_aide-1.20.0 → code_aide-1.20.1}/specs/missing-coding-llm-cli-tools.md +0 -0
  31. {code_aide-1.20.0 → code_aide-1.20.1}/specs/pre-commit-uv-setup.md +0 -0
  32. {code_aide-1.20.0 → code_aide-1.20.1}/specs/remove-bundled-version-baseline.md +0 -0
  33. {code_aide-1.20.0 → code_aide-1.20.1}/specs/unify-upgrade-eligibility-with-shared-evaluator.md +0 -0
  34. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/__main__.py +0 -0
  35. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/app_bundle.py +0 -0
  36. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/commands_actions.py +0 -0
  37. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/config.py +0 -0
  38. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/console.py +0 -0
  39. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/constants.py +0 -0
  40. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/data/tools.json +0 -0
  41. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/detection.py +0 -0
  42. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/detection_types.py +0 -0
  43. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/entry.py +0 -0
  44. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/install.py +0 -0
  45. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/install_types.py +0 -0
  46. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/npm_cache.py +0 -0
  47. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/operation_handlers.py +0 -0
  48. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/operations.py +0 -0
  49. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/package_info.py +0 -0
  50. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/package_managers.py +0 -0
  51. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/path_copies.py +0 -0
  52. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/prereqs.py +0 -0
  53. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/release_assets.py +0 -0
  54. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/status_print.py +0 -0
  55. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/tool_groups.py +0 -0
  56. {code_aide-1.20.0 → code_aide-1.20.1}/src/code_aide/versions.py +0 -0
  57. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_app_bundle.py +0 -0
  58. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_commands_actions.py +0 -0
  59. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_config.py +0 -0
  60. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_console.py +0 -0
  61. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_constants.py +0 -0
  62. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_detection.py +0 -0
  63. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_entry.py +0 -0
  64. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_error_paths.py +0 -0
  65. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_install.py +0 -0
  66. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_install_types.py +0 -0
  67. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_operations.py +0 -0
  68. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_package_info.py +0 -0
  69. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_package_managers.py +0 -0
  70. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_path_copies.py +0 -0
  71. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_prereqs.py +0 -0
  72. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_release_assets.py +0 -0
  73. {code_aide-1.20.0 → code_aide-1.20.1}/tests/test_versions.py +0 -0
  74. {code_aide-1.20.0 → code_aide-1.20.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: code-aide
3
- Version: 1.20.0
3
+ Version: 1.20.1
4
4
  Summary: Manage AI coding CLI tools (Claude, Antigravity, Copilot, Cursor, Gemini, Amp, Codex)
5
5
  Project-URL: Homepage, https://github.com/dajobe/code-aide
6
6
  Project-URL: Repository, https://github.com/dajobe/code-aide
@@ -1,3 +1,3 @@
1
1
  """code-aide - Manage AI coding CLI tools."""
2
2
 
3
- __version__ = "1.20.0"
3
+ __version__ = "1.20.1"
@@ -226,6 +226,7 @@ def cmd_status_compact() -> None:
226
226
  """Show compact one-line-per-tool status."""
227
227
  ensure_versions_cache(TOOLS)
228
228
  rows: list[tuple[str, str, str, str, str]] = []
229
+ failed_checks: list[tuple[str, str]] = []
229
230
  for tool_name, tool_config in TOOLS.items():
230
231
  assessment = ToolUpgradeEvaluator(tool_name, tool_config).evaluate()
231
232
  status = assessment.status
@@ -250,6 +251,10 @@ def cmd_status_compact() -> None:
250
251
  )
251
252
 
252
253
  state = ver_status if ver_status else "?"
254
+ version_error = status.get("version_error")
255
+ if not status["version"] and version_error:
256
+ state = f"{Colors.RED}failed{Colors.NC}"
257
+ failed_checks.append((tool_name, version_error))
253
258
  shadowed = len(shadowed_copies(tool_name))
254
259
  if shadowed:
255
260
  tool_path += f" {Colors.YELLOW}(+{shadowed} shadowed){Colors.NC}"
@@ -278,6 +283,11 @@ def cmd_status_compact() -> None:
278
283
  print(fmt_row(headers))
279
284
  for row in rows:
280
285
  print(fmt_row(row))
286
+ for tool_name, version_error in failed_checks:
287
+ warning(
288
+ f"{tool_name}: version check failed ({version_error}); "
289
+ f"try 'code-aide upgrade {tool_name}' to reinstall it."
290
+ )
281
291
  for message in linked_version_mismatches():
282
292
  warning(message)
283
293
 
@@ -318,6 +328,12 @@ def cmd_status(args: argparse.Namespace) -> None:
318
328
  else:
319
329
  print(f" Status: {Colors.GREEN}✓ Installed{Colors.NC}")
320
330
 
331
+ if not status["version"] and status.get("version_error"):
332
+ warning(
333
+ f" Version check failed: {status['version_error']}. "
334
+ f"Try 'code-aide upgrade {tool_name}' to reinstall it."
335
+ )
336
+
321
337
  if status["version"]:
322
338
  _print_version_status(
323
339
  assessment, status["version"], tool_path, tool_config
@@ -46,6 +46,8 @@ class ToolStatus(TypedDict, total=False):
46
46
  user: str | None
47
47
  usage: str | None
48
48
  errors: list[str]
49
+ # Why the installed tool's version could not be read, if it couldn't.
50
+ version_error: str | None
49
51
 
50
52
 
51
53
  InstallInfo = DetectedInstallInfo
@@ -348,6 +350,7 @@ def get_tool_status(tool_name: str, tool_config: Dict[str, Any]) -> ToolStatus:
348
350
  "user": None,
349
351
  "usage": None,
350
352
  "errors": [],
353
+ "version_error": None,
351
354
  }
352
355
 
353
356
  if not status_info["installed"]:
@@ -356,6 +359,8 @@ def get_tool_status(tool_name: str, tool_config: Dict[str, Any]) -> ToolStatus:
356
359
  if is_app_bundle_tool(tool_config):
357
360
  bundle = tool_location(tool_config)
358
361
  status_info["version"] = bundle_version(bundle) if bundle else None
362
+ if not status_info["version"]:
363
+ status_info["version_error"] = "could not read the app's Info.plist"
359
364
  return status_info
360
365
 
361
366
  command = tool_config["command"]
@@ -370,19 +375,27 @@ def get_tool_status(tool_name: str, tool_config: Dict[str, Any]) -> ToolStatus:
370
375
  check=False,
371
376
  stdin=subprocess.DEVNULL,
372
377
  )
373
- if result.returncode == 0:
374
- # Some tools print their version to stderr; prefer stdout.
375
- output = result.stdout.strip() or result.stderr.strip()
376
- if output:
377
- status_info["version"] = output.split("\n")[0]
378
+ # Some tools print their version to stderr; prefer stdout.
379
+ output = result.stdout.strip() or result.stderr.strip()
380
+ if result.returncode == 0 and output:
381
+ status_info["version"] = output.split("\n")[0]
382
+ elif result.returncode == 0:
383
+ status_info["version_error"] = "printed no version"
384
+ else:
385
+ last_line = output.splitlines()[-1].strip() if output else ""
386
+ status_info["version_error"] = (
387
+ last_line or f"exited with status {result.returncode}"
388
+ )
378
389
  except subprocess.TimeoutExpired:
379
390
  status_info["errors"].append("Version check timed out after 10s")
380
- except Exception:
391
+ status_info["version_error"] = "timed out after 10s"
392
+ except Exception as exc:
381
393
  _logger.debug(
382
394
  "Version check failed for %s (%s)",
383
395
  tool_name,
384
396
  " ".join(cmd),
385
397
  exc_info=True,
386
398
  )
399
+ status_info["version_error"] = str(exc) or type(exc).__name__
387
400
 
388
401
  return status_info
@@ -284,6 +284,51 @@ class TestCmdStatus(unittest.TestCase):
284
284
  self.assertIn("ok", output)
285
285
  self.assertNotIn("old", output)
286
286
 
287
+ def _status_output(self, command, long_view=False):
288
+ tools = {
289
+ "x": {
290
+ "name": "Example Tool",
291
+ "command": "example",
292
+ "install_type": "npm",
293
+ "latest_version": "2.0.0",
294
+ }
295
+ }
296
+ status = {
297
+ "installed": True,
298
+ "version": None,
299
+ "user": None,
300
+ "usage": None,
301
+ "errors": [],
302
+ "version_error": "no platform package found",
303
+ }
304
+ args = type("Args", (), {"long": long_view})()
305
+ with (
306
+ mock.patch.dict(constants._TOOLS_DATA, tools, clear=True),
307
+ mock.patch.object(
308
+ commands_tools.shutil, "which", return_value="/opt/bin/example"
309
+ ),
310
+ mock.patch("code_aide.status.get_tool_status", return_value=status),
311
+ mock.patch(
312
+ "code_aide.status.detect_install_method",
313
+ return_value={"method": "npm", "detail": "example"},
314
+ ),
315
+ ):
316
+ buf = io.StringIO()
317
+ with contextlib.redirect_stdout(buf), contextlib.redirect_stderr(buf):
318
+ command(args)
319
+ return buf.getvalue()
320
+
321
+ def test_compact_status_reports_failed_version_check(self, _mock_cache):
322
+ output = self._status_output(lambda _args: commands_tools.cmd_status_compact())
323
+ self.assertIn("failed", output)
324
+ self.assertIn("x: version check failed (no platform package found)", output)
325
+ self.assertIn("code-aide upgrade x", output)
326
+
327
+ def test_long_status_reports_failed_version_check(self, _mock_cache):
328
+ output = self._status_output(commands_tools.cmd_status, long_view=True)
329
+ self.assertIn("Version check failed: no platform package found", output)
330
+ self.assertIn("code-aide upgrade x", output)
331
+
287
332
  def test_list_shows_migration_warning(self, _mock_cache):
288
333
  """cmd_list shows migration warning for deprecated install."""
289
334
  tools = {
@@ -157,13 +157,16 @@ def test_explicit_cache_override_rejected_before_cache_creation(cache_home):
157
157
 
158
158
  def test_symlink_cache_parent_rejected(cache_home, tmp_path):
159
159
  target = tmp_path / "outside"
160
- target.mkdir(mode=0o755)
160
+ target.mkdir()
161
+ # Compare with the starting mode rather than a literal one: mkdir modes
162
+ # are reduced by the process umask, so the start varies by environment.
163
+ mode_before = target.stat().st_mode
161
164
  (cache_home / ".cache").symlink_to(target)
162
165
  with pytest.raises(ValueError, match="symlink"):
163
166
  with npm_cache_environment():
164
167
  pytest.fail("must reject symlink")
165
168
  assert not list(target.iterdir())
166
- assert target.stat().st_mode & 0o777 == 0o755
169
+ assert target.stat().st_mode == mode_before
167
170
 
168
171
 
169
172
  def test_real_timeout_stops_descendant_before_cleanup(cache_home, monkeypatch):
@@ -410,6 +410,34 @@ class TestGetToolStatus(unittest.TestCase):
410
410
  status = self._run(returncode=1, stdout="1.2.3\n")
411
411
  self.assertIsNone(status["version"])
412
412
 
413
+ def test_nonzero_exit_records_last_output_line(self):
414
+ status = self._run(returncode=1, stderr="loading\nno platform package found\n")
415
+ self.assertIsNone(status["version"])
416
+ self.assertEqual(status["version_error"], "no platform package found")
417
+
418
+ def test_nonzero_exit_without_output_records_status(self):
419
+ status = self._run(returncode=3)
420
+ self.assertEqual(status["version_error"], "exited with status 3")
421
+
422
+ def test_success_without_output_records_error(self):
423
+ status = self._run(returncode=0)
424
+ self.assertEqual(status["version_error"], "printed no version")
425
+
426
+ def test_successful_check_has_no_error(self):
427
+ self.assertIsNone(self._run(stdout="1.2.3\n")["version_error"])
428
+
429
+ def test_timeout_records_error(self):
430
+ with (
431
+ mock.patch.object(cli_status, "is_tool_installed", return_value=True),
432
+ mock.patch.object(
433
+ cli_status.subprocess,
434
+ "run",
435
+ side_effect=subprocess.TimeoutExpired(["test-tool"], 10),
436
+ ),
437
+ ):
438
+ status = cli_status.get_tool_status("test", self._TOOL_CONFIG)
439
+ self.assertEqual(status["version_error"], "timed out after 10s")
440
+
413
441
  def test_not_installed_short_circuits(self):
414
442
  with mock.patch.object(
415
443
  cli_status, "is_tool_installed", return_value=False
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes