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.

When running scold new repository, we get a form prompting for our inputs: image

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.1.tar.gz (18.4 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.1-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scold_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e394b23757f80311ced12273ceb035553ddd768505718471fddd0be8b2d1e81
MD5 a19beb29009945dfacde557b5f904e10
BLAKE2b-256 e8f7830cbb51178bd726b101777d4e8396d6e4fd38357c15b9d33f86263feb46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scold_cli-0.1.1-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

Hashes for scold_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05e3dfb749669ea4961db73623c1e5d864f392886b1c7aa6580bab49036aa1f7
MD5 9870555937102d91feff85f6101a3925
BLAKE2b-256 a897b645262c27dc6d0305d008b43a0f914c3cf96de4dffd9280bb7a18eeabb7

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