Project Selector is a command-line tool that allows you to quickly select and open a project from a predefined set of directories. It uses an interactive prompt to let you choose a project and then opens it with a specified command.
- Scans a predefined set of directories for projects.
- Ignores hidden directories and
.gitfolders. - Provides an interactive prompt to select a project.
- Opens the selected project with a specified command.
-
Clone the repository:
git clone https://github.com/solrac97gr/project-selector.git cd project-selector -
Install the project:
make install
The configuration is managed through a configuration file. If the configuration file is not found, default settings will be used.
Note: You can use the command
make configto create the configuration file automatically and open it using nano.
$HOME/.config/project-selector/config.json
// This is the default config
{
"cmd": "code",
"project_dirs": ["Development/work"], // From $HOME directory
"dirs_to_ignore": ["secret-projects"], // If the path contains this strings, it will be ignored
"number_of_projects": 10,
"style": {
"title": {
"template": "{{ . | blue | bold }}",
"icon": "π"
},
"active": {
"template": "{{ . | blue | underline | bold}}",
"icon": "π"
},
"inactive": {
"template": "{{ . | cyan }}",
"icon": "π"
}
}
}-
Run the project selector:
project-selector
-
Follow the interactive prompt to select a project or use the Search input.
-
The selected project will be opened with the specified command.
$ project-selector
Search: my-
Select a Project π (ctrl+c to cancel)
π π my-project
π my-website
π my-blog
π my-app
π my-API
β π my-AI-
Create a configuration file in the default path:
mkdir -p $HOME/.config/project-selector touch $HOME/.config/project-selector/config.json
-
Edit the configuration file with your settings.
{ "cmd": "zed", // Open the project with the zed editor instead of code "project_dirs": ["Development/work"], "dirs_to_ignore": ["secret-projects"], "number_of_projects": 10, "style": { "title": { "template": "{{ . | blue | bold }}", "icon": "π" }, "active": { "template": "{{ . | blue | underline | bold}}", "icon": "π" }, "inactive": { "template": "{{ . | cyan }}", "icon": "π" } } } -
Run the project selector for loading the new configuration:
project-selector
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.