cmdgen-ai-cli 0.1.3__tar.gz → 0.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmdgen-ai-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: AI-powered CLI tool to translate natural language into terminal commands
5
5
  Requires-Python: >=3.9
6
6
  Requires-Dist: google-genai>=0.1.0
@@ -95,8 +95,15 @@ def config_view():
95
95
 
96
96
  def cli_main():
97
97
  import sys
98
+
99
+ # Intercept version flags
100
+ if "--version" in sys.argv or "-v" in sys.argv:
101
+ from cmdgen.update import get_current_version
102
+ console.print(f"cmdgen-ai-cli version: [bold cyan]{get_current_version()}[/bold cyan]")
103
+ return
104
+
98
105
  # If the first argument is not a known subcommand or flag, default to "generate"
99
- if len(sys.argv) > 1 and sys.argv[1] not in ["config", "generate", "--help", "-h", "--version"]:
106
+ if len(sys.argv) > 1 and sys.argv[1] not in ["config", "generate", "--help", "-h", "--version", "-v"]:
100
107
  sys.argv.insert(1, "generate")
101
108
  app()
102
109
 
@@ -13,8 +13,8 @@ console = Console()
13
13
 
14
14
  # We cache the update check in the config directory
15
15
  UPDATE_CACHE_FILE = CONFIG_DIR / "update_check.json"
16
- CACHE_TTL = 86400 # 24 hours in seconds
17
- PACKAGE_NAME = "cmdgen"
16
+ CACHE_TTL = 43200 # 12 hours in seconds
17
+ PACKAGE_NAME = "cmdgen-ai-cli"
18
18
 
19
19
  # Fallback version for development
20
20
  def get_current_version() -> str:
@@ -52,7 +52,7 @@ def check_for_updates() -> None:
52
52
  # Simple string comparison (this works well enough for simple semver like 0.1.0 vs 0.2.0)
53
53
  # We don't want to add a `packaging` dependency just for this.
54
54
  if latest_version and latest_version != current:
55
- console.print(f"[bold yellow]💡 A new version of cmdgen ({latest_version}) is available! Run `pipx upgrade cmdgen` to update.[/bold yellow]")
55
+ console.print(f"[bold yellow]💡 A new version of cmdgen ({latest_version}) is available! Run `pip install --upgrade cmdgen-ai-cli` to update.[/bold yellow]")
56
56
 
57
57
  # Update cache
58
58
  UPDATE_CACHE_FILE.parent.mkdir(parents=True, exist_ok=True)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cmdgen-ai-cli"
7
- version = "0.1.3"
7
+ version = "0.1.4"
8
8
  description = "AI-powered CLI tool to translate natural language into terminal commands"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes