steve-cli 0.3.5__tar.gz → 0.3.7__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: steve-cli
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: A simple CLI tool to run jobs from jobs.yaml with proper environment setup
5
5
  Author: Frank
6
6
  License: MIT
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "steve-cli"
8
- version = "0.3.5"
8
+ version = "0.3.7"
9
9
  description = "A simple CLI tool to run jobs from jobs.yaml with proper environment setup"
10
10
  readme = "README.md"
11
11
  license = {text = "MIT"}
@@ -178,6 +178,7 @@ def jobs_run(job_name: str, jobs_file: Optional[Path]):
178
178
 
179
179
  APPS_DIR = Path.home() / ".steve" / "apps"
180
180
  AUTH_PROXY_INTERNAL_URL = "http://auth-proxy-service"
181
+ APP_NAME_PREFIX = "term-"
181
182
 
182
183
 
183
184
  class AppsConfig:
@@ -227,6 +228,10 @@ def _pid_file(app_name: str) -> Path:
227
228
  return APPS_DIR / f"{app_name}.pid"
228
229
 
229
230
 
231
+ def _url_file(app_name: str) -> Path:
232
+ return APPS_DIR / f"{app_name}.url"
233
+
234
+
230
235
  def _get_running_pid(app_name: str) -> Optional[int]:
231
236
  pf = _pid_file(app_name)
232
237
  if not pf.exists():
@@ -314,6 +319,10 @@ def apps_list(apps_file: Optional[Path]):
314
319
  if command:
315
320
  click.echo(f" Command: {click.style(' '.join(command), fg='cyan')}")
316
321
  click.echo(f" Port: {click.style(str(port), fg='magenta')}")
322
+ if pid:
323
+ uf = _url_file(name)
324
+ url = uf.read_text().strip() if uf.exists() else f'http://localhost:{port}'
325
+ click.echo(f" URL: {click.style(url, fg='cyan')}")
317
326
  if env_vars:
318
327
  click.echo(f" Environment: {click.style(f'{len(env_vars)} variables', fg='green')}")
319
328
  click.echo()
@@ -342,6 +351,9 @@ def apps_start(app_name: str, apps_file: Optional[Path]):
342
351
  existing_pid = _get_running_pid(app_name)
343
352
  if existing_pid:
344
353
  click.echo(f"⚠️ App '{app_name}' is already running (PID {existing_pid})")
354
+ uf = _url_file(app_name)
355
+ if uf.exists():
356
+ click.echo(f"🌐 Access at: {click.style(uf.read_text().strip(), fg='cyan')}")
345
357
  return
346
358
 
347
359
  command = app_def.get('command', [])
@@ -383,7 +395,7 @@ def apps_start(app_name: str, apps_file: Optional[Path]):
383
395
 
384
396
  _pid_file(app_name).write_text(str(proc.pid))
385
397
 
386
- result = _register_app(session_name, app_name, port)
398
+ result = _register_app(session_name, f"{APP_NAME_PREFIX}{app_name}", port)
387
399
 
388
400
  if result:
389
401
  click.echo(f"✅ App started (PID {proc.pid}) and registered with auth-proxy")
@@ -395,7 +407,10 @@ def apps_start(app_name: str, apps_file: Optional[Path]):
395
407
  if public_url:
396
408
  click.echo(f"🌐 Access at: {click.style(public_url, fg='cyan')}")
397
409
  else:
398
- click.echo(f"🌐 Access at (local): {click.style(f'http://localhost:{port}', fg='yellow')}")
410
+ public_url = f'http://localhost:{port}'
411
+ click.echo(f"🌐 Access at (local): {click.style(public_url, fg='yellow')}")
412
+
413
+ _url_file(app_name).write_text(public_url)
399
414
 
400
415
  click.echo(f"📄 Logs: {click.style(str(log_file), fg='yellow')}")
401
416
 
@@ -420,9 +435,10 @@ def apps_stop(app_name: str, apps_file: Optional[Path]):
420
435
  click.echo(f"❌ Failed to stop process: {e}", err=True)
421
436
 
422
437
  _pid_file(app_name).unlink(missing_ok=True)
438
+ _url_file(app_name).unlink(missing_ok=True)
423
439
 
424
440
  if session_name:
425
- _deregister_app(session_name, app_name)
441
+ _deregister_app(session_name, f"{APP_NAME_PREFIX}{app_name}")
426
442
  click.echo(f"🔌 Deregistered from auth-proxy")
427
443
 
428
444
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: steve-cli
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: A simple CLI tool to run jobs from jobs.yaml with proper environment setup
5
5
  Author: Frank
6
6
  License: MIT
File without changes
File without changes