Download the PHP package shelfwood/project-prompt-generator without Composer
On this page you can find all versions of the php package shelfwood/project-prompt-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shelfwood/project-prompt-generator
More information about shelfwood/project-prompt-generator
Files in shelfwood/project-prompt-generator
Package project-prompt-generator
Short Description Generates a prompt for a given Laravel project you are viewing in the CLI
License MIT
Homepage https://github.com/j-shelfwood/project-prompt-generator
Informations about the package project-prompt-generator
Project CLI Tool
This is a Laravel Zero CLI tool that uses GPT with OpenAI API to generate prompts and analyze project files. You need an OpenAI API key to use this tool.
Installation
To install the CLI tool globally via composer, run the following command:
After installation, create a new project directory, and navigate to it in your terminal. Then, run the following command:
This will install the necessary dependencies, create a database, and prompt you for a default projects to allow you to choose projects from a default directory. Handy for when you have multiple projects in a single directory that you want to analyze individually.
Usage
The .env contains the following variables, the necessary ones are set when running the prompt install command:
The REMOTE variable is used to specify a remote directory to use instead of the current working directory. The IGNORE_PATHS variable is used to specify paths to ignore when analyzing files. This is mostly used during development to allow for easily running the tool on other project folders.
The IGNORE_PATHS variable can be set to a comma-separated list of file paths to ignore when analyzing files. database/database.sqlite is ignored by default.
Analyze Project
To analyze the current working directory's files and display counts for tokens and descriptions, use the following command:
The --remote option can be used to specify a remote directory instead of using the current working directory.
Clear Command
To clear all file descriptions from the database, use the following command:
Copy Code Command
To concatenate the code from all files in the current project without newlines and count the number of tokens, use the following command:
The --remote option can be used to specify a remote directory instead of using the current working directory.
Copy Compressed Command
To concatenate all the compressed file descriptions for the current project and count the number of tokens, use the following command:
The --remote option can be used to specify a remote directory instead of using the current working directory.
The --remote option can be used to specify a remote directory instead of using the current working directory.
Generate Proposal Command
To generate a proposal based on the files in the current directory, use the following command:
The command retrieves the project directory and the project ID from the database and creates instances of FileAnalyzer, Describer, and DescriptionStorage to process the files in the directory and store the generated proposal. Finally, the command prompts the user to provide a description of the feature or request.
Readme Command
To generate a README.md file for the current project, use the following command:
The --remote option can be used to specify a remote directory instead of using the current working directory. The command uses Laravel's FileAnalyzer class to determine which files to scan for context information. It also uses an instance of ChatGPT to gather crucial information from each file to be used as context while writing the README.md file. Finally, the command prompts the user to provide any special instructions and then writes out the complete README.md in markdown format.
Contributing
If you would like to contribute to this project, please submit a pull request on GitHub or contact the project owner directly.
License
This project is licensed under the MIT license.
Credits
This project was created by Joris Schelfhout. Special thanks to Bit Academy for providing the resources to create this project.
All versions of project-prompt-generator with dependencies
illuminate/collections Version ^10.0
illuminate/database Version ^10.0
laravel-zero/phar-updater Version ^1.3
nunomaduro/laravel-console-menu Version ^3.4
nunomaduro/termwind Version ^1.15
nyholm/psr7 Version ^1.5
openai-php/client Version ^0.4.1
symfony/http-client Version ^6.2