cc-init
A Go command-line tool that quickly initializes Claude Code configuration for projects by copying embedded .claude template files to create the necessary directory structure.
Features
- π One-command setup - Initialize Claude Code configuration instantly
- π Template embedding - Templates are embedded in the binary using Go's
embed package
- π‘οΈ Safe operations - Skips existing files and directories to prevent overwrites
- π Dry-run mode - Preview changes before applying them
- π Progress tracking - Colored output with detailed operation summaries
- π― Flexible targeting - Initialize in current directory or specify target location
- π₯οΈ Cross-platform - Works on Windows, macOS, and Linux
Installation
Download pre-built binaries
You can download pre-built binaries for your platform from the releases page.
Build from source
go install github.com/ipfans/cc-init@latest
Usage
Basic usage
# Initialize .claude configuration in current directory
./cc-init
# Initialize in a specific directory
./cc-init --target /path/to/your/project
# Preview what would be created (dry-run)
./cc-init --dry-run
# Verbose output for debugging
./cc-init --verbose
# Show version
./cc-init --version
# Show help
./cc-init --help
Command-line options
| Flag |
Short |
Description |
--target |
-t |
Target directory (default: current directory) |
--dry-run |
|
Preview operations without making changes |
--verbose |
-v |
Enable verbose output for debugging |
--no-color |
|
Disable colored output |
--version |
|
Show version information |
--help |
-h |
Show help message |
Example output
$ ./cc-init --target myproject --verbose
β Created directory: .claude/commands
β Created file: .claude/commands/ask.md
β Created file: .claude/commands/spec-workflow.md
β Created file: .claude/settings.local.json
β Created 3 files and 1 directory
β Claude configuration initialized successfully
What gets created
The tool creates a .claude directory structure with:
.claude/
βββ commands/
β βββ ask.md # Custom ask command template
β βββ spec-workflow.md # Specification workflow template
βββ settings.local.json # Local Claude Code settings
Development
See CLAUDE.md for detailed development instructions and architecture notes.
Building
# Build the project
go build
# Build with specific output name
go build -o cc-init
# Run directly
go run .
Testing
# Run tests
go test ./...
# Run with coverage
go test -cover ./...
Technical Details
- Go Version: 1.24.5
- Module:
github.com/ipfans/cc-init
- Architecture: Component-based with clean separation of concerns
- Security: Path validation, input sanitization, and safe file operations
- Testing: Comprehensive test suite with 90%+ coverage target
License
See LICENSE file for details.