Skip to content

solrac97gr/project-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Selector

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.

Features

  • Scans a predefined set of directories for projects.
  • Ignores hidden directories and .git folders.
  • Provides an interactive prompt to select a project.
  • Opens the selected project with a specified command.

Installation

  1. Clone the repository:

    git clone https://github.com/solrac97gr/project-selector.git
    cd project-selector
  2. Install the project:

    make install

Configuration

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 config to 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": "πŸ“"
    }
  }
}

Usage

  1. Run the project selector:

    project-selector
  2. Follow the interactive prompt to select a project or use the Search input.

  3. The selected project will be opened with the specified command.

Example

$ project-selector
Search: my-
Select a Project πŸ”Ž (ctrl+c to cancel)
  πŸš€ πŸ“ my-project
   πŸ“ my-website
   πŸ“ my-blog
   πŸ“ my-app
   πŸ“ my-API
↓  πŸ“ my-AI

Use your own configuration

  1. Create a configuration file in the default path:

    mkdir -p $HOME/.config/project-selector
    touch $HOME/.config/project-selector/config.json
  2. 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": "πŸ“"
        }
      }
    }
  3. Run the project selector for loading the new configuration:

    project-selector

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Promptui for the interactive prompt.
  • Go for the programming language.

About

Command Tool for fast access to your projects using the code editor that you wanna. πŸš€

Resources

Stars

Watchers

Forks

Packages

No packages published