Scaffolding generation CLI
Project description
Scold
About
scold is a CLI tool for reducing manual copy-pasting of boilerplate/scaffolding code, it let's developers define custom templates for different kinds of objects (services, database entities, etc) that scold will render when running scold new <object_type>, while prompting for questions in the template.
Usage
We first define a scold.toml file at the root of our project:
[project]
root_dir = "./src/scold/" # object dirs get this value prepended
# how files get named by default, is overrided by some `file_naming` scoped prop.
# so `SampleRepository` -> `sample_repository` automatically
default_file_naming = "snake_case"
[objects.repository]
dir = "services/repositories/"
# vars get converted into a form that will be prompted when running cli
vars = [
{ field = "object_name", desc = "Name", type = "text", default = "SampleRepository" }, # required for all objects
{ field = "feature_toggles", desc = "Feature Toggles", group = [
{ field = "allow_deletion", desc = "Allow deletion", type = "bool", default = true },
{ field = "allow_extinction", desc = "Allow extinction", type = "bool", default = false },
] },
]
Then, in the directory for our object 'repository', we must have a __template folder (whole folder will be copied) OR a __template.* file (only file will be copied). Then you can use Mako's syntax in the template, benefitting from the variables declared in the scold.toml file.
When running scold new repository, we get a form prompting for our inputs:
Installation
The easiest way to install the scold cli is with uv. You can do the following to install it in your system:
uv tool install scold-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scold_cli-0.1.2.tar.gz.
File metadata
- Download URL: scold_cli-0.1.2.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e7a76a9423ecc5865a1d73a6d2f3dead81d0765f3dc2cb020e16cfe8907c614
|
|
| MD5 |
b2edf48eadb90c6f58918aacdffc6cdb
|
|
| BLAKE2b-256 |
6552a053f5749255f92d64dd7904de5673b841b7a8a975cb289c4ab0ddebaa52
|
File details
Details for the file scold_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scold_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bca21953ddc7bcf608e5fe315d0a6f1ff6a95f41b0583743791115c485ab774
|
|
| MD5 |
e034008a1f6b95177982c1ec4ca0dcf1
|
|
| BLAKE2b-256 |
a221028e9ece1e07f5f7b0e70f466daf12250ac93e84faddf5302c3574632eba
|