Skip to main content

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.

Installation

As Scold is still in active development, if you want to use it you must clone the repository, after that you should be able to install the scold cli with:

uv tool install -e .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scold_cli-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scold_cli-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file scold_cli-0.1.0.tar.gz.

File metadata

  • Download URL: scold_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for scold_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbe7622b33e14b9e35838a97e949179f06ba0e457a4d109db733a820ff62e6c6
MD5 5f17f0c11ba21a3f5fdb24c99f740eb7
BLAKE2b-256 0fc286f367d687ea60c9519d64cc495053bcb2082ea6e3e69351a63b09c6c546

See more details on using hashes here.

File details

Details for the file scold_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scold_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for scold_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50baf559f99845a40359b6d82f9f9d43e66db1d5403b76d29ac8bcc61630fce4
MD5 852cf0dea8a58cd7667a724dd66fc1d8
BLAKE2b-256 d74e3cc1f9983a9abe839dd047da620050b8a9d1dba3165f749aefeb144cd90b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page