Finished 'idxtool' features

- added alphabetical IDs sort in TOC generation
- implemented multi-find 'findgpt' command line for the idxtool (it supports URLs, IDs, or response files)
This commit is contained in:
Elias Bachaalany 2023-12-18 22:59:21 -08:00
parent 63bc81b225
commit b4aa53116a
3 changed files with 103 additions and 92 deletions

View file

@ -2,68 +2,71 @@
The `idxtool` is a GPT indexing and searching tool for the CSP repo (ChatGPT System Prompt).
Contributions to `idxtool` are welcome. Please submit pull requests or issues to the CSP repo for review.
## Command line
```
usage: idxtool.py [-h] [--update-logo UPDATE_LOGO] [--toc [TOC]]
[--update-description UPDATE_DESCRIPTION]
[--find-gptfile FIND_GPTFILE] [--find-gpttoc FIND_GPTTOC]
[--parse-gptfile PARSE_GPTFILE] [--rename RENAME]
usage: idxtool.py [-h] [--toc [TOC]] [--find-gpt FIND_GPT]
[--parse-gptfile PARSE_GPTFILE] [--rename]
idxtool: A GPT indexing and searching tool for the CSP repo
options:
-h, --help show this help message and exit
--update-logo UPDATE_LOGO
Update the logos of the GPT file
--toc [TOC] Rebuild the table of contents (TOC.md) file
--update-description UPDATE_DESCRIPTION
Update the descriptions of the GPT file
--find-gptfile FIND_GPTFILE
Find a GPT by its ID or name
--find-gpttoc FIND_GPTTOC
Searches the TOC.md file for the given gptid or free
style string
--find-gpt FIND_GPT
Find a GPT file by its ID or full ChatGPT URL
--parse-gptfile PARSE_GPTFILE
Parses a GPT file name
--rename Rename all the GPT file names to include their GPT ID
--rename Rename the GPT file names to include their GPT ID
```
## Features
- Update Logos: Use `--update-logo [filename]` to update the logos of the GPT file.
- Rebuild TOC: Use `--toc` to rebuild the table of contents (TOC.md) file.
- Update Descriptions: Use `--update-description [filename]` to update the descriptions of the GPT file.
- Find GPT File: Use `--find-gptfile [gptid or gpt name in quotes]` to find a GPT by its ID or name.
- Find GPT in TOC: Use `--find-gpttoc [gptid or string]` to search the TOC.md file for a given gptid or free style string.
- Find GPT File: Use `--find-gpt [GPTID or Full ChatGPT URL or a response file with IDs/URLs]` to find a GPT by its ID or URL.
- Rename GPT: Use `--rename` to rename all the GPTs to include their GPTID as prefix.
- Help: Use `--help` to display the help message and usage instructions.
## Usage
To use the tool, run the following command in your terminal with the appropriate arguments:
```bash
python idxtool.py [arguments]
```
Replace `[arguments]` with one of the feature commands listed above.
## Example
To update the logos of a GPT file named `example_gpt.json`, run:
To rebuild the [TOC.md](../TOC.md) file, run:
```bash
python idxtool.py --update-logo example_gpt.json
python idxtool.py --toc
```
## Installation
To find a GPT by its ID, run:
No additional installation is required. Ensure that you have Python installed on your system to run the tool.
```bash
python idxtool.py --find-gpt 3rtbLUIUO
```
## Contributing
or by URL:
```bash
python idxtool.py --find-gpt https://chat.openai.com/g/g-svehnI9xP-retro-adventures
```
Additionally, you can have a file with a list of IDs or URLs and pass it to the `--find-gpt` option:
```bash
python idxtool.py --find-gpt @gptids.txt
```
(note the '@' symbol).
The `gptids.txt` file contains a list of IDs or URLs, one per line:
```text
3rtbLUIUO
https://chat.openai.com/g/g-svehnI9xP-retro-adventures
#vYzt7bvAm
w2yOasK1r
waDWNw2J3
```
Contributions to `idxtool` are welcome. Please submit pull requests or issues to the CSP repo for review.
## License