ds-agent-cli 0.1.0 → 0.1.1

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
  from pathlib import Path
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.1"
4
4
 
5
5
  # Allow ds_agent.* imports to resolve modules currently stored under src/.
6
6
  _src_dir = Path(__file__).resolve().parent.parent / "src"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ds-agent-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "DS-Agent CLI wrapper for npm global install",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -25,4 +25,4 @@
25
25
  "python",
26
26
  "ml"
27
27
  ]
28
- }
28
+ }
package/setup.py CHANGED
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name="ds-agent",
6
- version="0.1.0",
6
+ version="0.1.1",
7
7
  description="Data Science Agent CLI",
8
8
  packages=find_packages(),
9
9
  include_package_data=True,
package/src/cli.py CHANGED
@@ -9,6 +9,8 @@ from rich.panel import Panel
9
9
  from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn
10
10
  from rich.live import Live
11
11
  from rich import print as rprint
12
+ from rich import box
13
+ from rich.text import Text
12
14
  from pathlib import Path
13
15
  import json
14
16
  import sys
@@ -16,7 +18,7 @@ import os
16
18
  import io
17
19
  import contextlib
18
20
  import importlib.util
19
- from typing import Optional
21
+ from typing import Optional, Tuple
20
22
 
21
23
  # Add src to path
22
24
  sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
@@ -40,35 +42,85 @@ app.add_typer(sessions_app, name="sessions")
40
42
  console = Console()
41
43
 
42
44
 
45
+ def _hex_to_rgb(hex_color: str) -> Tuple[int, int, int]:
46
+ value = hex_color.lstrip("#")
47
+ return int(value[0:2], 16), int(value[2:4], 16), int(value[4:6], 16)
48
+
49
+
50
+ def _rgb_to_hex(r: int, g: int, b: int) -> str:
51
+ return f"#{r:02x}{g:02x}{b:02x}"
52
+
53
+
54
+ def _gradient_text(content: str, start_color: str, end_color: str, *, bold: bool = True) -> Text:
55
+ """Render per-character color interpolation for a more futuristic terminal banner."""
56
+ start_r, start_g, start_b = _hex_to_rgb(start_color)
57
+ end_r, end_g, end_b = _hex_to_rgb(end_color)
58
+
59
+ visible_count = sum(1 for ch in content if ch != "\n")
60
+ steps = max(visible_count - 1, 1)
61
+ current = 0
62
+
63
+ out = Text()
64
+ for ch in content:
65
+ if ch == "\n":
66
+ out.append("\n")
67
+ continue
68
+
69
+ t = current / steps
70
+ r = int(start_r + (end_r - start_r) * t)
71
+ g = int(start_g + (end_g - start_g) * t)
72
+ b = int(start_b + (end_b - start_b) * t)
73
+ weight = "bold " if bold else ""
74
+ out.append(ch, style=f"{weight}{_rgb_to_hex(r, g, b)}")
75
+ current += 1
76
+
77
+ return out
78
+
79
+
43
80
  def _print_cli_home():
44
81
  """Render a first-run friendly home screen for users running the CLI without arguments."""
45
- banner = r"""[bold cyan]
82
+ banner = r"""
46
83
  ____ ____ _ ____ _____ _ _ _____
47
84
  | _ \/ ___| / \ / ___| ____| \ | |_ _|
48
85
  | | | \___ \ / _ \| | _| _| | \| | | |
49
86
  | |_| |___) | / ___ \ |_| | |___| |\ | | |
50
87
  |____/|____/ /_/ \_\____|_____|_| \_| |_|
