Skip to content

Handle folder name input for copier#12

Merged
tirthbodawala merged 1 commit intomainfrom
claude/copier-folder-name-011CUpYbzXBt7CjTV4qUwVcL
Nov 5, 2025
Merged

Handle folder name input for copier#12
tirthbodawala merged 1 commit intomainfrom
claude/copier-folder-name-011CUpYbzXBt7CjTV4qUwVcL

Conversation

@tirthbodawala
Copy link
Member

1. Copier Smart Defaults

Enhance user experience by automatically deriving project_name and project_slug from the destination folder name, reducing friction during project creation.

Changes:

  • Use _copier_conf.dst_path.name to extract folder name
  • project_name defaults to folder name (title-cased, spaces for separators)
    • "my-awesome-project" → "My Awesome Project"
    • "data_processor" → "Data Processor"
    • "backend-api-v2" → "Backend Api V2"
  • project_slug defaults directly to folder name
  • package_name automatically converts hyphens to underscores
  • Updated success message to use dynamic project_slug
  • Cross-platform compatible using Path.name property

Documentation:

  • Added "Smart Defaults" section in Quick Start with examples
  • Updated Configuration Options to clarify default behaviors
  • Included examples showing the transformation patterns

2. AI Finish Task Non-Interactive by Default

Make ai-finish-task non-interactive by default for better AI agent and automation workflows. Running the command implies intent to finish.

Changes:

  • Set --yes default to True (skip prompts by default)
  • Added --interactive/-i flag to opt back into prompts if needed
  • Updated function signature default: yes=True
  • Updated docstrings to reflect new behavior

Testing:

  • Updated test_finish_task_yes_defaults_to_true (renamed from _to_false)
  • Test now verifies prompts are skipped by default
  • All 219 tests passing with 100% coverage
  • Verified copier with multiple naming patterns

Both improvements optimize the common case while preserving flexibility for edge cases and explicit user control when needed.

## 1. Copier Smart Defaults

Enhance user experience by automatically deriving project_name and
project_slug from the destination folder name, reducing friction during
project creation.

Changes:
- Use _copier_conf.dst_path.name to extract folder name
- project_name defaults to folder name (title-cased, spaces for separators)
  * "my-awesome-project" → "My Awesome Project"
  * "data_processor" → "Data Processor"
  * "backend-api-v2" → "Backend Api V2"
- project_slug defaults directly to folder name
- package_name automatically converts hyphens to underscores
- Updated success message to use dynamic project_slug
- Cross-platform compatible using Path.name property

Documentation:
- Added "Smart Defaults" section in Quick Start with examples
- Updated Configuration Options to clarify default behaviors
- Included examples showing the transformation patterns

## 2. AI Finish Task Non-Interactive by Default

Make ai-finish-task non-interactive by default for better AI agent and
automation workflows. Running the command implies intent to finish.

Changes:
- Set --yes default to True (skip prompts by default)
- Added --interactive/-i flag to opt back into prompts if needed
- Updated function signature default: yes=True
- Updated docstrings to reflect new behavior

Testing:
- Updated test_finish_task_yes_defaults_to_true (renamed from _to_false)
- Test now verifies prompts are skipped by default
- All 219 tests passing with 100% coverage
- Verified copier with multiple naming patterns

Both improvements optimize the common case while preserving flexibility
for edge cases and explicit user control when needed.
@tirthbodawala tirthbodawala merged commit 6679370 into main Nov 5, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants