{"id":21204798,"url":"https://github.com/leslieleung/ptpt","last_synced_at":"2025-07-10T08:31:46.017Z","repository":{"id":149229744,"uuid":"619951267","full_name":"LeslieLeung/PTPT","owner":"LeslieLeung","description":"Let ChatGPT handle Plain Text for you! 让 ChatGPT 替你处理纯文本文件！","archived":false,"fork":false,"pushed_at":"2024-11-08T15:10:49.000Z","size":1858,"stargazers_count":49,"open_issues_count":12,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T16:23:38.588Z","etag":null,"topics":["chatgpt","cli","linter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeslieLeung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T18:30:06.000Z","updated_at":"2024-11-03T15:13:38.000Z","dependencies_parsed_at":"2023-12-18T21:59:55.655Z","dependency_job_id":"51475349-3849-4693-ba82-d826ce65d257","html_url":"https://github.com/LeslieLeung/PTPT","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeslieLeung%2FPTPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeslieLeung%2FPTPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeslieLeung%2FPTPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeslieLeung%2FPTPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeslieLeung","download_url":"https://codeload.github.com/LeslieLeung/PTPT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225629679,"owners_count":17499283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","cli","linter"],"created_at":"2024-11-20T20:40:21.789Z","updated_at":"2024-11-20T20:40:22.583Z","avatar_url":"https://github.com/LeslieLeung.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PTPT - Prompt To Plain Text\n\nEnglish | [简体中文](README_zh.md)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=LeslieLeung_PTPT\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=LeslieLeung_PTPT)\n\n## Introduction\n\nPTPT is a command-line tool that allows you to easily convert plain text files using pre-defined prompts with the help of ChatGPT. \nWith PTPT, you can effortlessly create and share prompt formats, making collaboration and customization a breeze. \nPlus, by subscribing, you gain access to even more prompts to enhance your experience.\nIf you're interested in prompt engineering, you can use PTPT to develop and share your prompts.\n\n## Features\n\n- `lint` Lint your code to find potential problems.\n- `commit` Generate commit message.\n- `chat` Chat with ChatGPT in terminal.\n- `cli` A copilot cli like experience tool. Generate and run cli commands with natural language.\n- `run` Run prompt to process plain text files.\n- `prompt` Create your own prompt or subscribe to prompts.\n\n## Installation\n\n```bash\ngo install github.com/leslieleung/ptpt@latest\n```\n\nOr download from [Release](https://github.com/LeslieLeung/PTPT/releases)\n\n## Usage\n\n### First Time Setup\n\nFor first-time use, please configure `api_key` and `proxy_url` (optional) according to the wizard.\n\n```bash\n\u003e ptpt\n```\n\n### Lint Code\n\n```bash\n\u003e ptpt lint \u003cpath\u003e\n```\n\n![](example/lint_example.png)\n\n\u003e *As of `v0.1.5` , you can use the diff feature to lint the changes in the git repository.*\n\u003e \n\u003e *This feature relies on git, make sure `git` is usable.*\n\n```bash\n\u003e ptpt lint -d # default to HEAD\n\u003e ptpt lint -d \u003cother git diff params\u003e\n```\n\n### Generate Commit Message\n\n```bash\n\u003e ptpt commit\n```\n\n### Chat With ChatGPT\n\n```bash\n\u003e ptpt chat\n```\n\n### Copilot Cli\n\n```bash\n\u003e ptpt cli \"List 10 recent modified files in current directory\"\n```\n\n![](docs/screenshots/cli.png)\n\n### Subscribe Prompts\n\n```bash\n\u003e ptpt prompt subscribe https://raw.githubusercontent.com/LeslieLeung/pt-collection/main/awesome-chatgpt-prompts/awesome-chatgpt-prompts.yaml\n```\n\nThis subscribes to all prompts from [f/awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts).\n\nMore subscriptions will be updated in the future. Please follow [pt-collection](https://github.com/LeslieLeung/pt-collection), which will automatically update upstream prompts every day at UTC 0.\n\n### Interactive\n\nSeveral useful prompts have already been pre-installed, with more to come in future updates. Additional prompts can also be obtained through subscribing.\n\n```bash\n\u003e ptpt run\n```\n\n![](docs/screenshots/interactive.gif)\n\n### Run Prompt\n\n```bash\nptpt run [prompt] [inFile] [outFile]\n\n# Redirect\n\u003e ptpt run translate-markdown Hello.md \u003e Hello_tranlsated.md\n# Or write to file\n\u003e ptpt run translate-markdown Hello.md Hello_tranlsated.md\n```\n\n### Prompt Management\n\n#### Create Your Own Prompt(Interactively)\n\n```bash\n\u003e ptpt prompt create\n```\n\nThe generated prompt yaml would be saved to `ptpt/prompt` directory.\n\n#### Prompt File Syntax\n\n```yaml\nversion: v0 # version of prompt yaml, currently v0\nprompts: # your defined prompt\n  - name: role-yoda # prompt name\n    description: \"Role Play as Yoda\" # prompt description\n    system: You are Yoda master from Star Wars, speak in his tongue you must. # system 指令\n  - name: role-spock\n    description: \"Role Play as Spock\"\n    system: You are Spock from Star Trek, you must speak in his tongue.\n```\n\nBy downloading and saving shared prompts to the `ptpt/prompt` directory, more prompts can be used.\n\n#### Generating Prompt Documents\n\n```bash\n\u003e ptpt run prompt-doc prompt.yaml \u003e prompt.md\n```\n\n### Global Settings\n\n#### Set Temperature\n\nSet the temperature of ChatGPT, range from 0.0 ~ 1.0. The default value is `0.7`.\n\n```bash\n\u003e ptpt \u003ccmd\u003e -t 0.8\n```\n\n#### Set Model\n\nSet model to use. The default value is `gpt-3.5-turbo-0613`.\n\n```bash\n\u003e ptpt \u003ccmd\u003e -m gpt-4\n```\n\nFor the full list of models, please refer to [HERE](https://github.com/sashabaranov/go-openai/blob/master/completion.go)\n\n## Configuration File\n\nThe default configuration file directory for `ptpt` is as follows, and is currently not customizable.\n\n```\nWindows: %APPDATA%\\ptpt\nmacOS: $HOME/Library/Application Support/ptpt\nLinux: $HOME/.config/ptpt\n```\n\n## Credits\nThis project is inspired by [sigoden/aichat](https://github.com/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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleslieleung%2Fptpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleslieleung%2Fptpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleslieleung%2Fptpt/lists"}