Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet.

I recommend cookiecutter for this. I have a few templates I've built with that which I use frequently:

python-lib: https://github.com/simonw/python-lib

click-app: https://github.com/simonw/click-app

datasette-plugin: https://github.com/simonw/datasette-plugin

llm-plugin: https://github.com/simonw/llm-plugin

You can run them like this:

  uvx cookiecutter gh:simonw/python-lib


My take on this (using Ruby) is https://github.com/coezbek/baker

It doesn't copy template repos, but rather creates a list of imperative steps to perform. Steps can be both manual (obtain an API key and store it here) and automatic (run 'uv init'). Markdown syntax, ruby string interpolation and bash.

It came from a deep hate for yml based configs.


Copier is the new hotness for this

https://copier.readthedocs.io/en/stable/


I made a small wrapper for cookiecutter, to handle some minimal Git integration (making a repo and doing the first commit) and to match my workflow better (write some initial code first, then transform it into a "project folder" in place): https://github.com/zahlman/cookiebaker

I'm not a huge fan of cookiecutter on aesthetic principles, though. I think it's chosen some needlessly heavyweight dependencies for such a simple task. PyYAML comes with a big chunk of compiled C, while performance is really not going to matter and I'd rather use TOML anyway. I've yet to see a project depending on Rich that uses more than a tiny portion of it; this is no exception. More to the point, Rich brings in the much larger Pygments (for syntax highlighting; most of the bulk is actual syntax definition rules for a variety of programming languages) and you can't disable that. And honestly I'm not a fan of the whole "download other people's templates using an integrated client" model anyway; Requests and its dependencies are pretty bulky, too.


Am I the only one who actually likes setting up new projects? I don't want to automate that.


It depends on your work, though…

If you work at an agency or as a freelancer and you build various similar apps with similar tooling and base setup, being able to scaffold and have them all setup quickly, not having to do it manually and waste hours id important. Similarly, if you work on various small open source packages, you want the tooling to be the same, READMEs look the same, etc, a script or tool to “spit out” the basic structure can be nice.

On the other hand, if you set up the app or larger open source package and you’ll work only on that project for potentially years, setting up a project individually, organically makes a lot of sense.


I’m legitimately curious about what you enjoy and why. Rewriting boiler plate code and trying to ensure that I get everything right with a process I don’t often execute is the very definition of toil to me.


It allows me to gain a basic understanding of the fundamentals of my code base.


I looked at the click-app repo. If you were creating that today, would you switch from uv to pip?

And to run cookiecutter do you still use pipx, or have you switched to `uv tool install`


I'm getting close to switching to uv for my templates.

I use "uvx cookiecutter" myself three days.


This type of thing seems ripe for building into agentic LLM dev workflows, doesn't it?


Hmm never heard of this. Thanks for the recommendation.


Honestly, these days, just tell AI to generate one for you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: