Skip to content

feat: add z command for smart directory jumping (frecency-based)#16

Merged
AkshajSinghal merged 2 commits into
TruFoundation:mainfrom
ElianThorne:z-command-addition
Jun 2, 2026
Merged

feat: add z command for smart directory jumping (frecency-based)#16
AkshajSinghal merged 2 commits into
TruFoundation:mainfrom
ElianThorne:z-command-addition

Conversation

@ElianThorne
Copy link
Copy Markdown
Contributor

  • Implement z command with frecency scoring (count * 0.95^days_since_last_visit)
  • Track directory visits automatically via cd hook
  • Persist directory history using shared StateStore (avoids race condition)
  • Add -l, -c, -r, -h, --add options for listing, filtering, and manual adds
  • Add built-in mkdir and ls commands for reliable directory operations
  • Improve cd with - (previous directory) support and path resolution
  • Add ! prefix to run host OS commands (e.g., !pwd, !mkdir)
  • Update internal _CURRENT_DIR state after cd and z to keep commands in sync
  • Add comprehensive tests (29 tests passing)

Closes #11

@AkshajSinghal AkshajSinghal merged commit 1fb057b into TruFoundation:main Jun 2, 2026
1 of 3 checks passed
@AkshajSinghal
Copy link
Copy Markdown
Collaborator

It's about time. The z command works, the code is clean, and the tests are decent.
One minor complaint: _cleanup_z_entries is a bit heavy, but it'll do for now.

Merging. Don't break it later.

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.

Feature: Add z command for smart directory navigation (frecency-based)

2 participants