appgenerator-cli 1.0.0__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 (48) hide show
  1. appgenerator_cli-1.0.0/LICENSE +21 -0
  2. appgenerator_cli-1.0.0/PKG-INFO +213 -0
  3. appgenerator_cli-1.0.0/README.md +187 -0
  4. appgenerator_cli-1.0.0/pyforge/__init__.py +10 -0
  5. appgenerator_cli-1.0.0/pyforge/commands/__init__.py +1 -0
  6. appgenerator_cli-1.0.0/pyforge/commands/create.py +60 -0
  7. appgenerator_cli-1.0.0/pyforge/generator.py +248 -0
  8. appgenerator_cli-1.0.0/pyforge/main.py +32 -0
  9. appgenerator_cli-1.0.0/pyforge/templates/ai/.env.example +29 -0
  10. appgenerator_cli-1.0.0/pyforge/templates/ai/.gitignore +47 -0
  11. appgenerator_cli-1.0.0/pyforge/templates/ai/Dockerfile +22 -0
  12. appgenerator_cli-1.0.0/pyforge/templates/ai/README.md +97 -0
  13. appgenerator_cli-1.0.0/pyforge/templates/ai/app/__init__.py +1 -0
  14. appgenerator_cli-1.0.0/pyforge/templates/ai/app/agents/__init__.py +1 -0
  15. appgenerator_cli-1.0.0/pyforge/templates/ai/app/agents/assistant.py +100 -0
  16. appgenerator_cli-1.0.0/pyforge/templates/ai/app/chains/__init__.py +1 -0
  17. appgenerator_cli-1.0.0/pyforge/templates/ai/app/chains/rag.py +50 -0
  18. appgenerator_cli-1.0.0/pyforge/templates/ai/app/config.py +47 -0
  19. appgenerator_cli-1.0.0/pyforge/templates/ai/app/tools/__init__.py +1 -0
  20. appgenerator_cli-1.0.0/pyforge/templates/ai/app/tools/registry.py +19 -0
  21. appgenerator_cli-1.0.0/pyforge/templates/ai/app/tools/search.py +34 -0
  22. appgenerator_cli-1.0.0/pyforge/templates/ai/docker-compose.yml +39 -0
  23. appgenerator_cli-1.0.0/pyforge/templates/ai/main.py +40 -0
  24. appgenerator_cli-1.0.0/pyforge/templates/ai/pyproject.toml +28 -0
  25. appgenerator_cli-1.0.0/pyforge/templates/ai/tests/__init__.py +1 -0
  26. appgenerator_cli-1.0.0/pyforge/templates/ai/tests/conftest.py +21 -0
  27. appgenerator_cli-1.0.0/pyforge/templates/ai/tests/test_agent.py +53 -0
  28. appgenerator_cli-1.0.0/pyforge/templates/fastapi/.env.example +17 -0
  29. appgenerator_cli-1.0.0/pyforge/templates/fastapi/.gitignore +42 -0
  30. appgenerator_cli-1.0.0/pyforge/templates/fastapi/Dockerfile +27 -0
  31. appgenerator_cli-1.0.0/pyforge/templates/fastapi/README.md +68 -0
  32. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/__init__.py +1 -0
  33. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/api/__init__.py +1 -0
  34. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/api/v1/__init__.py +1 -0
  35. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/api/v1/health.py +25 -0
  36. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/config.py +45 -0
  37. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/db/__init__.py +1 -0
  38. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/db/session.py +35 -0
  39. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/dependencies.py +12 -0
  40. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/main.py +58 -0
  41. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/models/__init__.py +4 -0
  42. appgenerator_cli-1.0.0/pyforge/templates/fastapi/app/models/base.py +23 -0
  43. appgenerator_cli-1.0.0/pyforge/templates/fastapi/docker-compose.yml +39 -0
  44. appgenerator_cli-1.0.0/pyforge/templates/fastapi/pyproject.toml +29 -0
  45. appgenerator_cli-1.0.0/pyforge/templates/fastapi/tests/__init__.py +1 -0
  46. appgenerator_cli-1.0.0/pyforge/templates/fastapi/tests/conftest.py +46 -0
  47. appgenerator_cli-1.0.0/pyforge/templates/fastapi/tests/test_health.py +13 -0
  48. appgenerator_cli-1.0.0/pyproject.toml +61 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Your Name
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,213 @@
1
+ Metadata-Version: 2.3
2
+ Name: appgenerator-cli
3
+ Version: 1.0.0
4
+ Summary: A developer-friendly scaffolding CLI for FastAPI and LangChain/LangGraph projects
5
+ Keywords: cli,scaffolding,fastapi,langchain,langgraph,uv
6
+ Author: Rajendra Kumar Yadav
7
+ Author-email: Rajendra Kumar Yadav <yadavrajendrakumar@outlook.com>
8
+ License: MIT
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Code Generators
18
+ Requires-Dist: typer>=0.12.0
19
+ Requires-Dist: rich>=13.0.0
20
+ Requires-Dist: jinja2>=3.1.0
21
+ Requires-Python: >=3.10
22
+ Project-URL: Homepage, https://github.com/rajendrakumaryadav/pyforge
23
+ Project-URL: Repository, https://github.com/rajendrakumaryadav/pyforge
24
+ Project-URL: Issues, https://github.com/rajendrakumaryadav/pyforge/issues
25
+ Description-Content-Type: text/markdown
26
+
27
+ # ⚒ AppGenerator CLI
28
+
29
+ > Scaffold production-ready Python projects in seconds — powered by `uv`.
30
+
31
+ ```
32
+ $ appgenerator create fastapi my_api
33
+ $ appgenerator create ai my_ai_app --docker --postgres
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install appgenerator-cli
42
+ # or, with uv (recommended):
43
+ uv tool install appgenerator-cli
44
+ ```
45
+
46
+ Verify:
47
+ ```bash
48
+ appgenerator --version
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Commands
54
+
55
+ ### `appgenerator create fastapi <name>`
56
+
57
+ Scaffold a **FastAPI** backend.
58
+
59
+ | Flag | Description |
60
+ |------|-------------|
61
+ | `--docker` | Add `Dockerfile` + `docker-compose.yml` |
62
+ | `--postgres` | Use PostgreSQL (`asyncpg`) instead of SQLite |
63
+ | `--redis` | Add Redis client (`redis`) |
64
+ | `--output PATH` | Create the project in a custom directory |
65
+
66
+ **Example:**
67
+ ```bash
68
+ appgenerator create fastapi my_api --docker --postgres --redis
69
+ cd my_api
70
+ cp .env.example .env
71
+ uv run uvicorn app.main:app --reload
72
+ ```
73
+
74
+ ### `appgenerator create ai <name>`
75
+
76
+ Scaffold a **LangChain / LangGraph** AI application.
77
+
78
+ | Flag | Description |
79
+ |------|-------------|
80
+ | `--docker` | Add `Dockerfile` + `docker-compose.yml` |
81
+ | `--postgres` | Add pgvector PostgreSQL support |
82
+ | `--redis` | Add Redis semantic cache |
83
+ | `--output PATH` | Create the project in a custom directory |
84
+
85
+ **Example:**
86
+ ```bash
87
+ appgenerator create ai my_assistant --docker
88
+ cd my_assistant
89
+ cp .env.example .env # add your OPENAI_API_KEY
90
+ uv run python main.py
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Generated Project Structure
96
+
97
+ ### FastAPI
98
+
99
+ ```
100
+ my_api/
101
+ ├── app/
102
+ │ ├── main.py # Application factory
103
+ │ ├── config.py # Pydantic Settings
104
+ │ ├── dependencies.py # FastAPI deps (DB session, etc.)
105
+ │ ├── api/v1/
106
+ │ │ └── health.py # Health-check endpoint
107
+ │ ├── models/
108
+ │ │ └── base.py # SQLModel base with timestamps
109
+ │ └── db/
110
+ │ └── session.py # Async session factory
111
+ ├── tests/
112
+ │ ├── conftest.py # Async test client + DB fixtures
113
+ │ └── test_health.py
114
+ ├── .env.example
115
+ ├── .gitignore
116
+ ├── pyproject.toml
117
+ ├── Dockerfile # (--docker)
118
+ └── docker-compose.yml # (--docker)
119
+ ```
120
+
121
+ ### AI (LangChain / LangGraph)
122
+
123
+ ```
124
+ my_assistant/
125
+ ├── main.py # Interactive REPL
126
+ ├── app/
127
+ │ ├── config.py # Pydantic Settings
128
+ │ ├── agents/
129
+ │ │ └── assistant.py # LangGraph ReAct agent
130
+ │ ├── chains/
131
+ │ │ └── rag.py # RAG chain example
132
+ │ └── tools/
133
+ │ ├── registry.py # Tool registry
134
+ │ └── search.py # Web search tool stub
135
+ ├── tests/
136
+ │ └── test_agent.py
137
+ ├── .env.example
138
+ ├── .gitignore
139
+ ├── pyproject.toml
140
+ ├── Dockerfile # (--docker)
141
+ └── docker-compose.yml # (--docker)
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Packaging & Publishing to PyPI
147
+
148
+ ### 1. Build
149
+
150
+ ```bash
151
+ # Install build tools
152
+ pip install build twine
153
+
154
+ # Build wheel + sdist
155
+ python -m build
156
+ # Outputs: dist/appgenerator_cli-0.1.0-py3-none-any.whl
157
+ # dist/appgenerator_cli-0.1.0.tar.gz
158
+ ```
159
+
160
+ ### 2. Test on TestPyPI
161
+
162
+ ```bash
163
+ twine upload --repository testpypi dist/*
164
+ pip install --index-url https://test.pypi.org/simple/ appgenerator-cli
165
+ ```
166
+
167
+ ### 3. Publish to PyPI
168
+
169
+ ```bash
170
+ twine upload dist/*
171
+ ```
172
+
173
+ Or with uv:
174
+
175
+ ```bash
176
+ uv build
177
+ uv publish
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Development Setup
183
+
184
+ ```bash
185
+ git clone https://github.com/yourname/pyforge-cli
186
+ cd pyforge-cli
187
+
188
+ uv venv
189
+ uv sync --dev
190
+
191
+ # Run locally
192
+ uv run appgenerator --help
193
+
194
+ # Tests
195
+ uv run pytest
196
+
197
+ # Lint
198
+ uv run ruff check .
199
+ uv run ruff format .
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Requirements
205
+
206
+ - Python ≥ 3.10
207
+ - [`uv`](https://docs.astral.sh/uv/) installed on the system (for generated project env management)
208
+
209
+ ---
210
+
211
+ ## License
212
+
213
+ MIT
@@ -0,0 +1,187 @@
1
+ # ⚒ AppGenerator CLI
2
+
3
+ > Scaffold production-ready Python projects in seconds — powered by `uv`.
4
+
5
+ ```
6
+ $ appgenerator create fastapi my_api
7
+ $ appgenerator create ai my_ai_app --docker --postgres
8
+ ```
9
+
10
+ ---
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pip install appgenerator-cli
16
+ # or, with uv (recommended):
17
+ uv tool install appgenerator-cli
18
+ ```
19
+
20
+ Verify:
21
+ ```bash
22
+ appgenerator --version
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Commands
28
+
29
+ ### `appgenerator create fastapi <name>`
30
+
31
+ Scaffold a **FastAPI** backend.
32
+
33
+ | Flag | Description |
34
+ |------|-------------|
35
+ | `--docker` | Add `Dockerfile` + `docker-compose.yml` |
36
+ | `--postgres` | Use PostgreSQL (`asyncpg`) instead of SQLite |
37
+ | `--redis` | Add Redis client (`redis`) |
38
+ | `--output PATH` | Create the project in a custom directory |
39
+
40
+ **Example:**
41
+ ```bash
42
+ appgenerator create fastapi my_api --docker --postgres --redis
43
+ cd my_api
44
+ cp .env.example .env
45
+ uv run uvicorn app.main:app --reload
46
+ ```
47
+
48
+ ### `appgenerator create ai <name>`
49
+
50
+ Scaffold a **LangChain / LangGraph** AI application.
51
+
52
+ | Flag | Description |
53
+ |------|-------------|
54
+ | `--docker` | Add `Dockerfile` + `docker-compose.yml` |
55
+ | `--postgres` | Add pgvector PostgreSQL support |
56
+ | `--redis` | Add Redis semantic cache |
57
+ | `--output PATH` | Create the project in a custom directory |
58
+
59
+ **Example:**
60
+ ```bash
61
+ appgenerator create ai my_assistant --docker
62
+ cd my_assistant
63
+ cp .env.example .env # add your OPENAI_API_KEY
64
+ uv run python main.py
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Generated Project Structure
70
+
71
+ ### FastAPI
72
+
73
+ ```
74
+ my_api/
75
+ ├── app/
76
+ │ ├── main.py # Application factory
77
+ │ ├── config.py # Pydantic Settings
78
+ │ ├── dependencies.py # FastAPI deps (DB session, etc.)
79
+ │ ├── api/v1/
80
+ │ │ └── health.py # Health-check endpoint
81
+ │ ├── models/
82
+ │ │ └── base.py # SQLModel base with timestamps
83
+ │ └── db/
84
+ │ └── session.py # Async session factory
85
+ ├── tests/
86
+ │ ├── conftest.py # Async test client + DB fixtures
87
+ │ └── test_health.py
88
+ ├── .env.example
89
+ ├── .gitignore
90
+ ├── pyproject.toml
91
+ ├── Dockerfile # (--docker)
92
+ └── docker-compose.yml # (--docker)
93
+ ```
94
+
95
+ ### AI (LangChain / LangGraph)
96
+
97
+ ```
98
+ my_assistant/
99
+ ├── main.py # Interactive REPL
100
+ ├── app/
101
+ │ ├── config.py # Pydantic Settings
102
+ │ ├── agents/
103
+ │ │ └── assistant.py # LangGraph ReAct agent
104
+ │ ├── chains/
105
+ │ │ └── rag.py # RAG chain example
106
+ │ └── tools/
107
+ │ ├── registry.py # Tool registry
108
+ │ └── search.py # Web search tool stub
109
+ ├── tests/
110
+ │ └── test_agent.py
111
+ ├── .env.example
112
+ ├── .gitignore
113
+ ├── pyproject.toml
114
+ ├── Dockerfile # (--docker)
115
+ └── docker-compose.yml # (--docker)
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Packaging & Publishing to PyPI
121
+
122
+ ### 1. Build
123
+
124
+ ```bash
125
+ # Install build tools
126
+ pip install build twine
127
+
128
+ # Build wheel + sdist
129
+ python -m build
130
+ # Outputs: dist/appgenerator_cli-0.1.0-py3-none-any.whl
131
+ # dist/appgenerator_cli-0.1.0.tar.gz
132
+ ```
133
+
134
+ ### 2. Test on TestPyPI
135
+
136
+ ```bash
137
+ twine upload --repository testpypi dist/*
138
+ pip install --index-url https://test.pypi.org/simple/ appgenerator-cli
139
+ ```
140
+
141
+ ### 3. Publish to PyPI
142
+
143
+ ```bash
144
+ twine upload dist/*
145
+ ```
146
+
147
+ Or with uv:
148
+
149
+ ```bash
150
+ uv build
151
+ uv publish
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Development Setup
157
+
158
+ ```bash
159
+ git clone https://github.com/yourname/pyforge-cli
160
+ cd pyforge-cli
161
+
162
+ uv venv
163
+ uv sync --dev
164
+
165
+ # Run locally
166
+ uv run appgenerator --help
167
+
168
+ # Tests
169
+ uv run pytest
170
+
171
+ # Lint
172
+ uv run ruff check .
173
+ uv run ruff format .
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Requirements
179
+
180
+ - Python ≥ 3.10
181
+ - [`uv`](https://docs.astral.sh/uv/) installed on the system (for generated project env management)
182
+
183
+ ---
184
+
185
+ ## License
186
+
187
+ MIT
@@ -0,0 +1,10 @@
1
+ """PyForge CLI package."""
2
+
3
+ from importlib.metadata import metadata
4
+
5
+ try:
6
+ _meta = metadata("appgenerator-cli")
7
+ except Exception:
8
+ _meta = metadata("pyforge-cli")
9
+ __version__ = _meta["Version"]
10
+ __author__ = _meta["Author-email"]
@@ -0,0 +1 @@
1
+ """CLI command modules."""
@@ -0,0 +1,60 @@
1
+ """
2
+ `appgenerator create` subcommand group.
3
+ Delegates to template-specific generators.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ from pathlib import Path
8
+ from typing import Optional
9
+
10
+ import typer
11
+ from rich.console import Console
12
+
13
+ from pyforge.generator import ProjectGenerator
14
+
15
+ create_app = typer.Typer(no_args_is_help=True, rich_markup_mode="rich")
16
+ console = Console()
17
+
18
+
19
+ def _run_generator(
20
+ template: str,
21
+ project_name: str,
22
+ output_dir: Optional[Path],
23
+ docker: bool,
24
+ postgres: bool,
25
+ redis: bool,
26
+ ) -> None:
27
+ target = (output_dir or Path.cwd()) / project_name
28
+ if target.exists():
29
+ console.print(f"[bold red]✗[/] Directory [bold]{target}[/] already exists.")
30
+ raise typer.Exit(code=1)
31
+
32
+ generator = ProjectGenerator(
33
+ template=template,
34
+ project_name=project_name,
35
+ target_dir=target,
36
+ options={"docker": docker, "postgres": postgres, "redis": redis},
37
+ )
38
+ generator.run()
39
+
40
+
41
+ @create_app.command("fastapi", help="Scaffold a [bold]FastAPI[/] backend project.")
42
+ def create_fastapi(
43
+ project_name: str = typer.Argument(..., help="Name of the new project."),
44
+ output_dir: Optional[Path] = typer.Option(None, "--output", "-o", help="Parent directory."),
45
+ docker: bool = typer.Option(False, "--docker", help="Add Dockerfile & docker-compose.yml."),
46
+ postgres: bool = typer.Option(False, "--postgres", help="Add PostgreSQL support."),
47
+ redis: bool = typer.Option(False, "--redis", help="Add Redis support."),
48
+ ) -> None:
49
+ _run_generator("fastapi", project_name, output_dir, docker, postgres, redis)
50
+
51
+
52
+ @create_app.command("ai", help="Scaffold a [bold]LangChain / LangGraph[/] AI project.")
53
+ def create_ai(
54
+ project_name: str = typer.Argument(..., help="Name of the new project."),
55
+ output_dir: Optional[Path] = typer.Option(None, "--output", "-o", help="Parent directory."),
56
+ docker: bool = typer.Option(False, "--docker", help="Add Dockerfile & docker-compose.yml."),
57
+ postgres: bool = typer.Option(False, "--postgres", help="Add PostgreSQL vector DB support."),
58
+ redis: bool = typer.Option(False, "--redis", help="Add Redis cache support."),
59
+ ) -> None:
60
+ _run_generator("ai", project_name, output_dir, docker, postgres, redis)