Skip to content

Conversation

@thruflo
Copy link
Owner

@thruflo thruflo commented Jan 19, 2026

Summary

This PR adds two related enhancements to wisp's initialization and repository management. Users can now add new templates to already-initialized projects with wisp init -t <name>, and can specify branches, tags, or commits when cloning repositories using the @ref syntax. These changes enable more flexible workflows like continuing work on existing branches and pinning sibling repos to specific versions.

Key Changes

  • Smart template generation: wisp init -t <name> now creates only the template when .wisp/ already exists, with --force flag to overwrite existing templates
  • Ref specification: Support @ref syntax for primary repo (-r org/repo@v1.0.0) and siblings (--sibling org/repo@branch)
  • Continue on existing branch: New --continue flag allows working directly on an existing remote branch
  • Backwards-compatible session format: Updated Session struct supports new SiblingRepo type while maintaining compatibility with legacy string format
Tasks completed (13/13)
  • Add --force flag to init command
  • Implement smart template generation in init command
  • Add tests for smart template generation
  • Add SiblingRepo type and update Session struct
  • Add ParseRepoRef helper function
  • Add --branch and --continue flags to start command
  • Update start command to parse @ref syntax
  • Update CloneRepo to support ref checkout
  • Update SetupSprite to handle ref and continue modes
  • Update resume command for new session format
  • Add tests for SiblingRepo YAML marshaling
  • Add tests for @ref syntax parsing and flag validation
  • Add tests for ref checkout behavior

🤖 Generated with wisp

thruflo and others added 8 commits January 19, 2026 21:36
Modify `wisp init -t <name>` to handle three cases:
- If .wisp/ doesn't exist: create full structure with template
- If .wisp/ exists but template doesn't: create only the template
- If both exist: error unless --force is used to overwrite

This allows users to add new templates to already-initialized projects
without recreating the entire .wisp/ structure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for:
- Template-only creation when .wisp/ already exists
- --force flag to overwrite existing templates
- Template content correctness in template-only creation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…patibility

- Add SiblingRepo struct with Repo and Ref fields
- Implement UnmarshalYAML for backwards compatibility with string format
- Update Session struct with Ref and Continue fields
- Update all code and tests to use new SiblingRepo type

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parses "org/repo" or "org/repo@ref" format, returning repo and ref
parts. Uses LastIndex to handle refs containing @ signs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --continue flag for working on existing branches
- Parse @ref syntax from --repo and --sibling-repos flags
- Store Ref and Continue fields in session
- Add validation: --continue requires --branch
- Add validation: --continue and @ref are mutually exclusive

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ref parameter to CloneRepo for checking out specific refs
- Add fetchAndCheckoutBranch for --continue mode
- Add checkoutRef for branching from specific base refs
- Update SetupSprite to handle ref and continue modes:
  - Continue mode: fetch and checkout existing branch
  - Ref mode: checkout base ref, then create branch from it
  - Default: create new branch from default branch
- Update resume.go to pass sibling refs to CloneRepo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive tests for:
- Marshaling SiblingRepo with and without ref
- Unmarshaling legacy string format
- Unmarshaling new struct format with and without ref
- Round-trip compatibility for SiblingRepo and Session

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests to verify the --continue flag is properly registered
and all expected start command flags are available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thruflo thruflo merged commit ac024c5 into main Jan 19, 2026
2 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