DEV Community

Cover image for cps - C Project Scaffold
csm
csm

Posted on

cps - C Project Scaffold

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

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 (2)

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!