Giter Site home page Giter Site logo

vaderyang / ptpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leslieleung/ptpt

0.0 1.0 0.0 1.76 MB

Let ChatGPT handle Plain Text for you! 让 ChatGPT 替你处理纯文本文件!

License: GNU Affero General Public License v3.0

Go 98.80% Makefile 1.20%

ptpt's Introduction

PTPT - Prompt To Plain Text

English | 简体中文

Quality Gate Status

Introduction

PTPT is an command-line tool that allows you to easily convert plain text files using pre-defined prompts with the help of ChatGPT. With PTPT, you can effortlessly create and share prompt formats, making collaboration and customization a breeze. Plus, by subscribing, you gain access to even more prompts to enhance your experience. If you're interested in prompt engineering, you can use PTPT to develop and share your prompts.

Features

If you don't have access to GPT-4 yet, you can try AIProxy.

  • Let ChatGPT handle plain text files for you!
  • Predefined prompts (currently with 18 prompts, contributions welcome!)
  • Convenient sharing and extension of prompts format
  • 🌟Get more prompts by subscribing
  • 🌟Develop and manage your prompts
  • Use via proxy
  • 🌟Lint your code with ChatGPT!
  • 🌟Chat with ChatGPT in your terminal!

List of Prompts currently supported:

  • 🧸Role-playing (for entertainment only) - role_play
  • 🧸Greeting (for entertainment only) - hello
  • 📝Translate Markdown - translate
  • 📝Translate csv to csv - translate
  • 📝Translate csv to GNU po (WIP)
  • 💻Code review - code_review
  • 💻Convert json to go struct - json_converter
  • 📝Generate prompt documentation - prompt_doc
  • 💻Generate gorm struct - sql
  • 💻Generate regular expression - regex
  • 💻Generate summarize and SEO keywords

Installation

go install github.com/leslieleung/ptpt@latest

Or download from Release

Featured Usages

ChatGPT Lint

> ptpt lint <file-or-path>

As of v0.1.5 , you can use the diff feature to lint the changes in the git repository. This feature relies on git, make sure git is usable.

> ptpt lint -d # default to HEAD
> ptpt lint -d <other git diff params>

Generate Commit Message

# You still have to add files to stage manually
> git add .
# Let ptpt do the magic
> ptpt commit

Chat With ChatGPT

> ptpt chat

Usage

For first-time use, please configure api_key and proxy_url (optional) according to the wizard.

Set Temperature

Set the temperature of ChatGPT. The default value is 0.7.

> ptpt run lint <file> -t 0.8

Subscribe Prompts

> ptpt prompt subscribe https://raw.githubusercontent.com/LeslieLeung/pt-collection/main/awesome-chatgpt-prompts/awesome-chatgpt-prompts.yaml

This subscribes to all prompts from f/awesome-chatgpt-prompts.

More subscriptions will be updated in the future. Please follow pt-collection, which will automatically update upstream prompts every day at UTC 0.

Interactive

Several useful prompts have already been pre-installed, with more to come in future updates. Additional prompts can also be obtained through subscribing.

> ptpt run

CLI

ptpt run [prompt] [inFile] [outFile]

# Redirect
> ptpt run translate-markdown Hello.md > Hello_tranlsated.md
# Or write to file
> ptpt run translate-markdown Hello.md Hello_tranlsated.md

Create your own prompt

Interactively

> ptpt prompt create

The generated prompt yaml would be saved to ptpt/prompt directory.

Syntax

version: v0 # version of prompt yaml, currently v0
prompts: # your defined prompt
  - name: role-yoda # prompt name
    description: "Role Play as Yoda" # prompt description
    system: You are Yoda master from Star Wars, speak in his tongue you must. # system 指令
  - name: role-spock
    description: "Role Play as Spock"
    system: You are Spock from Star Trek, you must speak in his tongue.

By downloading and saving shared prompts to the ptpt/prompt directory, more prompts can be used.

Generating Prompt Documents

> ptpt run prompt-doc prompt.yaml > prompt.md

Configuration File

The default configuration file directory for ptpt is as follows, and is currently not customizable.

Windows: %APPDATA%\ptpt
macOS: $HOME/Library/Application Support/ptpt
Linux: $HOME/.config/ptpt

Roadmap

  • Support proxy configuration
  • Optimize user experience
  • Support ChatGPT parameter configuration
  • PromptHub - Share prompts through yaml files
  • Support more prompts
  • Support extra long texts

Credits

This project is inspired by sigoden/aichat. The original project was written in Rust, but due to my limited abilities, I wanted to create my own version using my familiar technology stack.

ptpt's People

Contributors

leslieleung avatar rehtt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.