You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How can I customize the default set of files generated when creating a new project? #5264
I had a look at how this works in Core: pio project init doesn't currently expose any template hook. Its options are a fixed set (--board, --ide, --sample-code, --project-option, …), and the generated layout (src/, include/, lib/, test/, platformio.ini, the README stubs and .gitignore) is produced by hard-coded helpers in platformio/project/commands/init.py — so there's no built-in way to inject an extra file such as mbed_app.json at creation time.
Until such a feature exists, the two most reliable approaches are:
Keep a small "starter" project that already contains the file and copy/clone it for new projects, or
If a first-class, configurable project-template option would be valuable to you, that's a very reasonable enhancement to request — feel free to open a focused feature request describing the use case so it can be considered on its own. Hope this helps, and thanks again!
Activity
JamBalaya56562 commentedon Jul 5, 2026
Hi @doguto, thanks for the great question!
I had a look at how this works in Core:
pio project initdoesn't currently expose any template hook. Its options are a fixed set (--board,--ide,--sample-code,--project-option, …), and the generated layout (src/,include/,lib/,test/,platformio.ini, the README stubs and.gitignore) is produced by hard-coded helpers inplatformio/project/commands/init.py— so there's no built-in way to inject an extra file such asmbed_app.jsonat creation time.Until such a feature exists, the two most reliable approaches are:
extra_scriptsstep, so a pre-build script creates it if it's missing — see https://docs.platformio.org/en/latest/projectconf/advanced_scripting.htmlIf a first-class, configurable project-template option would be valuable to you, that's a very reasonable enhancement to request — feel free to open a focused feature request describing the use case so it can be considered on its own. Hope this helps, and thanks again!