cast-by-matt 0.1.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 (32) hide show
  1. cast_by_matt-0.1.0/.gitignore +220 -0
  2. cast_by_matt-0.1.0/LICENSE +21 -0
  3. cast_by_matt-0.1.0/PKG-INFO +91 -0
  4. cast_by_matt-0.1.0/README.md +68 -0
  5. cast_by_matt-0.1.0/pyproject.toml +44 -0
  6. cast_by_matt-0.1.0/src/cast/__init__.py +1 -0
  7. cast_by_matt-0.1.0/src/cast/__main__.py +4 -0
  8. cast_by_matt-0.1.0/src/cast/cli.py +11 -0
  9. cast_by_matt-0.1.0/src/cast/commands.py +266 -0
  10. cast_by_matt-0.1.0/src/cast/config.py +18 -0
  11. cast_by_matt-0.1.0/src/cast/constants.py +83 -0
  12. cast_by_matt-0.1.0/src/cast/editor.py +74 -0
  13. cast_by_matt-0.1.0/src/cast/interactive.py +409 -0
  14. cast_by_matt-0.1.0/src/cast/manifest.py +77 -0
  15. cast_by_matt-0.1.0/src/cast/scaffolding.py +210 -0
  16. cast_by_matt-0.1.0/src/cast/starters/starter/README.md +33 -0
  17. cast_by_matt-0.1.0/src/cast/starters/starter/cast.json +12 -0
  18. cast_by_matt-0.1.0/src/cast/starters/starter/index.html +20 -0
  19. cast_by_matt-0.1.0/src/cast/starters/starter/styles.css +22 -0
  20. cast_by_matt-0.1.0/src/cast/starters/web/README.md +9 -0
  21. cast_by_matt-0.1.0/src/cast/starters/web/index.html +14 -0
  22. cast_by_matt-0.1.0/src/cast/starters/web/main.js +12 -0
  23. cast_by_matt-0.1.0/src/cast/starters/web/ol.json +10 -0
  24. cast_by_matt-0.1.0/src/cast/starters/web/package.json +14 -0
  25. cast_by_matt-0.1.0/src/cast/starters/web/style.css +22 -0
  26. cast_by_matt-0.1.0/src/cast/templates.py +92 -0
  27. cast_by_matt-0.1.0/src/cast/theme.py +16 -0
  28. cast_by_matt-0.1.0/tests/conftest.py +37 -0
  29. cast_by_matt-0.1.0/tests/test_cli.py +128 -0
  30. cast_by_matt-0.1.0/tests/test_manifest.py +115 -0
  31. cast_by_matt-0.1.0/tests/test_scaffolding.py +131 -0
  32. cast_by_matt-0.1.0/tests/test_starters.py +56 -0
@@ -0,0 +1,220 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matthew Garcia
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,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: cast-by-matt
3
+ Version: 0.1.0
4
+ Summary: Spin up projects in seconds — clone your own repos as templates, layer on add-ons, and land in your editor.
5
+ Author-email: Matthew Garcia <gmatt.devs@gmail.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: cli,project-generator,scaffolding,templates
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Software Development :: Code Generators
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: jinja2>=3.1
16
+ Requires-Dist: questionary>=2.0
17
+ Requires-Dist: rich>=13.0
18
+ Requires-Dist: typer>=0.12
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8; extra == 'dev'
21
+ Requires-Dist: ruff>=0.15; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # cast — outline
25
+
26
+ Spin up projects in seconds. Save your own repos (local or from GitHub) as templates, scaffold new projects from them, layer on add-ons like Tailwind, Supabase, or Prisma, and land straight in your editor.
27
+
28
+ ## Install
29
+
30
+ ```sh
31
+ coming soon!
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ Run `cast` with no arguments for the interactive menu:
37
+
38
+ ```sh
39
+ cast
40
+ ```
41
+
42
+ Or use it directly:
43
+
44
+ ```sh
45
+ cast init myapp nextjs # scaffold 'myapp' from the 'nextjs' template
46
+ cast add nextjs ~/code/my-starter # save a local directory as a template
47
+ cast list # list saved templates
48
+ cast info nextjs # show a template's variables, add-ons, and docs
49
+ cast remove nextjs # delete a template
50
+ cast starter # install the bundled starter templates
51
+ ```
52
+
53
+ `init` is fully scriptable: `--var KEY=VALUE` sets template variables without prompting, `--addons tailwind,prisma` runs add-ons, and `--open` launches your editor.
54
+
55
+ ### Works with AI coding agents
56
+
57
+ Every command runs headless, so agents like Claude Code can drive `cast` directly: discover templates with `cast list --json`, inspect a template's variables and add-ons with `cast info <template> --json`, then scaffold with `cast init <name> <template> --var KEY=VALUE --addons ...`. No plugin needed — the CLI is the integration.
58
+
59
+ New here? Just run `cast` — on first run it offers to install two starter templates: `starter`, a dependency-free mini site whose README explains how templating works, and `web`, a minimal Vite app. Scaffold one and you've seen the whole workflow.
60
+
61
+ Templates live in `~/.project_templates`. When scaffolding, files are rendered with Jinja2 (`{{ project_name }}` is available), `git init` runs automatically, and dependency installs (`npm install`, `pip install`, `cargo build`, …) are detected and run for you.
62
+
63
+ ## Template manifest (`cast.json`)
64
+
65
+ Optionally drop a `cast.json` at the root of a template to customize scaffolding. Every field is optional, and templates without a manifest work exactly as described above. The manifest itself is never copied into generated projects.
66
+
67
+ ```jsonc
68
+ {
69
+ // shown in the template picker and `cast list`
70
+ "description": "Next.js 15 + App Router starter",
71
+
72
+ // prompted at init; every value is available to Jinja, e.g. {{ db_name }}
73
+ "variables": [
74
+ { "name": "db_name", "prompt": "Database name", "default": "app_db" }
75
+ ],
76
+
77
+ "addons": {
78
+ "recommended": ["tailwind", "shadcn"], // pre-checked in the add-on picker
79
+ "supported": ["tailwind", "shadcn", "prisma"] // limits built-ins shown; omit to show all
80
+ },
81
+
82
+ // replaces automatic install detection (git init still always runs);
83
+ // use [] to skip installs entirely
84
+ "post_init": ["npm install", "cp .env.example .env"],
85
+
86
+ // printed after scaffolding so you never hunt for docs again
87
+ "docs": ["https://nextjs.org/docs"]
88
+ }
89
+ ```
90
+
91
+ Without a TTY (scripts, CI), variables fall back to their defaults instead of prompting.
@@ -0,0 +1,68 @@
1
+ # cast — outline
2
+
3
+ Spin up projects in seconds. Save your own repos (local or from GitHub) as templates, scaffold new projects from them, layer on add-ons like Tailwind, Supabase, or Prisma, and land straight in your editor.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ coming soon!
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Run `cast` with no arguments for the interactive menu:
14
+
15
+ ```sh
16
+ cast
17
+ ```
18
+
19
+ Or use it directly:
20
+
21
+ ```sh
22
+ cast init myapp nextjs # scaffold 'myapp' from the 'nextjs' template
23
+ cast add nextjs ~/code/my-starter # save a local directory as a template
24
+ cast list # list saved templates
25
+ cast info nextjs # show a template's variables, add-ons, and docs
26
+ cast remove nextjs # delete a template
27
+ cast starter # install the bundled starter templates
28
+ ```
29
+
30
+ `init` is fully scriptable: `--var KEY=VALUE` sets template variables without prompting, `--addons tailwind,prisma` runs add-ons, and `--open` launches your editor.
31
+
32
+ ### Works with AI coding agents
33
+
34
+ Every command runs headless, so agents like Claude Code can drive `cast` directly: discover templates with `cast list --json`, inspect a template's variables and add-ons with `cast info <template> --json`, then scaffold with `cast init <name> <template> --var KEY=VALUE --addons ...`. No plugin needed — the CLI is the integration.
35
+
36
+ New here? Just run `cast` — on first run it offers to install two starter templates: `starter`, a dependency-free mini site whose README explains how templating works, and `web`, a minimal Vite app. Scaffold one and you've seen the whole workflow.
37
+
38
+ Templates live in `~/.project_templates`. When scaffolding, files are rendered with Jinja2 (`{{ project_name }}` is available), `git init` runs automatically, and dependency installs (`npm install`, `pip install`, `cargo build`, …) are detected and run for you.
39
+
40
+ ## Template manifest (`cast.json`)
41
+
42
+ Optionally drop a `cast.json` at the root of a template to customize scaffolding. Every field is optional, and templates without a manifest work exactly as described above. The manifest itself is never copied into generated projects.
43
+
44
+ ```jsonc
45
+ {
46
+ // shown in the template picker and `cast list`
47
+ "description": "Next.js 15 + App Router starter",
48
+
49
+ // prompted at init; every value is available to Jinja, e.g. {{ db_name }}
50
+ "variables": [
51
+ { "name": "db_name", "prompt": "Database name", "default": "app_db" }
52
+ ],
53
+
54
+ "addons": {
55
+ "recommended": ["tailwind", "shadcn"], // pre-checked in the add-on picker
56
+ "supported": ["tailwind", "shadcn", "prisma"] // limits built-ins shown; omit to show all
57
+ },
58
+
59
+ // replaces automatic install detection (git init still always runs);
60
+ // use [] to skip installs entirely
61
+ "post_init": ["npm install", "cp .env.example .env"],
62
+
63
+ // printed after scaffolding so you never hunt for docs again
64
+ "docs": ["https://nextjs.org/docs"]
65
+ }
66
+ ```
67
+
68
+ Without a TTY (scripts, CI), variables fall back to their defaults instead of prompting.
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "cast-by-matt"
7
+ version = "0.1.0"
8
+ description = "Spin up projects in seconds — clone your own repos as templates, layer on add-ons, and land in your editor."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [{ name = "Matthew Garcia", email = "gmatt.devs@gmail.com" }]
13
+ keywords = ["scaffolding", "templates", "cli", "project-generator"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Topic :: Software Development :: Code Generators",
20
+ ]
21
+ dependencies = [
22
+ "jinja2>=3.1",
23
+ "questionary>=2.0",
24
+ "rich>=13.0",
25
+ "typer>=0.12",
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ dev = ["pytest>=8", "ruff>=0.15"]
30
+
31
+ [project.scripts]
32
+ cast = "cast.cli:main"
33
+
34
+ [tool.hatch.build.targets.wheel]
35
+ packages = ["src/cast"]
36
+
37
+ [tool.pytest.ini_options]
38
+ testpaths = ["tests"]
39
+
40
+ [tool.ruff]
41
+ src = ["src"]
42
+
43
+ [tool.ruff.lint]
44
+ extend-select = ["I"]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -0,0 +1,11 @@
1
+ import sys
2
+
3
+ from .commands import app
4
+ from .interactive import run_interactive
5
+
6
+
7
+ def main():
8
+ if len(sys.argv) > 1:
9
+ app()
10
+ else:
11
+ run_interactive()