51
- [/bold cyan]"""
52
- console.print(banner)
53
- console.print("[dim]The open data science agent CLI[/dim]\n")
54
-
55
- table = Table(show_header=False, box=None, pad_edge=False)
56
- table.add_column("Command", style="bold white", width=52, no_wrap=True)
57
- table.add_column("What it does", style="white")
58
-
59
- table.add_row("ds-agent quickstart", "Show examples for all major workflows")
60
- table.add_row("ds-agent analyze <file>", "Run end-to-end automated analysis")
61
- table.add_row("ds-agent chat [file]", "Start interactive session with memory")
62
- table.add_row("ds-agent report <file>", "Generate full HTML profiling report")
63
- table.add_row("ds-agent train <file> --target <col>", "Train baseline ML models")
64
- table.add_row("ds-agent tune <file> --target <col>", "Hyperparameter optimization")
65
- table.add_row("ds-agent plot <file>", "Generate charts and visualizations")
66
- table.add_row("ds-agent forecast <file> --time <col> --target <col>", "Time-series forecasting")
67
- table.add_row("ds-agent sessions list", "List and manage saved sessions")
68
- table.add_row("ds-agent --help", "Full command reference")
88
+ """.strip("\n")
89
+
90
+ hero_content = Text()
91
+ hero_content.append_text(_gradient_text(banner, "#ff8d63", "#66f0ff", bold=True))
92
+ hero_content.append("\n\n")
93
+ hero_content.append_text(_gradient_text("A stylish, one-command data science command center", "#ffd4be", "#9ef7ff", bold=False))
94
+
95
+ hero = Panel(
96
+ hero_content,
97
+ border_style="#7bd7ff",
98
+ box=box.ROUNDED,
99
+ padding=(1, 2),
100
+ title="[bold #ff9b72]DS-AGENT[/bold #ff9b72]",
101
+ subtitle="[bold #7bd7ff]Neon CLI[/bold #7bd7ff]"
102
+ )
103
+ console.print(hero)
104
+
105
+ quick = Table(box=box.SIMPLE_HEAVY, show_header=True, header_style="bold #7bd7ff")
106
+ quick.add_column("Command", style="bold white", width=54, no_wrap=True)
107
+ quick.add_column("Use Case", style="#d0c9bc")
108
+
109
+ quick.add_row("ds-agent quickstart", "Copy-paste examples for every core workflow")
110
+ quick.add_row("ds-agent analyze <file>", "Run complete ML workflow with one command")
111
+ quick.add_row("ds-agent chat [file]", "Interactive assistant with session memory")
112
+ quick.add_row("ds-agent report <file>", "Generate beautiful HTML profiling reports")
113
+ quick.add_row("ds-agent train <file> --target <col>", "Train baseline models quickly")
114
+ quick.add_row("ds-agent tune <file> --target <col>", "Optimize models with Optuna")
115
+ quick.add_row("ds-agent plot <file>", "Create plots and visual diagnostics")
116
+ quick.add_row("ds-agent forecast <file> --time <col> --target <col>", "Time-series forecasting")
117
+ quick.add_row("ds-agent sessions list", "View, resume, or clean saved sessions")
118
+ quick.add_row("ds-agent --help", "Full command and options reference")
69
119
 
70
- console.print(table)
71
- console.print("\n[dim]Tip: run [bold]ds-agent quickstart[/bold] for copy-paste commands.[/dim]")
120
+ console.print()
121
+ console.print(quick)
122
+ console.print("\n[bold #7bd7ff]Start here:[/bold #7bd7ff] [white]ds-agent quickstart[/white]")
123
+ console.print("[dim]Tip: add --help to any command for detailed usage, examples, and flags.[/dim]")
72
124
 
73
125
 
74
126
  @app.callback(invoke_without_command=True)
@@ -93,9 +145,15 @@ def root_callback(
93
145
  @app.command()
94
146
  def quickstart():
95
147
  """Show beginner-friendly command guide with copy-paste examples."""
96
- guide = Table(title="⚡ Quickstart Guide")
97
- guide.add_column("Workflow", style="cyan", width=24, no_wrap=True)
98
- guide.add_column("Command", style="white", no_wrap=True)
148
+ console.print(Panel.fit(
149
+ "[bold #7bd7ff]Quickstart Command Deck[/bold #7bd7ff]\n[dim]Run these exactly as shown and replace file paths.[/dim]",
150
+ border_style="#7bd7ff",
151
+ box=box.ROUNDED
152
+ ))
153
+
154
+ guide = Table(box=box.SIMPLE_HEAVY, show_header=True, header_style="bold #7bd7ff")
155
+ guide.add_column("Workflow", style="bold white", width=24, no_wrap=True)
156
+ guide.add_column("Command", style="#d0c9bc", no_wrap=True)
99
157
 
100
158
  guide.add_row("Analyze", "ds-agent analyze data.csv --target price --task \"predict price\"")
101
159
  guide.add_row("Chat", "ds-agent chat data.csv")
@@ -110,7 +168,8 @@ def quickstart():
110
168
 
111
169
  console.print()
112
170
  console.print(guide)
113
- console.print("\n[dim]Use [bold]ds-agent <command> --help[/bold] for detailed options and examples.[/dim]")
171
+ console.print("\n[bold #7bd7ff]Need details?[/bold #7bd7ff] [white]ds-agent <command> --help[/white]")
172
+ console.print("[dim]Example: ds-agent report --help | ds-agent forecast --help[/dim]")
114
173
 
115
174
 
116
175
  def _load_module_from_src(module_name: str, relative_path: str):