DEV Community

Cover image for cps - C Project Scaffold
csm
csm

Posted on Edited on

cps - C Project Scaffold

Requires WSL or MSYS2 on Windows

cps (C Project Scaffold)

A VS Code extension for scaffolding C projects, generating project structures, and creating C source and header files templates.

Link to repo

Link to VS Code Marketplace

Requirements

The extension runs in VS Code and is not limited to Linux. The generated project's
Makefile requires make, gcc with C11 support, and a Unix-like shell because it
uses commands such as mkdir -p and rm -rf. These are commonly available on
Linux and macOS. On Windows, use WSL or a compatible environment such as MSYS2
with the required tools installed.

Steps to Install

  • Search for cps-for-c in your VS Code Extensions

  • Click Install

  • Done!

Commands

Open the Command Palette and run one of these commands:

  • CPS: Initialize C Project creates src/main.c, include/, build/, a C11 Makefile, and .gitignore in the active workspace folder. If any target already exists, choose Overwrite, Merge, or cancel. Merge keeps existing files and adds the required build/ and app ignore entries when needed.
  • CPS: Create Source File creates src/<name>.c.
  • CPS: Create Header File creates include/<name>.h with an include guard.
  • CPS: Create Source & Header Pair creates both files and includes the header by filename in the source.
  • CPS: Switch Source / Header opens the matching counterpart when it exists.

Names may include the expected .c or .h extension. File paths and traversal names are rejected. Creating a file that already exists prompts before replacing it.

License

MIT

Top comments (10)

Collapse
 
nyaomaru profile image
nyaomaru • • Edited

Great write up! Keep buildingπŸ˜ΈπŸ‘

Collapse
 
csm18 profile image
csm •

Arigato 😊

Collapse
 
shubhradev profile image
Shubhra Pokhariya •

Such a neat little tool! 😊 Love how it takes the repetitive setup work out of C development. Great work! πŸ‘β€οΈ

Collapse
 
csm18 profile image
csm •

Thank you so much 😊

Collapse
 
effessdev profile image
EffessDev • • Edited

But the link to the repo isn't working...

Collapse
 
csm18 profile image
csm •

πŸ€”

Collapse
 
csm18 profile image
csm •

Thanks for checking the link, I forgot to public the repo πŸ˜„
Now its public!

Thread Thread
 
effessdev profile image
EffessDev • • Edited

πŸ‘

Collapse
 
hemapriya_kanagala profile image
Hemapriya Kanagala •

This looks so handy for anyone working on C projects πŸ˜€ Great work, ra!

Collapse
 
csm18 profile image
csm •

Thanks akka 😊