{"id":29866572,"url":"https://github.com/sammyjoyce/c23-cli-template","last_synced_at":"2026-05-20T14:11:03.381Z","repository":{"id":306707694,"uuid":"1026989098","full_name":"sammyjoyce/c23-cli-template","owner":"sammyjoyce","description":"Modern C23 CLI application starter with Zig build system, NCurses TUI support, and comprehensive project structure","archived":false,"fork":false,"pushed_at":"2025-07-27T06:29:22.000Z","size":113,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T06:29:55.521Z","etag":null,"topics":["c","c23","cli","cli-app","command-line","ncurses","starter-template","template","tui","zig","zig-build"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammyjoyce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2025-07-27T04:22:50.000Z","updated_at":"2025-07-27T06:29:25.000Z","dependencies_parsed_at":"2025-07-27T06:29:58.783Z","dependency_job_id":"296fbfc9-f57c-4745-9a3b-c7784f2016ed","html_url":"https://github.com/sammyjoyce/c23-cli-template","commit_stats":null,"previous_names":["sammyjoyce/maxprofiles"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/sammyjoyce/c23-cli-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyjoyce%2Fc23-cli-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyjoyce%2Fc23-cli-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyjoyce%2Fc23-cli-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyjoyce%2Fc23-cli-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammyjoyce","download_url":"https://codeload.github.com/sammyjoyce/c23-cli-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyjoyce%2Fc23-cli-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267873742,"owners_count":24158682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c23","cli","cli-app","command-line","ncurses","starter-template","template","tui","zig","zig-build"],"created_at":"2025-07-30T13:00:44.854Z","updated_at":"2026-05-20T14:10:58.327Z","avatar_url":"https://github.com/sammyjoyce.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI Starter Template - C23 + Zig 🚀\n\n[![GitHub Release](https://img.shields.io/github/v/release/sammyjoyce/c23-cli-template?style=for-the-badge)](https://github.com/sammyjoyce/c23-cli-template)\n[![License](https://img.shields.io/github/license/sammyjoyce/c23-cli-template?style=for-the-badge)](https://github.com/sammyjoyce/c23-cli-template/blob/main/LICENSE)\n[![CI Status](https://img.shields.io/github/actions/workflow/status/sammyjoyce/c23-cli-template/ci.yaml?style=for-the-badge\u0026label=CI)](https://github.com/sammyjoyce/c23-cli-template/actions/workflows/ci.yaml)\n[![Codecov](https://img.shields.io/codecov/c/github/sammyjoyce/c23-cli-template?style=for-the-badge\u0026logo=codecov)](https://codecov.io/gh/sammyjoyce/c23-cli-template)\n[![Zig](https://img.shields.io/badge/Zig-master-F7A41D?style=for-the-badge\u0026logo=zig)](https://ziglang.org/)\n[![Build](https://img.shields.io/github/actions/workflow/status/sammyjoyce/c23-cli-template/ci.yaml?style=for-the-badge\u0026label=Build)](https://github.com/sammyjoyce/c23-cli-template/actions/workflows/ci.yaml)\n[![CodeQL](https://img.shields.io/github/actions/workflow/status/sammyjoyce/c23-cli-template/ci.yaml?style=for-the-badge\u0026label=CodeQL)](https://github.com/sammyjoyce/c23-cli-template/actions/workflows/ci.yaml)\n[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/sammyjoyce/c23-cli-template?style=for-the-badge\u0026label=OpenSSF%20Scorecard)](https://securityscorecards.dev/viewer/?uri=github.com/sammyjoyce/c23-cli-template)\n\n## A modern C23 CLI application starter template with Zig build system\n\n[Use this template](https://github.com/sammyjoyce/c23-cli-template/generate) • [View Demo](https://github.com/sammyjoyce/c23-cli-template) • [Report Bug](https://github.com/sammyjoyce/c23-cli-template/issues)\n\n---\n\n## ✨ Features\n\n- 🚀 **Modern C23** - Latest C standard with Aro compiler\n- ⚡ **Zig Build System** - Fast, reliable builds with cross-compilation\n- 🏗️ **Well-Structured** - Organized project layout ready for growth\n- 🧪 **Testing Included** - Test framework with examples\n- 🎨 **Smart CLI** - Colored output, help text, argument parsing\n- 🖼️ **TUI Support** - NCurses integration for interactive terminal UIs\n- 🔧 **Configuration** - Layered config system (file → env → args)\n- 📦 **Minimal Dependencies** - Only Zig, libc, and ncurses\n- 🤖 **CI/CD Ready** - GitHub Actions workflow included\n- 🔄 **Conditional Runners** - Uses self-hosted runners for template repo, GitHub-hosted for derived repos\n- ⚡ **Caching** - Speeds up builds by caching Zig dependencies and build artifacts\n- 🔒 **Release Gating** - Ensures releases only happen on tags in main branch\n- 🛡️ **Security Scanning** - CodeQL integration for vulnerability detection\n- 📦 **Artifact Management** - Unique artifact naming to avoid collisions\n- 🏷️ **Version Pinning** - Pinned GitHub Actions versions for reproducibility\n- 🚫 **Concurrency Control** - Cancels redundant CI runs on same branch\n- 📊 **Dynamic Binary Naming** - Extracts binary name from build.zig.zon\n- 🧹 **Template Cleanup** - Automated cleanup of template-specific files and placeholders\n- 📚 **OpenCLI Compliant** - Standardized CLI behavior\n- 🔄 **Dependency Updates** - Automated updates with Dependabot/Renovate\n- 📝 **Pre-commit Hooks** - Code quality enforcement before commits\n- 🐳 **Devcontainer Support** - Consistent development environments\n- 📋 **Comprehensive Documentation** - Detailed guides and examples\n\n## 🎯 Quick Start\n\n### Create Your Project\n\n### Option 1: GitHub UI\n\n1. Click [\"Use this template\"](https://github.com/sammyjoyce/c23-cli-template/generate)\n2. Name your repository\n3. Click \"Create repository\"\n\n### Option 2: GitHub CLI\n\n```bash\ngh repo create my-cli \\\n  --template sammyjoyce/c23-cli-template \\\n  --public \\\n  --clone\n```\n\n### Build \u0026 Run\n\n```bash\n# Clone your new repo\ngit clone https://github.com/YOU/YOUR-REPO\ncd YOUR-REPO\n\n# Build (with TUI support)\nzig build -Doptimize=ReleaseSafe\n\n# Build without TUI (if ncurses is not available)\nzig build -Doptimize=ReleaseSafe -Denable-tui=false\n\n# Run\n./zig-out/bin/YOUR-REPO --help\n```\n\n## 📖 What's Included\n\n### Project Structure\n\n```text\nyour-cli/\n├── src/\n│   ├── main.c              # Entry point\n│   ├── core/               # Core functionality\n│   │   ├── config.c/h      # Configuration\n│   │   ├── error.c/h       # Error handling\n│   │   └── types.h         # Type definitions\n│   ├── cli/                # CLI interface\n│   │   ├── args.c/h        # Argument parsing\n│   │   └── help.c/h        # Help text\n│   ├── io/                 # Input/Output\n│   └── utils/              # Utilities\n├── test/                   # Test suite\n├── build.zig               # Build config\n└── opencli.json            # CLI specification\n```\n\n### Example Commands\n\nThe template includes working examples:\n\n```bash\n# Greeting command\n$ myapp hello\nHello, World!\n\n$ myapp hello Alice\nHello, Alice!\n\n# Echo command\n$ myapp echo Hello from CLI\nHello from CLI\n\n# Info command\n$ myapp info\nApplication: myapp\nVersion: 1.0.0\nBuild: Jul 27 2025 13:16:11\n\n# Interactive TUI menu\n$ myapp menu\n# Opens an ncurses-based interactive menu\n```\n\n## 🛠️ Customization Guide\n\n### 1. After Creating Your Repo\n\nThe template automatically:\n\n- ✅ Replaces `myapp` with your project name\n- ✅ Updates all references and metadata\n- ✅ Preserves template structure\n- ✅ Removes template-specific files\n- ✅ Commits the changes\n\nCheck the **Actions** tab to see progress.\n\n### 2. Add Your Commands\n\nEdit `src/main.c`:\n\n```c\nif (strcmp(command, \"deploy\") == 0) {\n    printf(\"Deploying application...\\n\");\n    // Your deployment logic\n    return APP_SUCCESS;\n}\n```\n\n### 3. Update Help Text\n\nEdit `src/cli/help.c` to describe your commands.\n\n### 4. Add Source Files\n\n1. Create your `.c` file in `src/`\n2. Add to `build.zig`:\n\n```zig\nconst c_sources = [_][]const u8{\n    // ... existing files ...\n    \"src/features/deploy.c\",  // Your new file\n};\n```\n\n## 🧪 Development\n\n### Prerequisites\n\n- **Zig** (master branch) - Install via [zvm](https://github.com/tristanisham/zvm)\n- **C compiler** - For system libraries\n- **NCurses** - For TUI support\n  - Ubuntu/Debian: `sudo apt-get install libncurses-dev`\n  - macOS: `brew install ncurses`\n  - Fedora: `sudo dnf install ncurses-devel`\n\n### Development Environment\n\nThis template provides several tools to enhance your development experience:\n\n- **Devcontainer Support** - Pre-configured development environment with all dependencies\n- **VS Code Settings** - Opinionated settings for C/Zig development\n- **Pre-commit Hooks** - Automated code quality checks before commits\n- **Tasks Configuration** - Predefined build and test tasks for VS Code\n- **Debug Configuration** - Ready-to-use debugging setup for VS Code\n\n### Commands\n\n```bash\n# Build\nzig build                    # Debug build\nzig build -Doptimize=ReleaseSafe  # Release build\n\n# Test\nzig build test              # Run all tests\n\n# Clean\nzig build clean             # Remove build artifacts\n\n# Format\nzig fmt build.zig          # Format build file\n```\n\n### Configuration\n\nYour app supports config from multiple sources:\n\n1. **CLI arguments** (highest priority)\n2. **Environment variables**\n3. **Config file** (`~/.config/yourapp/config.json`)\n4. **Defaults**\n\n## 📚 Documentation\n\n### Getting Started\n- 📖 [**Using This Template**](/.template/TEMPLATE_USAGE.md) - Detailed setup guide\n- 🚀 [**Quick Start Guide**](#-quick-start) - Get up and running quickly\n- 🔧 [**Installation**](#-installation) - Platform-specific instructions\n\n### Developer Resources\n- 🏗️ [**Architecture Overview**](docs/ARCHITECTURE.md) - System design and module structure\n- ⚡ [**Zig Primer for C Developers**](docs/ZIG_PRIMER.md) - Understanding the build system\n- 🤝 [**Contributing Guide**](CONTRIBUTING.md) - How to contribute to the project\n- 🧪 [**Advanced Usage Examples**](examples/advanced-usage.md) - Piping, scripting, and integration\n\n### Examples \u0026 Demos\n- 📝 [**Adding Commands**](examples/adding-a-command.md) - Extend the CLI\n- 🎨 [**Custom TUI Components**](examples/custom-tui.md) - Build interactive interfaces\n- ⚙️ [**Configuration Guide**](examples/config.json) - Config file examples\n- 🎬 [**Demo Gallery**](docs/demos/README.md) - Animated demonstrations\n\n### Project Information\n- 🛡️ [**Security Policy**](SECURITY.md) - Reporting vulnerabilities\n- 📋 [**Code of Conduct**](CODE_OF_CONDUCT.md) - Community guidelines\n- 📝 [**Changelog**](CHANGELOG.md) - Version history\n- 📜 [**License**](LICENSE) - MIT License\n\n## 🤔 Why This Stack?\n\n- **C23** - Latest features: `typeof`, `_BitInt`, better type safety\n- **Zig Build** - Superior to Make/CMake, built-in cross-compilation\n- **Aro Compiler** - Better C23 support than most system compilers\n- **Minimal Dependencies** - Just Zig and libc, no complex toolchains\n\n## 🆘 Getting Help\n\n### Template Issues\n\nFor problems with the template itself:\n\n- Check [existing issues](https://github.com/sammyjoyce/c23-cli-template/issues)\n- Create a new issue\n- Read [template support](/.template/TEMPLATE_SUPPORT.md)\n\n### Your Project Issues\n\nFor issues with your generated project:\n\n- Use your own repository's issues\n- Check Zig [documentation](https://ziglang.org/documentation/)\n- See C23 [reference](https://en.cppreference.com/w/c/23)\n\n## 🌟 Projects Using This Template\n\n\u003e Using this template? [Add your project!](https://github.com/sammyjoyce/c23-cli-template/edit/main/README.md)\n\n- [Example CLI](https://github.com/example/cli) - Description\n- Your project here!\n\n## 📄 License\n\nThis template is MIT licensed. See [LICENSE](LICENSE) for details.\n\nWhen you use this template, you can choose any license for your project.\n\n---\n\n**Ready to build your CLI app?**\n\n[![Use this template](https://img.shields.io/badge/Use%20this-template-success?style=for-the-badge\u0026logo=github)](https://github.com/sammyjoyce/c23-cli-template/generate)\n\nMade with ❤️ by the open source community\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammyjoyce%2Fc23-cli-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammyjoyce%2Fc23-cli-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammyjoyce%2Fc23-cli-template/lists"}