cc-init

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 9 Imported by: 0

README ΒΆ

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.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL