sage-ai-cli 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,214 @@
1
+ Metadata-Version: 2.4
2
+ Name: sage-ai-cli
3
+ Version: 0.1.0
4
+ Summary: SageCLI - AI Engineering Agent for Machine Learning & Deep Learning
5
+ Author-email: zaheerjklabs <zaheerjklabs@gmail.com>
6
+ License: MIT
7
+ Keywords: ai,cli,machine-learning,deep-learning,agent,engineering
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: rich>=13.0.0
23
+ Requires-Dist: typer>=0.9.0
24
+ Requires-Dist: prompt-toolkit>=3.0.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
27
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ # SageCLI
31
+
32
+ ```text
33
+ ███████╗ █████╗ ██████╗ ███████╗
34
+ ██╔════╝ ██╔══██╗ ██╔════╝ ██╔════╝
35
+ ███████╗ ███████║ ██║ ███╗ █████╗
36
+ ╚════██║ ██╔══██║ ██║ ██║ ██╔══╝
37
+ ███████║ ██║ ██║ ╚██████╔╝ ███████╗
38
+ ╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
39
+
40
+ S A G E C L I
41
+ AI ENGINEERING AGENT
42
+ ```
43
+
44
+ > **Build • Train • Debug • Evaluate • Deploy**
45
+
46
+ SageCLI is a terminal-native autonomous AI coding agent designed specifically for **Machine Learning, Deep Learning, and AI Engineering**. Running directly inside your terminal, SageCLI autonomously inspects repositories and datasets, plans modular architectures, writes and executes code, runs tests, self-debugs tracebacks, computes metrics, and sets up inference endpoints.
47
+
48
+ ---
49
+
50
+ ## 🚀 Autonomous Agent Workflow
51
+
52
+ ```text
53
+ User Prompt
54
+ ↓
55
+ Context / Repository & Dataset Ingestion
56
+ ↓
57
+ Planning & Architecture Phase
58
+ ↓
59
+ Code Generation (PyTorch, Scikit-Learn, LightGBM, FastAPI)
60
+ ↓
61
+ Execution & Pipeline Run
62
+ ↓
63
+ Automated Testing & Autonomous Traceback Debugging
64
+ ↓
65
+ Model Evaluation & Metric Tracking
66
+ ↓
67
+ Documentation & Git Checkpoints
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 🛠️ Key Capabilities
73
+
74
+ * **First-Run Interactive Setup Wizard (`sage setup`)**: Multi-provider auto-detection, masked credential entry, model selection, mode choice, and live connection verification.
75
+ * **Provider-Agnostic Engine**: Native tool-calling support for:
76
+ * **Google Gemini** (`gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.0-flash`)
77
+ * **OpenAI** (`gpt-4o`, `gpt-4o-mini`, `o3-mini`, `o1`)
78
+ * **Anthropic Claude** (`claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-5-haiku`)
79
+ * **Groq** (`llama-3.3-70b-versatile`, `deepseek-r1-distill-llama-70b`)
80
+ * **OpenRouter** (`deepseek/deepseek-r1`, etc.)
81
+ * **Ollama (Local)** (`llama3.2`, `deepseek-r1`, `qwen2.5-coder`)
82
+ * **Custom OpenAI-compatible endpoints** (vLLM, LocalAI, LM Studio)
83
+ * **ML/DL Engineering Tool Suite**:
84
+ * `inspect_dataset`: Deep EDA on CSV, Parquet, JSON, NumPy, Excel files (shapes, missing values, statistics, class distribution).
85
+ * `read_file` / `write_file` / `patch_file` / `list_directory`: Surgical and sandboxed workspace file operations.
86
+ * `execute_command`: Shell command and Python script execution with timeouts and security checks.
87
+ * `run_tests`: Pytest runner with failure analysis and traceback extraction.
88
+ * `git_checkpoint` / `git_diff` / `git_rollback`: Version control safety and rollback support.
89
+ * **Self-Healing & Autonomous Debugging**: When scripts fail with errors (e.g., shape mismatches, missing modules, runtime exceptions), SageCLI intercepts the stderr/stack trace, diagnoses the cause, patches the code, and re-executes until verified.
90
+ * **Execution Modes**:
91
+ * `Safe` (Default) — Requests user approval before running write or shell operations.
92
+ * `Auto` — Autonomously executes safe workspace steps, prompting only for destructive actions.
93
+ * `Plan` — Generates comprehensive plans and diffs without modifying files on disk.
94
+ * **State & Memory Management**: Persists conversation history, task memory, dataset metadata, and ML experiment metrics in `.sage/` (automatically added to `.gitignore`).
95
+
96
+ ---
97
+
98
+ ## 📦 Installation
99
+
100
+ ### From PyPI
101
+ ```bash
102
+ pip install sage-ai-cli
103
+ ```
104
+
105
+ ### From Source (Development)
106
+ ```bash
107
+ # Clone the repository
108
+ git clone https://github.com/zaheerjklabs/SageCLI.git
109
+ cd SageCLI
110
+
111
+ # Install in editable mode
112
+ pip install -e .
113
+ ```
114
+
115
+ ---
116
+
117
+ ## ⚡ Quickstart
118
+
119
+ ### 1. Launch SageCLI
120
+ ```bash
121
+ sage
122
+ ```
123
+ On first launch, the interactive setup wizard will guide you through provider selection and credential validation.
124
+
125
+ ### 2. Interactive Engineering Prompt
126
+ ```text
127
+ sage ❯ Build a customer churn prediction system using data/raw/customers.csv with XGBoost and a FastAPI endpoint.
128
+ ```
129
+
130
+ SageCLI will:
131
+ 1. 🔍 **Inspect** `data/raw/customers.csv` and report feature distributions.
132
+ 2. 📐 **Plan** modular components (`src/data.py`, `src/model.py`, `src/train.py`, `src/app.py`).
133
+ 3. 💻 **Implement** clean preprocessing, feature engineering, and model training.
134
+ 4. ⚡ **Execute** the pipeline and self-debug any runtime errors.
135
+ 5. 📊 **Evaluate** ROC-AUC, Precision/Recall, and log metrics.
136
+ 6. 🚀 **Deliver** test suites and a FastAPI inference service.
137
+
138
+ ---
139
+
140
+ ## 🎮 Interactive Slash Commands (`/`)
141
+
142
+ SageCLI provides an intuitive, Claude Code-inspired command palette with autocompletion and instant dropdown help:
143
+
144
+ | Command | Action | Description |
145
+ | :--- | :--- | :--- |
146
+ | `/help` | Detailed help manual | View all commands, shortcuts, and capabilities |
147
+ | `/setup` | Setup wizard | Interactive multi-provider and API key configuration |
148
+ | `/config` | View/edit settings | Show active configuration or update with `/config set <key> <val>` |
149
+ | `/mode <safe\|auto\|plan>` | Switch execution mode | `Safe` (confirm writes), `Auto` (full autonomous), `Plan` (read-only) |
150
+ | `/model [name]` | Switch LLM model | Switch model or view recommended options |
151
+ | `/provider [name]` | Switch AI provider | `gemini`, `openai`, `anthropic`, `groq`, `openrouter`, `ollama` |
152
+ | `/doctor` | Environment diagnostics | Inspect Python, GPU/CUDA, Git repo, disk space, and API latency |
153
+ | `/cost` / `/usage` | Token & cost tracking | Display session token usage and estimated USD cost breakdown |
154
+ | `/context` | Workspace summary | Review detected directory tree, datasets, and ML stack |
155
+ | `/memory` | Session task memory | Display or reset active task history and persistent state |
156
+ | `/dataset <path>` | EDA & Data Profiling | Analyze dataset shape, missing values, statistics, and distributions |
157
+ | `/diff` | Git diff | View uncommitted code modifications |
158
+ | `/checkpoint <msg>` | Git checkpoint | Create an immediate snapshot commit |
159
+ | `/rollback` | Git rollback | Revert workspace changes safely |
160
+ | `/compact` | Memory compaction | Compact session history to save token context window |
161
+ | `/ascii` | Toggle ASCII mode | Switch between Unicode and pure ASCII terminal glyphs |
162
+ | `/demo` | Status language demo | Preview SageCLI's branded status symbols and styling |
163
+ | `/clear` | Clear screen | Clear terminal view while preserving session state |
164
+ | `/exit` / `/quit` | Exit | Exit SageCLI session |
165
+
166
+ ---
167
+
168
+ ## 🏗️ Architecture
169
+
170
+ ```text
171
+ src/sagecli/
172
+ ├── __init__.py # Package version and brand definitions
173
+ ├── __main__.py # python -m sagecli entry point
174
+ ├── cli.py # Typer application, CLI flags, and interactive REPL
175
+ ├── config.py # Multi-provider hierarchical configuration
176
+ ├── security.py # Secret masking, sandboxing, and safety checks
177
+ ├── wizard.py # First-run interactive setup wizard
178
+ ├── core/
179
+ │ ├── agent.py # Autonomous agent execution loop
180
+ │ ├── state.py # Project memory, task history, and metrics in .sage/
181
+ │ ├── context.py # Workspace scanner, dataset detector, and environment specs
182
+ │ └── orchestrator.py # Multi-role prompt engineering for ML/DL pipelines
183
+ ├── llm/
184
+ │ ├── base.py # Provider interface and message models
185
+ │ ├── factory.py # Dynamic provider factory
186
+ │ ├── gemini_provider.py# Google Gemini provider
187
+ │ ├── openai_provider.py# OpenAI / Groq / OpenRouter / Ollama provider
188
+ │ └── anthropic_provider.py # Anthropic Claude provider
189
+ ├── tools/
190
+ │ ├── base.py # Tool base class and schemas
191
+ │ ├── registry.py # Tool registry and permission dispatcher
192
+ │ ├── file_ops.py # Read, write, patch, list files
193
+ │ ├── shell_ops.py # Terminal command and script execution
194
+ │ ├── dataset_ops.py # Exploratory data analysis & schema inspection
195
+ │ ├── test_eval_ops.py # Pytest execution and failure parser
196
+ │ └── git_ops.py # Git checkpoints, diffs, and rollbacks
197
+ └── ui/
198
+ ├── banner.py # Startup banner, splash, metadata table
199
+ ├── console.py # Branded visual language formatters
200
+ ├── logo.py # ASCII logo and responsive renderers
201
+ ├── prompts.py # Interactive prompt_toolkit session
202
+ ├── symbols.py # Unicode & ASCII symbols
203
+ └── theme.py # SageCLI palette and Rich styles
204
+ ```
205
+
206
+ ---
207
+
208
+ ## 🧪 Testing
209
+
210
+ Run the full automated test suite with:
211
+
212
+ ```bash
213
+ python3 -m pytest -v
214
+ ```
@@ -0,0 +1,40 @@
1
+ sage_ai_cli-0.1.0.dist-info/licenses/LICENSE,sha256=di-fUu_7bi14Zi_5tYq1WXaz_0ymSYCTOZ6lN-Km6h0,1071
2
+ sagecli/__init__.py,sha256=fA9FcZiYMXastMgjt5bm7CqFhmTGIS-Wh7HgQ5Ju-BU,233
3
+ sagecli/__main__.py,sha256=ov0gnHlj8ay-Txuxuli09IV84UJcVitsbp-wTKH9FkE,108
4
+ sagecli/cli.py,sha256=eWdOVMHEQw21i-dZrxAntas3ATD-PKAaxkOr41j0WMc,21687
5
+ sagecli/config.py,sha256=VEO8WlBVlgioPTT3b9vAL9Az05leU-Ue2wr5ERytUQ4,9289
6
+ sagecli/security.py,sha256=wzlIbAzAoX_f9A579jjQGu-B42RLFk6pRS5_Y8qOL3o,3539
7
+ sagecli/wizard.py,sha256=C3wV3YUxABZGqE6YzwLYoxtzHI4BkuznJVFbQuQhrf4,6007
8
+ sagecli/core/__init__.py,sha256=VdIDOOTPKyNmj_73ztqB8lvLzMdbtUu0btvFYpEJa28,422
9
+ sagecli/core/agent.py,sha256=P-2rISLneYOuSF_h9nPy9_C5dAqjRL6N5Fd0w-XKLKE,9503
10
+ sagecli/core/context.py,sha256=a9MkGLfkA5mm2iMXxY8lfyVZMAzIWuMU44d5cVQhpOw,4232
11
+ sagecli/core/doctor.py,sha256=vJtHK_kqWLc4FSScRlQYknI9SzrvoY1pYfXSuRpKzxE,4876
12
+ sagecli/core/orchestrator.py,sha256=1r8xpNVVsVZh8b4SJmWHQtjol-p3s11iw7pBZrQvQAE,2506
13
+ sagecli/core/state.py,sha256=0__PWoKnir-2iUDT5SG-PM4cJYKpI6muB2dczkV4poo,3027
14
+ sagecli/core/tracker.py,sha256=gxZ6S17GlRLNzKHmN3lPm7nqiRtlLn3zgGMiwOYtJU4,2878
15
+ sagecli/llm/__init__.py,sha256=fTAuJd394hiMRHO4byJzQl_6iH1XNK2Xq25H_bOdGWk,519
16
+ sagecli/llm/anthropic_provider.py,sha256=YuP_JbwsDUdqWgPKrXKKssGiVTgLc2_PEQC9oN9kCkg,9999
17
+ sagecli/llm/base.py,sha256=cep5Q1JNX0AKf_8UTM28xzxM6oNcaqbzFhIkKOVBpUk,2651
18
+ sagecli/llm/factory.py,sha256=9k73NPbLbf5VdipqQ8EShbsDXKM1yhwXT5g6K3bl0OA,2492
19
+ sagecli/llm/gemini_provider.py,sha256=q1sZlsnsboUK9fVjubDwqrt_5KxkttOZP1A059v33Xs,11716
20
+ sagecli/llm/openai_provider.py,sha256=ZXT4T4XBFHxRq0EThLWxKVJBRR8ISEn4C8BSt7J2pDw,8897
21
+ sagecli/tools/__init__.py,sha256=7NuPlYMuQiV_dqK3aAp7jfiKsott-jFDhTQ9ue_2S8Q,841
22
+ sagecli/tools/base.py,sha256=pYcGs5VcYPBnwmAATduFtRg4MsJ973FCKCtjzxvDrOQ,1269
23
+ sagecli/tools/dataset_ops.py,sha256=8qHnyPmC5_bpR3tzUa-3GZ4diZ3AvRGaKJ0idbgpSoQ,6729
24
+ sagecli/tools/file_ops.py,sha256=XbxmhyIbrz7LW7KGY7b98Wio28qrbChPZhevV4LfXmU,8006
25
+ sagecli/tools/git_ops.py,sha256=R8Z6Fe55TnYIXt9KXv3rjDwey9uDC5J31lmJKK6ugBk,4336
26
+ sagecli/tools/registry.py,sha256=BOoOHcb1I5xPrDAOkLGQNPFO4-gAWgdmmS41wUA3GF0,3682
27
+ sagecli/tools/shell_ops.py,sha256=FJcgFIsSOURntJDA7Oq9b5EPAIkVWvd703w8uVASHnE,2871
28
+ sagecli/tools/test_eval_ops.py,sha256=hiLVhEfHndyTg1r_GiDtGK1QG9x78ZX_962ctcmbb_A,2439
29
+ sagecli/ui/__init__.py,sha256=ufJQz-C-edIGDVlW1fj6NwwBZuPbodv1tJ4RpnZjP7s,1526
30
+ sagecli/ui/banner.py,sha256=sfpMvQKmpSfcT1YKXzBjkdMzfAdtH28pO9SXxyUCgTo,10931
31
+ sagecli/ui/console.py,sha256=lXwzFAagjzv-QHN8uU34Jlbgk06VNzji2Bwv_89LPrQ,6369
32
+ sagecli/ui/logo.py,sha256=7S5MGxO2u4DZNA_pxiYHId2ZMA9ZJmTOppC0QS0i1qg,5133
33
+ sagecli/ui/prompts.py,sha256=SROrsAVAWGWlcHEhqE66XUlO2FVqq_oqpUu9joFdez8,7073
34
+ sagecli/ui/symbols.py,sha256=koLJqyFzQoA8QhVJucBdaUlmx_Y_Ks2Vid5_ypj6Ots,2131
35
+ sagecli/ui/theme.py,sha256=AkRtTQmAGNRFJuhRcOXk10pjX79J7EFFmuV8h3mG97s,4125
36
+ sage_ai_cli-0.1.0.dist-info/METADATA,sha256=fGagTOCoKyI262MzKEUu59yI1S9c85UL4lW4saQUiuE,9965
37
+ sage_ai_cli-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
38
+ sage_ai_cli-0.1.0.dist-info/entry_points.txt,sha256=uLQRSbSQmmwXoXV0cqy1ez9BvaFOnf6TN-qYAW3agFU,67
39
+ sage_ai_cli-0.1.0.dist-info/top_level.txt,sha256=fAtAH_nbWgIwOIToOIlOp2P5VYJ2DHBGPjmh7Ro6JoA,8
40
+ sage_ai_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ sage = sagecli.cli:app
3
+ sagecli = sagecli.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zaheer JK Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ sagecli
sagecli/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ """SageCLI - AI Engineering Agent for Terminal."""
2
+
3
+ __version__ = "0.1.0"
4
+ __app_name__ = "SageCLI"
5
+ __command__ = "sage"
6
+ __tagline__ = "AI ENGINEERING AGENT"
7
+ __secondary_tagline__ = "Build • Train • Debug • Evaluate • Deploy"
sagecli/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """Entry point for python -m sagecli."""
2
+
3
+ from sagecli.cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()