Skip to main content

GPT directory structure and file contents prompt generator

Project description

GPT Automation

This Python-based project provides a way to automatically generate a project structure, including all directories and files, while ignoring certain unwanted files or directories as specified in a blacklist or a .gptignore file. It also offers the capability to generate file contents, allowing users to copy either the entire project structure or just the directory structure to the clipboard.

Installation

Pipx Installation

We recommend installing GPT Automation through pipx, a package manager for running applications written in Python. If you haven't installed pipx, first install it by running:

python3 -m pip install --user pipx
python3 -m pipx ensurepath

Next, install the GPT Automation package with:

pipx install gpt-automation

Manual Installation

To manually install the project, run the following command from the project's root directory:

python setup.py install

This will install the project as a package, making the main module accessible from the command line.

Initialization

To initialize the .gpt directory with sample blacklist, whitelist, and .gptignore files, run:

autogpt init [--profile PROFILE_NAME]

This creates a .gpt directory (or a profile-specific directory under .gpt/other_profiles/ if --profile is specified) if it doesn't already exist, copying sample_config/black_list.txt, sample_config/white_list.txt, and a sample .gptignore file into this directory.

Prompt Generation

GPT Automation provides two types of prompts:

  • Full Prompt: Includes both the directory structure and the contents of all files. To generate a full prompt, use:
autogpt prompt-all [--path PROJECT_PATH] [--profile PROFILE_NAME]
  • Directory-Only Prompt: Only includes the directory structure. To generate a directory-only prompt, use:
autogpt prompt-dir [--path PROJECT_PATH] [--profile PROFILE_NAME]

In both cases, the generated prompt is automatically copied to the clipboard.

Options

  • --path: Specifies the path to your project's root directory. Defaults to the current directory.
  • --profile: Specifies the name of the profile to use. This allows for different configurations for different projects or use cases.

Blacklists, Whitelists, .gptignore, and .gptincludeonly

The blacklist file contains patterns of files and directories to ignore during prompt generation, whereas the whitelist file contains patterns of files and directories to include. The .gptignore file functions similarly to a blacklist, offering a more flexible and familiar way to specify files and directories to ignore. The .gptincludeonly file is a new addition that allows users to specify files and directories that should exclusively be included in the prompt, regardless of other rules. If a file matches patterns in both the include and exclude lists, it will be included in the prompt. Sample Blacklist (black_list.txt)

*prompts*
*.idea*
*__pycache__*
*.xml
*.gitignore*
*.md
*gen_scripts/old*
*/resources*
*examples*
*tests*
*scripts*
*dse*
*.gpt*

Sample Whitelist (white_list.txt)

*.groovy
*.java
*.py
*.ini
*.txt

Sample .gptignore

# Ignore all markdown files
*.md

# Ignore specific directories
node_modules/
build/

Sample .gptincludeonly

# Explicitly include only these files or directories
src/main/
*.yml

Output

The generated code, including the directory structure and file contents, will be copied to the clipboard in the following format:

Directory Structure:
./
    file_1.py
    file_2.py
    dir_1/
        file_1.py

File Contents:
==========file_1.py:
# Code for file_1.py

==========file_2.py:
# Code for file_2.py

==========dir_1/file_1.py:
# Code for dir_1/file_1.py

This README provides detailed instructions for installing and using the GPT Automation tool, including how to use the init, prompt-all, and prompt-dir commands with their respective options. It also explains the purpose of the blacklist, whitelist, and .gptignore files, and how the output will be formatted and copied to the clipboard.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt_automation-0.1.12.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

gpt_automation-0.1.12-py3-none-any.whl (20.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page