isage-cli 0.2.4.14__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.
Files changed (118) hide show
  1. isage_cli-0.2.4.14/MANIFEST.in +7 -0
  2. isage_cli-0.2.4.14/PKG-INFO +295 -0
  3. isage_cli-0.2.4.14/README.md +261 -0
  4. isage_cli-0.2.4.14/pyproject.toml +93 -0
  5. isage_cli-0.2.4.14/setup.cfg +4 -0
  6. isage_cli-0.2.4.14/setup.py +9 -0
  7. isage_cli-0.2.4.14/src/isage_cli.egg-info/PKG-INFO +295 -0
  8. isage_cli-0.2.4.14/src/isage_cli.egg-info/SOURCES.txt +116 -0
  9. isage_cli-0.2.4.14/src/isage_cli.egg-info/dependency_links.txt +1 -0
  10. isage_cli-0.2.4.14/src/isage_cli.egg-info/entry_points.txt +2 -0
  11. isage_cli-0.2.4.14/src/isage_cli.egg-info/requires.txt +14 -0
  12. isage_cli-0.2.4.14/src/isage_cli.egg-info/top_level.txt +1 -0
  13. isage_cli-0.2.4.14/src/sage/cli/__init__.py +22 -0
  14. isage_cli-0.2.4.14/src/sage/cli/__init__.pyc +0 -0
  15. isage_cli-0.2.4.14/src/sage/cli/__pycache__/__init__.cpython-311.pyc +0 -0
  16. isage_cli-0.2.4.14/src/sage/cli/__pycache__/_version.cpython-311.pyc +0 -0
  17. isage_cli-0.2.4.14/src/sage/cli/__pycache__/main.cpython-311.pyc +0 -0
  18. isage_cli-0.2.4.14/src/sage/cli/_version.py +5 -0
  19. isage_cli-0.2.4.14/src/sage/cli/_version.pyc +0 -0
  20. isage_cli-0.2.4.14/src/sage/cli/commands/__init__.py +0 -0
  21. isage_cli-0.2.4.14/src/sage/cli/commands/__init__.pyc +0 -0
  22. isage_cli-0.2.4.14/src/sage/cli/commands/__pycache__/__init__.cpython-311.pyc +0 -0
  23. isage_cli-0.2.4.14/src/sage/cli/commands/__pycache__/demo.cpython-311.pyc +0 -0
  24. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__init__.py +68 -0
  25. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__init__.pyc +0 -0
  26. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/__init__.cpython-311.pyc +0 -0
  27. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/chat.cpython-311.pyc +0 -0
  28. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/embedding.cpython-311.pyc +0 -0
  29. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/gateway.cpython-311.pyc +0 -0
  30. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/inference.cpython-311.pyc +0 -0
  31. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/llm.cpython-311.pyc +0 -0
  32. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/pipeline.cpython-311.pyc +0 -0
  33. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/pipeline_domain.cpython-311.pyc +0 -0
  34. isage_cli-0.2.4.14/src/sage/cli/commands/apps/__pycache__/pipeline_knowledge.cpython-311.pyc +0 -0
  35. isage_cli-0.2.4.14/src/sage/cli/commands/apps/chat.pyc +0 -0
  36. isage_cli-0.2.4.14/src/sage/cli/commands/apps/embedding.pyc +0 -0
  37. isage_cli-0.2.4.14/src/sage/cli/commands/apps/gateway.pyc +0 -0
  38. isage_cli-0.2.4.14/src/sage/cli/commands/apps/inference.pyc +0 -0
  39. isage_cli-0.2.4.14/src/sage/cli/commands/apps/llm.pyc +0 -0
  40. isage_cli-0.2.4.14/src/sage/cli/commands/apps/pipeline.pyc +0 -0
  41. isage_cli-0.2.4.14/src/sage/cli/commands/apps/pipeline_domain.pyc +0 -0
  42. isage_cli-0.2.4.14/src/sage/cli/commands/apps/pipeline_embedding.pyc +0 -0
  43. isage_cli-0.2.4.14/src/sage/cli/commands/apps/pipeline_knowledge.pyc +0 -0
  44. isage_cli-0.2.4.14/src/sage/cli/commands/demo.pyc +0 -0
  45. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__init__.py +110 -0
  46. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__init__.pyc +0 -0
  47. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/__init__.cpython-311.pyc +0 -0
  48. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/cluster.cpython-311.pyc +0 -0
  49. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/config.cpython-311.pyc +0 -0
  50. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/docs.cpython-311.pyc +0 -0
  51. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/doctor.cpython-311.pyc +0 -0
  52. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/env.cpython-311.pyc +0 -0
  53. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/extensions.cpython-311.pyc +0 -0
  54. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/head.cpython-311.pyc +0 -0
  55. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/job.cpython-311.pyc +0 -0
  56. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/jobmanager.cpython-311.pyc +0 -0
  57. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/llm_config.cpython-311.pyc +0 -0
  58. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/logs.cpython-311.pyc +0 -0
  59. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/runtime.cpython-311.pyc +0 -0
  60. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/runtime_checker.cpython-311.pyc +0 -0
  61. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/version.cpython-311.pyc +0 -0
  62. isage_cli-0.2.4.14/src/sage/cli/commands/platform/__pycache__/worker.cpython-311.pyc +0 -0
  63. isage_cli-0.2.4.14/src/sage/cli/commands/platform/cluster.pyc +0 -0
  64. isage_cli-0.2.4.14/src/sage/cli/commands/platform/config.pyc +0 -0
  65. isage_cli-0.2.4.14/src/sage/cli/commands/platform/docs.pyc +0 -0
  66. isage_cli-0.2.4.14/src/sage/cli/commands/platform/doctor.pyc +0 -0
  67. isage_cli-0.2.4.14/src/sage/cli/commands/platform/env.pyc +0 -0
  68. isage_cli-0.2.4.14/src/sage/cli/commands/platform/extensions.pyc +0 -0
  69. isage_cli-0.2.4.14/src/sage/cli/commands/platform/head.pyc +0 -0
  70. isage_cli-0.2.4.14/src/sage/cli/commands/platform/job.pyc +0 -0
  71. isage_cli-0.2.4.14/src/sage/cli/commands/platform/jobmanager.pyc +0 -0
  72. isage_cli-0.2.4.14/src/sage/cli/commands/platform/llm_config.pyc +0 -0
  73. isage_cli-0.2.4.14/src/sage/cli/commands/platform/logs.pyc +0 -0
  74. isage_cli-0.2.4.14/src/sage/cli/commands/platform/runtime.pyc +0 -0
  75. isage_cli-0.2.4.14/src/sage/cli/commands/platform/runtime_checker.pyc +0 -0
  76. isage_cli-0.2.4.14/src/sage/cli/commands/platform/ssh_setup.pyc +0 -0
  77. isage_cli-0.2.4.14/src/sage/cli/commands/platform/version.pyc +0 -0
  78. isage_cli-0.2.4.14/src/sage/cli/commands/platform/worker.pyc +0 -0
  79. isage_cli-0.2.4.14/src/sage/cli/core/__init__.py +16 -0
  80. isage_cli-0.2.4.14/src/sage/cli/core/__init__.pyc +0 -0
  81. isage_cli-0.2.4.14/src/sage/cli/core/__pycache__/__init__.cpython-311.pyc +0 -0
  82. isage_cli-0.2.4.14/src/sage/cli/core/__pycache__/exceptions.cpython-311.pyc +0 -0
  83. isage_cli-0.2.4.14/src/sage/cli/core/base.pyc +0 -0
  84. isage_cli-0.2.4.14/src/sage/cli/core/config.pyc +0 -0
  85. isage_cli-0.2.4.14/src/sage/cli/core/config_refactored.pyc +0 -0
  86. isage_cli-0.2.4.14/src/sage/cli/core/exceptions.pyc +0 -0
  87. isage_cli-0.2.4.14/src/sage/cli/core/output.pyc +0 -0
  88. isage_cli-0.2.4.14/src/sage/cli/core/refactor_example.pyc +0 -0
  89. isage_cli-0.2.4.14/src/sage/cli/core/ssh.pyc +0 -0
  90. isage_cli-0.2.4.14/src/sage/cli/core/utils.pyc +0 -0
  91. isage_cli-0.2.4.14/src/sage/cli/core/validation.pyc +0 -0
  92. isage_cli-0.2.4.14/src/sage/cli/main.pyc +0 -0
  93. isage_cli-0.2.4.14/src/sage/cli/management/__init__.py +14 -0
  94. isage_cli-0.2.4.14/src/sage/cli/management/__init__.pyc +0 -0
  95. isage_cli-0.2.4.14/src/sage/cli/management/__pycache__/__init__.cpython-311.pyc +0 -0
  96. isage_cli-0.2.4.14/src/sage/cli/management/__pycache__/config_manager.cpython-311.pyc +0 -0
  97. isage_cli-0.2.4.14/src/sage/cli/management/__pycache__/deployment_manager.cpython-311.pyc +0 -0
  98. isage_cli-0.2.4.14/src/sage/cli/management/config_manager.pyc +0 -0
  99. isage_cli-0.2.4.14/src/sage/cli/management/deployment_manager.pyc +0 -0
  100. isage_cli-0.2.4.14/src/sage/cli/templates/__init__.py +21 -0
  101. isage_cli-0.2.4.14/src/sage/cli/templates/__init__.pyc +0 -0
  102. isage_cli-0.2.4.14/src/sage/cli/templates/__pycache__/__init__.cpython-311.pyc +0 -0
  103. isage_cli-0.2.4.14/src/sage/cli/templates/__pycache__/catalog.cpython-311.pyc +0 -0
  104. isage_cli-0.2.4.14/src/sage/cli/templates/__pycache__/pipeline_blueprints.cpython-311.pyc +0 -0
  105. isage_cli-0.2.4.14/src/sage/cli/templates/catalog.pyc +0 -0
  106. isage_cli-0.2.4.14/src/sage/cli/templates/pipeline_blueprints.pyc +0 -0
  107. isage_cli-0.2.4.14/src/sage/cli/utils/__init__.py +17 -0
  108. isage_cli-0.2.4.14/src/sage/cli/utils/__init__.pyc +0 -0
  109. isage_cli-0.2.4.14/src/sage/cli/utils/__pycache__/__init__.cpython-311.pyc +0 -0
  110. isage_cli-0.2.4.14/src/sage/cli/utils/__pycache__/diagnostics.cpython-311.pyc +0 -0
  111. isage_cli-0.2.4.14/src/sage/cli/utils/__pycache__/env.cpython-311.pyc +0 -0
  112. isage_cli-0.2.4.14/src/sage/cli/utils/__pycache__/llm_detection.cpython-311.pyc +0 -0
  113. isage_cli-0.2.4.14/src/sage/cli/utils/dev_check.pyc +0 -0
  114. isage_cli-0.2.4.14/src/sage/cli/utils/diagnostics.pyc +0 -0
  115. isage_cli-0.2.4.14/src/sage/cli/utils/env.pyc +0 -0
  116. isage_cli-0.2.4.14/src/sage/cli/utils/llm_detection.pyc +0 -0
  117. isage_cli-0.2.4.14/tests/test_cli_help.py +36 -0
  118. isage_cli-0.2.4.14/tests/test_inference_cli.py +335 -0
