A command-line tool for quickly scaffolding new programming projects with pre-configured templates.
- π Multi-Language Support - Go, Python, and Rust templates included
- π Multiple Templates - Different project types per language (basic, webserver, flask, etc.)
- βοΈ Configurable - Customize templates and user information via JSON or command-line flags
- οΏ½ Embedded Templates - All templates embedded in the binary - works anywhere
- π¨ Template Generation - Generate customizable template directories
- οΏ½π§ Auto-Setup - Runs initialization commands (go mod init, pip install, cargo build)
- π» VS Code Integration - Automatically opens projects in VS Code
- π Date-Based Organization - Projects organized by date with version control
- π€ Smart Defaults - Uses current username when no config specified
# Build the tool
go build -o dailyprog main.go
# List available templates
./dailyprog --list
# Create a Go project (uses current username as author)
./dailyprog myproject
# Create with custom author
./dailyprog --author "Alice" myproject
# Create a Python Flask web app
./dailyprog --lang python --template flask mywebapp
# Create a Rust project
./dailyprog --lang rust myrust-
Clone this repository
-
Build the binary:
go build -o dailyprog main.go
-
Optionally move to your PATH:
sudo mv dailyprog /usr/local/bin/
-
(Optional) Generate and customize templates:
dailyprog --generate-template ./my-templates # Edit files in ./my-templates/ dailyprog --templates ./my-templates/templates.json --user-config ./my-templates/user-config.json myproject
Note: Templates are embedded in the binary, so the _buildin directory is not required for the compiled program to work.
- Install Go
- Execute:
go install github.com/524D/dailyprog@latest - The
dailyprogexecutable will be in~/go/bin/dailyprog
- basic - Simple Hello World program
- webserver - HTTP web server using net/http
- basic - Simple Python script
- flask - Flask web application with virtual environment
- basic - Simple Rust program with Cargo
When you run dailyprog, it:
- Creates a directory named
~/dailyprog/YYYYMMDD-projectname(with version numbers if needed) - Copies and processes template files from embedded filesystem
- Substitutes template variables with your information (author, copyright, etc.)
- Runs initialization commands (go mod init, pip install, cargo build, etc.)
- Opens the new project in Visual Studio Code
By default, dailyprog uses:
- Author: Current logged-in username (from
$USER) - Copyright: "Copyright (c) [YEAR] [USERNAME]. All rights reserved."
- Templates: Embedded templates (Go, Python, Rust)
Override settings on a per-project basis:
# Override author only
dailyprog --author "Alice Smith" myproject
# Override both author and copyright
dailyprog --author "Bob Jones" --copyright "Copyright 2025 Acme Corp" myprojectGenerate customizable configuration and templates:
# Generate template directory
dailyprog --generate-template ./my-templates
# This creates:
# ./my-templates/
# βββ templates.json # Template definitions
# βββ user-config.json # User information
# βββ templates/ # Template files
# βββ go/
# βββ python/
# βββ rust/
# Edit the files as needed, then use:
dailyprog --templates ./my-templates/templates.json \
--user-config ./my-templates/user-config.json \
myprojectEdit user-config.json with your personal information:
{
"author": "Your Name",
"copyright": "Copyright (c) 2025 Your Name. All rights reserved.",
"email": "your.email@example.com",
"organization": "Your Organization"
}Priority Order (highest to lowest):
- Command-line flags (
--author,--copyright) - Custom user-config file (
--user-config) - Current username (default when no config specified)
The templates.json file defines available languages and templates. See IMPLEMENTATION.md for details on adding custom templates.
Usage: dailyprog [options] [project-name]
Options:
-l, --lang string Programming language (default: go)
-T, --template string Template to use (default: basic)
-d, --dir string Base directory (default: ~/dailyprog)
-t, --templates string Templates config file (uses embedded if not specified)
-u, --user-config string User config file (uses embedded if not specified)
-g, --generate-template Generate template directory at specified path
--author string Override author name
--copyright string Override copyright text
-v, --verbose Show detailed output
-V, --version Print version
--list List available languages and templates
# Create project with default settings (uses current username)
./dailyprog myproject
# Create multiple projects
./dailyprog project1 project2 project3
# Create with custom author and copyright
./dailyprog --author "Alice Smith" --copyright "MIT License" myapp
# Create with custom directory
./dailyprog --dir ~/myprojects myapp
# Create Python Flask app with verbose output
./dailyprog -v --lang python --template flask myflaskapp
# Create Go web server
./dailyprog --lang go --template webserver api-server
# Generate customizable templates
./dailyprog --generate-template ./custom-templates
# Use custom templates
./dailyprog --templates ./custom-templates/templates.json \
--user-config ./custom-templates/user-config.json \
myproject- USAGE.md - Detailed usage guide
- IMPLEMENTATION.md - Technical implementation details
- QUICKREF.md - Quick reference guide
- Go 1.16+ (for building)
- VS Code with
codecommand in PATH - Language-specific tools for chosen templates:
- Go:
gocommand - Python:
python3,pip - Rust:
cargo
- Go:
-
Generate a template directory:
./dailyprog --generate-template ./my-templates
-
Add your template files in
./my-templates/templates/<language>/<template>/:mkdir -p ./my-templates/templates/go/mytemplate # Add your template files here -
Edit
./my-templates/templates.jsonto define the new template:{ "languages": { "go": { "templates": { "mytemplate": { "name": "My Custom Template", "description": "Description of my template", "files": [ { "source": "go/mytemplate/main.go", "dest": "main.go" } ], "postCreateSteps": [] } } } } } -
Use Go template syntax (
{{.Variable}}) for variable substitution:{{.ProgName}}- Project name{{.Author}}- Author name{{.Copyright}}- Copyright text{{.Email}}- Email address{{.Organization}}- Organization name{{.Date}}- Current date (YYYY-MM-DD)
-
Test your template:
./dailyprog --templates ./my-templates/templates.json \ --user-config ./my-templates/user-config.json \ --lang go --template mytemplate test
See IMPLEMENTATION.md for detailed instructions.
Uses the following Go packages:
- github.com/spf13/pflag - Command-line flag parsing