Skip to content

feat(shell-init): add daft() shell wrapper for cd into worktrees#165

Merged
avihut merged 1 commit intomasterfrom
daft-164/daft-cd
Feb 5, 2026
Merged

feat(shell-init): add daft() shell wrapper for cd into worktrees#165
avihut merged 1 commit intomasterfrom
daft-164/daft-cd

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 4, 2026

Summary

  • Add daft() wrapper function for bash/zsh that intercepts daft worktree-* subcommands and routes them through __daft_wrapper for automatic cd behavior
  • Add equivalent function daft --wraps daft wrapper for fish shell
  • All non-worktree daft subcommands pass through to command daft unchanged
  • Add integration tests verifying the wrapper exists, passes through regular commands, and is defined as a function

Fixes #164

Test plan

  • cargo fmt — clean
  • cargo clippy -- -D warnings — zero warnings
  • just test-unit — 183 passed, 0 failed
  • just test-integration-shell-init — all 3 new daft wrapper tests pass
  • Manual: eval "$(cargo run -- shell-init bash)" && type daft shows it's a function
  • Manual: daft worktree-checkout <branch> actually cd's into the new worktree

🤖 Generated with Claude Code

Add a daft() wrapper function (bash/zsh and fish) that intercepts
`daft worktree-*` subcommands and routes them through __daft_wrapper,
enabling automatic cd into newly created worktrees. All other daft
subcommands pass through to `command daft`.

Fixes #164

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut added this to the v1.1.0 milestone Feb 4, 2026
@avihut avihut added enhancement New feature or request feat New feature labels Feb 4, 2026
@avihut avihut self-assigned this Feb 4, 2026
@avihut avihut merged commit 5d38310 into master Feb 5, 2026
5 checks passed
@avihut avihut deleted the daft-164/daft-cd branch February 5, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running worktree commands directly through daft should CD

1 participant