@@ -0,0 +1,7 @@
1
+ # Include compiled files and binary extensions
2
+ recursive-include src *.pyc
3
+ recursive-include src *.pyo
4
+ recursive-include src __pycache__/*
5
+ recursive-include src *.so
6
+ recursive-include src *.pyd
7
+ recursive-include src *.dylib
@@ -0,0 +1,295 @@
1
+ Metadata-Version: 2.4
2
+ Name: isage-cli
3
+ Version: 0.2.4.14
4
+ Summary: SAGE Command Line Interface - Unified CLI for SAGE platform
5
+ Author-email: IntelliStream Team <shuhao_zhang@hust.edu.cn>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/intellistream/SAGE
8
+ Project-URL: Documentation, https://intellistream.github.io/SAGE
9
+ Project-URL: Repository, https://github.com/intellistream/SAGE
10
+ Project-URL: Issues, https://github.com/intellistream/SAGE/issues
11
+ Keywords: sage,cli,command-line,streaming,ai
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: ==3.11.*
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: typer<1.0.0,>=0.15.0
22
+ Requires-Dist: rich>=13.0.0
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: python-dotenv<2.0.0,>=1.1.0
25
+ Requires-Dist: requests<3.0.0,>=2.32.0
26
+ Requires-Dist: httpx<1.0.0,>=0.28.0
27
+ Requires-Dist: colorama>=0.4.6
28
+ Requires-Dist: tabulate<1.0.0,>=0.9.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
32
+ Requires-Dist: ruff==0.14.6; extra == "dev"
33
+ Requires-Dist: isage-pypi-publisher>=0.2.0; extra == "dev"
34
+
35
+ # SAGE CLI
36
+
37
+ > **Unified Command Line Interface for SAGE Platform**
38
+
39
+ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
40
+ [![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](../../LICENSE)
41
+
42
+ SAGE CLI (`sage-cli`) is the unified command-line interface for the SAGE (Streaming-Augmented
43
+ Generative Execution) platform. It provides a comprehensive set of commands for managing clusters,
44
+ deploying applications, and developing with SAGE.
45
+
46
+ ## 🧭 Governance / 团队协作制度
47
+
48
+ - `docs/governance/TEAM.md`
49
+ - `docs/governance/MAINTAINERS.md`
50
+ - `docs/governance/DEVELOPER_GUIDE.md`
51
+ - `docs/governance/PR_CHECKLIST.md`
52
+ - `docs/governance/SELF_HOSTED_RUNNER.md`
53
+ - `docs/governance/TODO.md`
54
+
55
+ ## 📋 Overview
56
+
57
+ **SAGE CLI** is the unified command-line interface for SAGE platform, providing commands for:
58
+
59
+ - **Cluster Management**: Start/stop Flownet-based runtime clusters, manage head/worker nodes
60
+ - **LLM Services**: Launch and manage LLM inference services
61
+ - **Development**: Tools for testing, quality checks, and project management
62
+ - **Monitoring**: System diagnostics and status checks
63
+
64
+ ## ✨ Features
65
+
66
+ - **Unified Interface**: Single `sage` command for all platform operations
67
+ - **Cluster Orchestration**: Full Flownet runtime lifecycle management
68
+ - **LLM Integration**: Start LLM services with automatic model loading
69
+ - **Interactive Chat**: Built-in chat interface for testing
70
+ - **Development Tools**: Via separate `sage-dev` command from sage-tools package
71
+
72
+ ## 🚀 Installation
73
+
74
+ ```bash
75
+ # From source
76
+ cd packages/sage-cli
77
+ pip install -e .
78
+
79
+ # Or install from PyPI (when published)
80
+ pip install sage-cli
81
+ ```
82
+
83
+ ## 📋 Command Structure
84
+
85
+ SAGE CLI organizes commands into two main categories:
86
+
87
+ ### Platform Commands
88
+
89
+ Manage SAGE infrastructure and system components:
90
+
91
+ - `sage cluster` - Flownet runtime cluster management
92
+ - `sage head` - Head node management
93
+ - `sage worker` - Worker node management
94
+ - `sage job` - Job management
95
+ - `sage jobmanager` - JobManager service
96
+ - `sage config` - Configuration management
97
+ - `sage doctor` - System diagnostics
98
+ - `sage version` - Version information
99
+ - `sage extensions` - C++ extension management
100
+
101
+ ### Application Commands
102
+
103
+ Application-level functionality:
104
+
105
+ - `sage llm` - LLM service management
106
+ - `sage chat` - Interactive chat interface
107
+ - `sage embedding` - Embedding service management
108
+ - `sage pipeline` - Pipeline builder
109
+ - `sage studio` - Visual pipeline editor
110
+
111
+ ### Development Commands
112
+
113
+ **Note:** Development commands are provided by the `sage-tools` package separately via the
114
+ `sage-dev` command.
115
+
116
+ To use development tools:
117
+
118
+ ```bash
119
+ # Install sage-tools (if not already installed)
120
+ pip install sage-tools
121
+
122
+ # Use sage-dev command
123
+ sage-dev quality check
124
+ sage-dev project test
125
+ sage-dev maintain doctor
126
+ ```
127
+
128
+ Development command groups include:
129
+
130
+ - `sage-dev quality` - Code quality checks
131
+ - `sage-dev project` - Project management
132
+ - `sage-dev maintain` - Maintenance tools
133
+ - `sage-dev package` - Package management
134
+ - `sage-dev resource` - Resource management
135
+ - `sage-dev github` - GitHub utilities
136
+
137
+ ## 📖 Quick Start
138
+
139
+ ### Basic Commands
140
+
141
+ ```bash
142
+ # Check system status
143
+ sage doctor
144
+
145
+ # View version
146
+ sage version
147
+
148
+ # Get help
149
+ sage --help
150
+ sage <command> --help
151
+ ```
152
+
153
+ ### Cluster Management
154
+
155
+ ```bash
156
+ # Start a cluster
157
+ sage cluster start
158
+
159
+ # View cluster status
160
+ sage cluster status
161
+
162
+ # Stop cluster
163
+ sage cluster stop
164
+ ```
165
+
166
+ ### LLM Service
167
+
168
+ ```bash
169
+ # Start LLM service
170
+ sage llm start --model Qwen/Qwen2.5-7B-Instruct
171
+
172
+ # Check status
173
+ sage llm status
174
+
175
+ # Interactive chat
176
+ sage chat
177
+ ```
178
+
179
+ ### Development Tools
180
+
181
+ For development commands, install `sage-tools`:
182
+
183
+ ```bash
184
+ pip install sage-tools
185
+
186
+ # Run development checks
187
+ sage-dev quality check
188
+
189
+ # Run tests
190
+ sage-dev project test
191
+ ```
192
+
193
+ ## � Configuration
194
+
195
+ SAGE CLI reads configuration from:
196
+
197
+ - `~/.sage/config.yaml` - User configuration
198
+ - `./config/config.yaml` - Project configuration
199
+ - Environment variables: `SAGE_*`
200
+
201
+ ```yaml
202
+ # config.yaml example
203
+ cluster:
204
+ head_node: localhost
205
+ workers: 4
206
+
207
+ llm:
208
+ model: Qwen/Qwen2.5-7B-Instruct
209
+ port: 8001
210
+ ```
211
+
212
+ ## 📦 Package Structure
213
+
214
+ ```
215
+ sage-cli/
216
+ ├── src/
217
+ │ └── sage/
218
+ │ └── cli/
219
+ │ ├── commands/ # Command implementations
220
+ │ ├── cluster/ # Cluster management
221
+ │ └── llm/ # LLM service commands
222
+ ├── tests/
223
+ ├── pyproject.toml
224
+ └── README.md
225
+ ```
226
+
227
+ ## 🧪 Testing
228
+
229
+ ```bash
230
+ # Run CLI tests
231
+ pytest packages/sage-cli/tests/
232
+
233
+ # Test specific command
234
+ sage --help
235
+ sage cluster --help
236
+
237
+ # Run integration tests
238
+ sage-dev project test --package sage-cli
239
+ ```
240
+
241
+ ## �📚 Documentation
242
+
243
+ For detailed documentation, see:
244
+
245
+ - [SAGE Documentation](https://intellistream.github.io/SAGE)
246
+ - [Project Changelog](../../CHANGELOG.md)
247
+
248
+ ## 🏗️ Architecture
249
+
250
+ SAGE CLI is part of the L5 (Interface Layer) in the SAGE architecture:
251
+
252
+ ```
253
+ L1: sage-common (Foundation)
254
+ L2: sage-platform (Platform Core)
255
+ L3: sage-kernel, sage-libs
256
+ L4: sage-middleware
257
+ L5: sage-cli, sage-tools
258
+ ├── sage-cli: Production CLI via `sage` command
259
+ └── sage-tools: Development tools via `sage-dev` command
260
+ ```
261
+
262
+ **Independent Repositories:**
263
+
264
+ - sage-benchmark: Benchmark suites
265
+ - sage-examples: Applications and tutorials
266
+ - sage-studio: Visual interface
267
+ - sageLLM: LLM inference engine
268
+
269
+ **Command Separation:**
270
+
271
+ - **sage** (from sage-cli): User-facing production commands
272
+
273
+ - Platform: cluster, head, worker, job, jobmanager, config, doctor, version, extensions
274
+ - Apps: llm, chat, embedding, pipeline
275
+
276
+ - **sage-dev** (from sage-tools): Developer-only commands
277
+
278
+ - quality, project, maintain, package, resource, github
279
+
280
+ Both packages are independent and can be installed separately.
281
+
282
+ ## 🤝 Contributing
283
+
284
+ Contributions are welcome! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
285
+
286
+ ## 📄 License
287
+
288
+ Apache License 2.0 - see [LICENSE](../../LICENSE) for details.
289
+
290
+ ## 🔗 Related Packages
291
+
292
+ - `sage-tools` - Development tools and `sage-dev` commands
293
+ - `sage-platform` - SAGE platform core
294
+ - `sage-apps` - SAGE applications
295
+ - `sage-studio` - Visual pipeline editor
@@ -0,0 +1,261 @@
1
+ # SAGE CLI
2
+
3
+ > **Unified Command Line Interface for SAGE Platform**
4
+
5
+ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
6
+ [![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](../../LICENSE)
7
+
8
+ SAGE CLI (`sage-cli`) is the unified command-line interface for the SAGE (Streaming-Augmented
9
+ Generative Execution) platform. It provides a comprehensive set of commands for managing clusters,
10
+ deploying applications, and developing with SAGE.
11
+
12
+ ## 🧭 Governance / 团队协作制度
13
+
14
+ - `docs/governance/TEAM.md`
15
+ - `docs/governance/MAINTAINERS.md`
16
+ - `docs/governance/DEVELOPER_GUIDE.md`
17
+ - `docs/governance/PR_CHECKLIST.md`
18
+ - `docs/governance/SELF_HOSTED_RUNNER.md`
19
+ - `docs/governance/TODO.md`
20
+
21
+ ## 📋 Overview
22
+
23
+ **SAGE CLI** is the unified command-line interface for SAGE platform, providing commands for:
24
+
25
+ - **Cluster Management**: Start/stop Flownet-based runtime clusters, manage head/worker nodes
26
+ - **LLM Services**: Launch and manage LLM inference services
27
+ - **Development**: Tools for testing, quality checks, and project management
28
+ - **Monitoring**: System diagnostics and status checks
29
+
30
+ ## ✨ Features
31
+
32
+ - **Unified Interface**: Single `sage` command for all platform operations
33
+ - **Cluster Orchestration**: Full Flownet runtime lifecycle management
34
+ - **LLM Integration**: Start LLM services with automatic model loading
35
+ - **Interactive Chat**: Built-in chat interface for testing
36
+ - **Development Tools**: Via separate `sage-dev` command from sage-tools package
37
+
38
+ ## 🚀 Installation
39
+
40
+ ```bash
41
+ # From source
42
+ cd packages/sage-cli
43
+ pip install -e .
44
+
45
+ # Or install from PyPI (when published)
46
+ pip install sage-cli
47
+ ```
48
+
49
+ ## 📋 Command Structure
50
+
51
+ SAGE CLI organizes commands into two main categories:
52
+
53
+ ### Platform Commands
54
+
55
+ Manage SAGE infrastructure and system components:
56
+
57
+ - `sage cluster` - Flownet runtime cluster management
58
+ - `sage head` - Head node management
59
+ - `sage worker` - Worker node management
60
+ - `sage job` - Job management
61
+ - `sage jobmanager` - JobManager service
62
+ - `sage config` - Configuration management
63
+ - `sage doctor` - System diagnostics
64
+ - `sage version` - Version information
65
+ - `sage extensions` - C++ extension management
66
+
67
+ ### Application Commands
68
+
69
+ Application-level functionality:
70
+
71
+ - `sage llm` - LLM service management
72
+ - `sage chat` - Interactive chat interface
73
+ - `sage embedding` - Embedding service management
74
+ - `sage pipeline` - Pipeline builder
75
+ - `sage studio` - Visual pipeline editor
76
+
77
+ ### Development Commands
78
+
79
+ **Note:** Development commands are provided by the `sage-tools` package separately via the
80
+ `sage-dev` command.
81
+
82
+ To use development tools:
83
+
84
+ ```bash
85
+ # Install sage-tools (if not already installed)
86
+ pip install sage-tools
87
+
88
+ # Use sage-dev command
89
+ sage-dev quality check
90
+ sage-dev project test
91
+ sage-dev maintain doctor
92
+ ```
93
+
94
+ Development command groups include:
95
+
96
+ - `sage-dev quality` - Code quality checks
97
+ - `sage-dev project` - Project management
98
+ - `sage-dev maintain` - Maintenance tools
99
+ - `sage-dev package` - Package management
100
+ - `sage-dev resource` - Resource management
101
+ - `sage-dev github` - GitHub utilities
102
+
103
+ ## 📖 Quick Start
104
+
105
+ ### Basic Commands
106
+
107
+ ```bash
108
+ # Check system status
109
+ sage doctor
110
+
111
+ # View version
112
+ sage version
113
+
114
+ # Get help
115
+ sage --help
116
+ sage <command> --help
117
+ ```
118
+
119
+ ### Cluster Management
120
+
121
+ ```bash
122
+ # Start a cluster
123
+ sage cluster start
124
+
125
+ # View cluster status
126
+ sage cluster status
127
+
128
+ # Stop cluster
129
+ sage cluster stop
130
+ ```
131
+
132
+ ### LLM Service
133
+
134
+ ```bash
135
+ # Start LLM service
136
+ sage llm start --model Qwen/Qwen2.5-7B-Instruct
137
+
138
+ # Check status
139
+ sage llm status
140
+
141
+ # Interactive chat
142
+ sage chat
143
+ ```
144
+
145
+ ### Development Tools
146
+
147
+ For development commands, install `sage-tools`:
148
+
149
+ ```bash
150
+ pip install sage-tools
151
+
152
+ # Run development checks
153
+ sage-dev quality check
154
+
155
+ # Run tests
156
+ sage-dev project test
157
+ ```
158
+
159
+ ## � Configuration
160
+
161
+ SAGE CLI reads configuration from:
162
+
163
+ - `~/.sage/config.yaml` - User configuration
164
+ - `./config/config.yaml` - Project configuration
165
+ - Environment variables: `SAGE_*`
166
+
167
+ ```yaml
168
+ # config.yaml example
169
+ cluster:
170
+ head_node: localhost
171
+ workers: 4
172
+
173
+ llm:
174
+ model: Qwen/Qwen2.5-7B-Instruct
175
+ port: 8001
176
+ ```
177
+
178
+ ## 📦 Package Structure
179
+
180
+ ```
181
+ sage-cli/
182
+ ├── src/
183
+ │ └── sage/
184
+ │ └── cli/
185
+ │ ├── commands/ # Command implementations
186
+ │ ├── cluster/ # Cluster management
187
+ │ └── llm/ # LLM service commands
188
+ ├── tests/
189
+ ├── pyproject.toml
190
+ └── README.md
191
+ ```
192
+
193
+ ## 🧪 Testing
194
+
195
+ ```bash
196
+ # Run CLI tests
197
+ pytest packages/sage-cli/tests/
198
+
199
+ # Test specific command
200
+ sage --help
201
+ sage cluster --help
202
+
203
+ # Run integration tests
204
+ sage-dev project test --package sage-cli
205
+ ```
206
+
207
+ ## �📚 Documentation
208
+
209
+ For detailed documentation, see:
210
+
211
+ - [SAGE Documentation](https://intellistream.github.io/SAGE)
212
+ - [Project Changelog](../../CHANGELOG.md)
213
+
214
+ ## 🏗️ Architecture
215
+
216
+ SAGE CLI is part of the L5 (Interface Layer) in the SAGE architecture:
217
+
218
+ ```
219
+ L1: sage-common (Foundation)
220
+ L2: sage-platform (Platform Core)
221
+ L3: sage-kernel, sage-libs
222
+ L4: sage-middleware
223
+ L5: sage-cli, sage-tools
224
+ ├── sage-cli: Production CLI via `sage` command
225
+ └── sage-tools: Development tools via `sage-dev` command
226
+ ```
227
+
228
+ **Independent Repositories:**
229
+
230
+ - sage-benchmark: Benchmark suites
231
+ - sage-examples: Applications and tutorials
232
+ - sage-studio: Visual interface
233
+ - sageLLM: LLM inference engine
234
+
235
+ **Command Separation:**
236
+
237
+ - **sage** (from sage-cli): User-facing production commands
238
+
239
+ - Platform: cluster, head, worker, job, jobmanager, config, doctor, version, extensions
240
+ - Apps: llm, chat, embedding, pipeline
241
+
242
+ - **sage-dev** (from sage-tools): Developer-only commands
243
+
244
+ - quality, project, maintain, package, resource, github
245
+
246
+ Both packages are independent and can be installed separately.
247
+
248
+ ## 🤝 Contributing
249
+
250
+ Contributions are welcome! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
251
+
252
+ ## 📄 License
253
+
254
+ Apache License 2.0 - see [LICENSE](../../LICENSE) for details.
255
+
256
+ ## 🔗 Related Packages
257
+
258
+ - `sage-tools` - Development tools and `sage-dev` commands
259
+ - `sage-platform` - SAGE platform core
260
+ - `sage-apps` - SAGE applications
261
+ - `sage-studio` - Visual pipeline editor
@@ -0,0 +1,93 @@
1
+ [project]
2
+ name = "isage-cli"
3
+ dynamic = ["version"]
4
+ description = "SAGE Command Line Interface - Unified CLI for SAGE platform"
5
+ readme = "README.md"
6
+ requires-python = "==3.11.*"
7
+ license = { text = "MIT" }
8
+ authors = [{ name = "IntelliStream Team", email = "shuhao_zhang@hust.edu.cn" }]
9
+ keywords = ["sage", "cli", "command-line", "streaming", "ai"]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "Intended Audience :: Developers",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.9",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ ]
19
+
20
+ dependencies = [
21
+ "typer>=0.15.0,<1.0.0",
22
+ "rich>=13.0.0",
23
+ "pyyaml>=6.0",
24
+ "python-dotenv>=1.1.0,<2.0.0",
25
+ "requests>=2.32.0,<3.0.0",
26
+ "httpx>=0.28.0,<1.0.0",
27
+ "colorama>=0.4.6",
28
+ "tabulate>=0.9.0,<1.0.0",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ dev = ["pytest>=7.4.0", "pytest-cov>=4.0.0", "ruff==0.14.6", "isage-pypi-publisher>=0.2.0"]
33
+ [project.scripts]
34
+ sage = "sage.cli.main:app"
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/intellistream/SAGE"
38
+ Documentation = "https://intellistream.github.io/SAGE"
39
+ Repository = "https://github.com/intellistream/SAGE"
40
+ Issues = "https://github.com/intellistream/SAGE/issues"
41
+
42
+ [build-system]
43
+ requires = ["setuptools>=65.0", "wheel"]
44
+ build-backend = "setuptools.build_meta"
45
+
46
+ [tool.setuptools.packages.find]
47
+ namespaces = true
48
+ where = ["src"]
49
+
50
+ [tool.setuptools.dynamic]
51
+ version = { attr = "sage.cli._version.__version__" }
52
+
53
+ [tool.black]
54
+ line-length = 100
55
+ target-version = ['py39', 'py310', 'py311', 'py312']
56
+
57
+ [tool.isort]
58
+ profile = "black"
59
+ line_length = 100
60
+
61
+ # ============================================================================
62
+ # Code Quality Configuration
63
+ # Extends from root ruff.toml for unified standards across all packages
64
+ # ============================================================================
65
+ [tool.ruff]
66
+ extend = "../../tools/ruff.toml"
67
+
68
+ [tool.pytest.ini_options]
69
+ testpaths = ["tests", "src"]
70
+ python_files = ["test_*.py", "*_test.py"]
71
+ python_classes = ["Test*"]
72
+ python_functions = ["test_*"]
73
+ addopts = [
74
+ "--benchmark-storage=../../.sage/benchmarks",
75
+ "-o",
76
+ "cache_dir=../../.sage/cache/pytest",
77
+ "--strict-markers",
78
+ "--strict-config",
79
+ "--verbose",
80
+ "-ra",
81
+ ]
82
+ markers = [
83
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
84
+ "integration: marks tests as integration tests",
85
+ "unit: marks tests as unit tests",
86
+ "cli: marks tests as CLI tests",
87
+ ]
88
+
89
+ [tool.setuptools]
90
+ include-package-data = true
91
+
92
+ [tool.setuptools.package-data]
93
+ "*" = ["*.pyc", "*.pyo", "__pycache__/*", "*.so", "*.pyd", "*.dylib"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,9 @@
1
+
2
+ from setuptools import setup
3
+
4
+ setup(
5
+ include_package_data=True,
6
+ package_data={
7
+ "": ["*.pyc", "*.pyo", "__pycache__/*", "*.so", "*.pyd", "*.dylib"],
8
+ },
9
+ )