Skip to content

feat(workflow): add zd command to list project directories#3

Open
pdegeeter wants to merge 1 commit intocrwen:mainfrom
pdegeeter:main
Open

feat(workflow): add zd command to list project directories#3
pdegeeter wants to merge 1 commit intocrwen:mainfrom
pdegeeter:main

Conversation

@pdegeeter
Copy link
Copy Markdown

Summary

  • Refactor zd command to use native Rust instead of bash script for better performance
  • Add "No results found" message when search returns empty results
  • Support multiple project directories via projects_directories configuration

Changes

Performance improvement

The zd command now uses the compiled Rust binary (./alfred-zed --dirs) instead of a bash script with loops. This provides:

  • Faster execution - Native Rust vs shell loops
  • No external dependencies - No need for bash string manipulation
  • Unified codebase - Same binary handles both zr and zd commands

Better UX

When no results match the search query, Alfred now displays "No results found" instead of falling back to web search suggestions.

CLI Usage

./alfred-zed [query] # List recent projects (zr)
./alfred-zed --dirs [query] # List project directories (zd)

Files changed

File Description
src/main.rs Add --dirs mode, list_directories() function, and empty results handling
workflow/info.plist Replace bash script with ./alfred-zed --dirs $1
CLAUDE.md Document new CLI usage and data flow

Test plan

  • Install workflow and configure projects_directories with multiple paths
  • Run zd - verify all subdirectories are listed
  • Run zd - verify filtering works
  • Run zd nonexistent - verify "No results found" appears instead of web search
  • Run zr - verify recent projects still work (regression test)

Copilot AI review requested due to automatic review settings December 26, 2025 13:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new zd command to list and open project directories from configured folders, replacing a previous bash-based approach with native Rust implementation for improved performance and maintainability.

Key changes:

  • Implements list_directories() function to scan subdirectories from user-configured paths
  • Refactors CLI argument parsing to support both zr (recent projects) and zd (directories) modes via --dirs flag
  • Adds "No results found" feedback when searches return empty results

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/main.rs Adds --dirs mode, list_directories() function, refactors to return Result types, and adds empty results handling
workflow/info.plist Adds new zd script filter configuration, workflow connections, and projects_directories user configuration
README.md Documents the new zd command and configuration instructions
CLAUDE.md Updates project overview with CLI usage examples and data flow documentation
.gitignore Adds *.alfredworkflow to ignore compiled workflow files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

add new zd command that lists folders from multiple configurable
directories, with filtering support via Alfred UI
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