10xscale-agentflow-cli 0.1.5__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,458 @@
1
+ Metadata-Version: 2.4
2
+ Name: 10xscale-agentflow-cli
3
+ Version: 0.1.5
4
+ Summary: CLI and API for 10xscale AgentFlow
5
+ Author-email: 10xscale <contact@10xscale.ai>
6
+ Maintainer-email: Shudipto Trafder <shudiptotrafder@gmail.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/10xHub/agentflow-cli
9
+ Project-URL: Repository, https://github.com/10xHub/agentflow-cli
10
+ Project-URL: Issues, https://github.com/10xHub/agentflow-cli/issues
11
+ Project-URL: Documentation, https://agentflow-cli.readthedocs.io/
12
+ Keywords: 10xscale AgentFlow,api,fastapi,cli,agentflow
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ Requires-Dist: 10xscale-agentflow>=0.4.0
28
+ Requires-Dist: fastapi
29
+ Requires-Dist: gunicorn==23.0.0
30
+ Requires-Dist: orjson
31
+ Requires-Dist: python-multipart==0.0.19
32
+ Requires-Dist: pydantic==2.8.2
33
+ Requires-Dist: pydantic-settings==2.3.4
34
+ Requires-Dist: uvicorn==0.30.1
35
+ Requires-Dist: typer
36
+ Requires-Dist: python-dotenv
37
+ Requires-Dist: PyJWT==2.8.0
38
+ Provides-Extra: sentry
39
+ Requires-Dist: sentry-sdk==2.10.0; extra == "sentry"
40
+ Provides-Extra: firebase
41
+ Requires-Dist: firebase-admin==6.5.0; extra == "firebase"
42
+ Requires-Dist: oauth2client==4.1.3; extra == "firebase"
43
+ Provides-Extra: snowflakekit
44
+ Requires-Dist: snowflakekit; extra == "snowflakekit"
45
+ Provides-Extra: redis
46
+ Requires-Dist: redis==5.0.7; extra == "redis"
47
+ Provides-Extra: gcloud
48
+ Requires-Dist: google-cloud-logging; extra == "gcloud"
49
+
50
+
51
+ # AgentFlow CLI
52
+
53
+ A Python API framework with GraphQL support, task management, and CLI tools for building scalable web applications.
54
+
55
+ ## Installation
56
+
57
+ ### From PyPI (Recommended)
58
+ ```bash
59
+ pip install agentflow-cli
60
+ ```
61
+
62
+ ### From Source
63
+ ```bash
64
+ git clone https://github.com/Iamsdt/agentflow-cli.git
65
+ cd agentflow-cli
66
+ pip install -e .
67
+ ```
68
+
69
+ ## Quick Start
70
+
71
+ 1. **Initialize a new project:**
72
+ ```bash
73
+ agentflow init
74
+ ```
75
+
76
+ 2. **Start the API server with default configuration:**
77
+ ```bash
78
+ agentflow api
79
+ ```
80
+
81
+ 3. **Start the API server with custom configuration:**
82
+ ```bash
83
+ agentflow api --config custom-config.json
84
+ ```
85
+
86
+ 4. **Start the API server on different host/port:**
87
+ ```bash
88
+ agentflow api --host 127.0.0.1 --port 9000
89
+ ```
90
+
91
+ 5. **Generate a Dockerfile for containerization:**
92
+ ```bash
93
+ agentflow build
94
+ ```
95
+
96
+ ## CLI Commands
97
+
98
+ The `agentflow` command provides the following subcommands:
99
+
100
+ ### `agentflow api`
101
+ Start the Pyagenity API server.
102
+
103
+ **Options:**
104
+ - `--config TEXT`: Path to config file (default: agentflow.json)
105
+ - `--host TEXT`: Host to run the API on (default: 0.0.0.0)
106
+ - `--port INTEGER`: Port to run the API on (default: 8000)
107
+ - `--reload/--no-reload`: Enable auto-reload (default: enabled)
108
+
109
+ **Examples:**
110
+ ```bash
111
+ # Start with default configuration
112
+ agentflow api
113
+
114
+ # Start with custom config file
115
+ agentflow api --config my-config.json
116
+
117
+ # Start on localhost only, port 9000
118
+ agentflow api --host 127.0.0.1 --port 9000
119
+
120
+ # Start without auto-reload
121
+ agentflow api --no-reload
122
+ ```
123
+
124
+ ### `agentflow init`
125
+ Initialize a new config file with default settings.
126
+
127
+ **Options:**
128
+ - `--output TEXT`: Output config file path (default: agentflow.json)
129
+ - `--force`: Overwrite existing config file
130
+
131
+ **Examples:**
132
+ ```bash
133
+ # Create default config
134
+ agentflow init
135
+
136
+ # Create config with custom name
137
+ agentflow init --output custom-config.json
138
+
139
+ # Overwrite existing config
140
+ agentflow init --force
141
+ ```
142
+
143
+ ### `agentflow version`
144
+ Show the CLI version information.
145
+
146
+ ```bash
147
+ agentflow version
148
+ ```
149
+
150
+ ### `agentflow build`
151
+ Generate a Dockerfile for the Pyagenity API application.
152
+
153
+ **Options:**
154
+ - `--output TEXT`: Output Dockerfile path (default: Dockerfile)
155
+ - `--force/--no-force`: Overwrite existing Dockerfile (default: no-force)
156
+ - `--python-version TEXT`: Python version to use (default: 3.11)
157
+ - `--port INTEGER`: Port to expose in the container (default: 8000)
158
+
159
+ **Examples:**
160
+ ```bash
161
+ # Generate default Dockerfile
162
+ agentflow build
163
+
164
+ # Generate with custom Python version and port
165
+ agentflow build --python-version 3.12 --port 9000
166
+
167
+ # Overwrite existing Dockerfile
168
+ agentflow build --force
169
+
170
+ # Generate with custom filename
171
+ agentflow build --output MyDockerfile
172
+ ```
173
+
174
+ **Features:**
175
+ - 🔍 **Automatic requirements.txt detection**: Searches for requirements files in multiple locations
176
+ - ⚠️ **Smart fallback**: If no requirements.txt found, installs agentflow-cli from PyPI
177
+ - 🐳 **Production-ready**: Generates optimized Dockerfile with security best practices
178
+ - 🔧 **Customizable**: Supports custom Python versions, ports, and output paths
179
+ - 🏥 **Health checks**: Includes built-in health check endpoint
180
+ - 👤 **Non-root user**: Runs container as non-root for security
181
+
182
+ ## Configuration
183
+
184
+ The configuration file (`agentflow.json`) supports the following structure:
185
+
186
+ ```json
187
+ {
188
+ "app": {
189
+ "name": "Pyagenity API",
190
+ "version": "1.0.0",
191
+ "debug": true
192
+ },
193
+ "server": {
194
+ "host": "0.0.0.0",
195
+ "port": 8000,
196
+ "workers": 1
197
+ },
198
+ "database": {
199
+ "url": "sqlite://./agentflowdb"
200
+ },
201
+ "redis": {
202
+ "url": "redis://localhost:6379"
203
+ }
204
+ }
205
+ ```
206
+
207
+ ## File Resolution
208
+
209
+ The CLI automatically finds your config file in this order:
210
+ 1. Absolute path (if provided with `--config`)
211
+ 2. Current working directory
212
+ 3. Relative to script location (for development)
213
+ 4. Package installation directory (fallback)
214
+
215
+ ## Project Structure
216
+
217
+ ```
218
+ agentflow-cli/
219
+ ├── pyagenity_api/ # Main package directory
220
+ │ ├── __init__.py # Package initialization
221
+ │ ├── cli.py # CLI module
222
+ │ └── src/ # Source code
223
+ │ └── app/ # FastAPI application
224
+ │ ├── main.py # FastAPI app entry point
225
+ │ ├── core/ # Core functionality
226
+ │ ├── routers/ # API routes
227
+ │ └── tasks/ # Background tasks
228
+ ├── graph/ # Graph implementation
229
+ ├── migrations/ # Database migrations
230
+ ├── scripts/ # Utility scripts
231
+ ├── docs/ # Documentation
232
+ ├── pyproject.toml # Project configuration
233
+ ├── requirements.txt # Dependencies
234
+ ├── Makefile # Development commands
235
+ ├── MANIFEST.in # Package manifest
236
+ └── README.md # This file
237
+ ```
238
+
239
+ ## Features
240
+
241
+ - **FastAPI Backend**: High-performance async web framework
242
+ - **GraphQL Support**: Built-in GraphQL API with Strawberry
243
+ - **Task Management**: Background task processing with Taskiq
244
+ - **CLI Tools**: Command-line interface for easy management
245
+ - **Database Integration**: Support for multiple databases via Tortoise ORM
246
+ - **Redis Integration**: Caching and session management
247
+ - **Authentication**: Firebase authentication support
248
+ - **Development Tools**: Pre-commit hooks, linting, testing
249
+ - **Docker Support**: Container deployment ready
250
+
251
+ ## Setup
252
+
253
+ ### Prerequisites
254
+ - Python 3.x
255
+ - pip
256
+ - [Any other prerequisites]
257
+
258
+ ### Installation
259
+ 1. Clone the repository:
260
+ ```bash
261
+ git clone https://github.com/10XScale-in/backend-base.git
262
+ ```
263
+
264
+ 2. Create a virtual environment and activate:
265
+ ```bash
266
+ python -m venv venv
267
+ source venv/bin/activate
268
+ ```
269
+
270
+ 3. Install dependencies:
271
+ ```bash
272
+ pip install -r requirements.txt
273
+ ```
274
+
275
+ ## Database
276
+
277
+ ### Database Configuration
278
+ The database configuration is located in `src/app/db/setup_database.py`.
279
+
280
+ ### Database Migration
281
+ We use Aerich for database migrations. Follow these steps to manage your database:
282
+
283
+ 1. Initialize the database initially:
284
+ ```bash
285
+ aerich init -t src.app.db.setup_database.TORTOISE_ORM
286
+ ```
287
+
288
+ 2. Create initial database schema:
289
+ ```bash
290
+ aerich init-db
291
+ ```
292
+
293
+ 3. Generate migration files:
294
+ ```bash
295
+ aerich migrate
296
+ ```
297
+
298
+ 4. Apply migrations:
299
+ ```bash
300
+ aerich upgrade
301
+ ```
302
+
303
+ 5. Revert migrations (if needed):
304
+ ```bash
305
+ aerich downgrade
306
+ ```
307
+
308
+ ## Running the Application
309
+
310
+ ### Command Line
311
+ To run the FastAPI application using Uvicorn:
312
+ 1. Start the application:
313
+ ```bash
314
+ uvicorn src.app.main:app --reload
315
+ ```
316
+
317
+ 2. You can also run the debugger.
318
+
319
+ ### VS Code
320
+ Add the following configuration to your `.vscode/launch.json` file:
321
+ ```json
322
+ {
323
+ "version": "0.2.0",
324
+ "configurations": [
325
+ {
326
+ "name": "Python: FastAPI",
327
+ "type": "python",
328
+ "request": "launch",
329
+ "module": "uvicorn",
330
+ "args": [
331
+ "src.app.main:app",
332
+ "--host",
333
+ "localhost",
334
+ "--port",
335
+ "8880"
336
+ ],
337
+ "jinja": true,
338
+ "justMyCode": true
339
+ }
340
+ ]
341
+ }
342
+ ```
343
+ Then you can run and debug the application using the VS Code debugger.
344
+ ### Run the Broker
345
+ 1. Run the taskiq worker
346
+ ```taskiq worker src.app.worker:broker -fsd -tp 'src/**/*_tasks.py' --reload
347
+ ```
348
+ ## Development
349
+
350
+ ### Using the Makefile
351
+
352
+ The project includes a comprehensive Makefile for development tasks:
353
+
354
+ ```bash
355
+ # Show all available commands
356
+ make help
357
+
358
+ # Install package in development mode
359
+ make dev-install
360
+
361
+ # Run tests
362
+ make test
363
+
364
+ # Test CLI installation
365
+ make test-cli
366
+
367
+ # Format code
368
+ make format
369
+
370
+ # Run linting
371
+ make lint
372
+
373
+ # Run all checks (lint + test)
374
+ make check
375
+
376
+ # Clean build artifacts
377
+ make clean
378
+
379
+ # Build package
380
+ make build
381
+
382
+ # Publish to TestPyPI
383
+ make publish-test
384
+
385
+ # Publish to PyPI
386
+ make publish
387
+
388
+ # Complete release workflow
389
+ make release
390
+ ```
391
+
392
+ ### Manual Development Setup
393
+
394
+ If you prefer manual setup:
395
+
396
+ 1. **Clone the repository:**
397
+ ```bash
398
+ git clone https://github.com/Iamsdt/agentflow-cli.git
399
+ cd agentflow-cli
400
+ ```
401
+
402
+ 2. **Create a virtual environment:**
403
+ ```bash
404
+ python -m venv .venv
405
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
406
+ ```
407
+
408
+ 3. **Install in development mode:**
409
+ ```bash
410
+ pip install -e .
411
+ ```
412
+
413
+ 4. **Install development dependencies:**
414
+ ```bash
415
+ pip install pytest pytest-cov ruff mypy pre-commit
416
+ ```
417
+
418
+ 5. **Set up pre-commit hooks:**
419
+ ```bash
420
+ pre-commit install
421
+ ```
422
+
423
+ ### Testing
424
+
425
+ Run tests using pytest:
426
+ ```bash
427
+ pytest src/tests/ -v --cov=pyagenity_api
428
+ ```
429
+
430
+ Or use the Makefile:
431
+ ```bash
432
+ make test
433
+ ```
434
+
435
+ ### Publishing to PyPI
436
+
437
+ 1. **Test your package locally:**
438
+ ```bash
439
+ make test-cli
440
+ ```
441
+
442
+ 2. **Publish to TestPyPI first:**
443
+ ```bash
444
+ make publish-test
445
+ ```
446
+
447
+ 3. **If everything works, publish to PyPI:**
448
+ ```bash
449
+ make publish
450
+ ```
451
+
452
+
453
+ # Resources
454
+ https://keda.sh/
455
+ Get all the fixers
456
+ pytest --fixtures
457
+ https://www.tutorialspoint.com/pytest/pytest_run_tests_in_parallel.html
458
+
@@ -0,0 +1,5 @@
1
+ 10xscale_agentflow_cli-0.1.5.dist-info/METADATA,sha256=fLe6KN06z08rsKbxomc_9-6mh3S0uMxXtJkiZ9ZnXuE,11013
2
+ 10xscale_agentflow_cli-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
3
+ 10xscale_agentflow_cli-0.1.5.dist-info/entry_points.txt,sha256=YTjzc1wzoHp3kNRBMLOSKtCNU7RQCAc27ZZdPEDoPYg,58
4
+ 10xscale_agentflow_cli-0.1.5.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ 10xscale_agentflow_cli-0.1.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ agentflow = agentflow_cli.cli.main:main