codicent-cli 0.8.0__tar.gz → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codicent-cli
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: Command-line interface for the Codicent API
5
5
  Home-page: https://github.com/izaxon/codicent-cli
6
6
  Author: Johan Isaksson
@@ -28,6 +28,8 @@ Requires-Dist: codicent-py
28
28
  Requires-Dist: prompt_toolkit
29
29
  Requires-Dist: requests
30
30
  Requires-Dist: pyyaml
31
+ Requires-Dist: packaging
32
+ Requires-Dist: pyte
31
33
  Dynamic: author
32
34
  Dynamic: author-email
33
35
  Dynamic: classifier
@@ -114,8 +114,14 @@ EXAMPLES:
114
114
  codicent upload document.txt *.log
115
115
  codicent init --template koi-studio
116
116
  codicent wrap claude
117
+ codicent update
118
+ codicent update --install
117
119
  echo "Help me debug this" | codicent
118
120
 
121
+ UPDATE:
122
+ update Check if a newer version is available on PyPI
123
+ --install Also upgrade immediately via pip
124
+
119
125
  ENVIRONMENT:
120
126
  CODICENT_TOKEN Your Codicent API token (fallback if no cached auth)
121
127
 
@@ -123,9 +129,11 @@ For more information, visit: https://github.com/izaxon/codicent-cli
123
129
  """
124
130
  print(help_text.strip())
125
131
 
132
+ CURRENT_VERSION = "0.8.1"
133
+
126
134
  def show_version():
127
135
  """Display version information."""
128
- print("Codicent CLI v0.8.0")
136
+ print(f"Codicent CLI v{CURRENT_VERSION}")
129
137
 
130
138
  def validate_input(question):
131
139
  """Validate user input."""
@@ -200,6 +208,54 @@ def main():
200
208
  console.print("[dim]Run 'codicent auth' to authenticate[/dim]")
201
209
  return 1
202
210
 
211
+ # Handle update command
212
+ if len(sys.argv) > 1 and sys.argv[1] == "update":
213
+ do_install = "--install" in sys.argv
214
+ try:
215
+ resp = requests.get(
216
+ "https://pypi.org/pypi/codicent-cli/json",
217
+ timeout=10,
218
+ )
219
+ resp.raise_for_status()
220
+ latest = resp.json()["info"]["version"]
221
+ except Exception as e:
222
+ console.print(f"[red]❌ Could not check PyPI: {e}[/red]")
223
+ return 1
224
+
225
+ from packaging.version import Version
226
+
227
+ # Detect whether we're running inside a pipx-managed environment
228
+ is_pipx = "pipx" in sys.executable.replace("\\", "/")
229
+
230
+ if Version(latest) > Version(CURRENT_VERSION):
231
+ console.print(
232
+ f"[yellow]⬆ New version available:[/yellow] "
233
+ f"[bold]{latest}[/bold] (you have {CURRENT_VERSION})"
234
+ )
235
+ if do_install:
236
+ if is_pipx:
237
+ console.print("[dim]Running pipx upgrade codicent-cli...[/dim]")
238
+ result = subprocess.run(
239
+ ["pipx", "upgrade", "codicent-cli"],
240
+ capture_output=False,
241
+ )
242
+ else:
243
+ console.print("[dim]Running pip install --upgrade codicent-cli...[/dim]")
244
+ result = subprocess.run(
245
+ [sys.executable, "-m", "pip", "install", "--upgrade", "codicent-cli"],
246
+ capture_output=False,
247
+ )
248
+ return result.returncode
249
+ else:
250
+ upgrade_cmd = "pipx upgrade codicent-cli" if is_pipx else "pip install --upgrade codicent-cli"
251
+ console.print(
252
+ f"[dim]Run [bold]codicent update --install[/bold] to upgrade, "
253
+ f"or [bold]{upgrade_cmd}[/bold][/dim]"
254
+ )
255
+ else:
256
+ console.print(f"[green]✅ Already up to date (v{CURRENT_VERSION})[/green]")
257
+ return 0
258
+
203
259
  # Handle upload command
204
260
  if len(sys.argv) > 1 and sys.argv[1] == "upload":
205
261
  if len(sys.argv) < 3:
@@ -727,7 +783,7 @@ def main():
727
783
 
728
784
  header = Text()
729
785
  header.append("Codicent CLI", style="bold bright_cyan")
730
- header.append(" v0.8.0\n", style="bright_cyan")
786
+ header.append(f" v{CURRENT_VERSION}\n", style="bright_cyan")
731
787
  header.append("Type your questions or use Ctrl+C to exit.\n", style="dim")
732
788
  header.append("\n")
733
789
  header.append("Tip: ", style="bold dim")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codicent-cli
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: Command-line interface for the Codicent API
5
5
  Home-page: https://github.com/izaxon/codicent-cli
6
6
  Author: Johan Isaksson
@@ -28,6 +28,8 @@ Requires-Dist: codicent-py
28
28
  Requires-Dist: prompt_toolkit
29
29
  Requires-Dist: requests
30
30
  Requires-Dist: pyyaml
31
+ Requires-Dist: packaging
32
+ Requires-Dist: pyte
31
33
  Dynamic: author
32
34
  Dynamic: author-email
33
35
  Dynamic: classifier
@@ -3,3 +3,5 @@ codicent-py
3
3
  prompt_toolkit
4
4
  requests
5
5
  pyyaml
6
+ packaging
7
+ pyte
@@ -9,7 +9,7 @@ except FileNotFoundError:
9
9
 
10
10
  setup(
11
11
  name='codicent-cli',
12
- version='0.8.0',
12
+ version='0.8.1',
13
13
  author='Johan Isaksson',
14
14
  author_email='johan@izaxon.com',
15
15
  description='Command-line interface for the Codicent API',
@@ -45,6 +45,8 @@ setup(
45
45
  'prompt_toolkit',
46
46
  'requests',
47
47
  'pyyaml',
48
+ 'packaging',
49
+ 'pyte',
48
50
  ],
49
51
  entry_points={
50
52
  'console_scripts': [