Skip to content

vhxnif/pet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI-based Command Line Tool

Feature

  1. Chat

  2. Translate

  3. Time Convert

  4. Improve Writing

  5. github trending

Env

  • OPENAI_API_KEY: OpenAi or LLM model key with same format API.

  • OPENAI_BASE_URL: The BaseUrl of Api Endpoint.

  • OPENAI_MODEL: LLM model name.

  • SYSTEM_PROMPT_PATH: Chat system prompt file path.

deepseek example
export OPENAI_API_KEY=$DEEP_SEEK
export OPENAI_BASE_URL=https://api.deepseek.com
export OPENAI_MODEL=deepseek-chat
export CODER_MODEL=deepseek-coder

Alias

.bashrc
alias pet="java -jar ~/.tools/pet.jar"

Command

pet
Usage: pet [-hV] [COMMAND]
pet
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  chat, ct, ask        A chat cli tool.
  chat-config, cf      About Chat Command config.
  translate, ts        AI Translation Tool
  github-trending, gt  Github Trending.
  time-convert, tc     Convert dates and timestamps between each other.
  improve-writing, iw  Improve Writing.
pet chat
Usage: pet chat [-hVw] [-ct=<chat>] [-f=<file> | -c] <text>
A chat cli tool.
      <text>
  -c, --coder              The model that uses chat coding.
      -ct, --chat=<chat>   Select Or Create a Chat.
  -f, --file=<file>        The file content that chat based on.
  -h, --help               Show this help message and exit.
  -V, --version            Print version information and exit.
  -w, --with-context       Use context.
pet chat-config
Usage: pet chat-config [-hV] (-sp | -cs | -sc=<selectChat> | -dc=<delChat> |
                       -ct)
About Chat Command config.
      -cs, --chats           The chats used.
      -ct, --context         The context chat messages.
      -dc, --del-chat=<delChat>
                             Delete  by chat No.
  -h, --help                 Show this help message and exit.
      -sc, --select-chat=<selectChat>
                             Select by chat No.
      -sp, --system-prompt   The system prompt currently in use.
  -V, --version              Print version information and exit.
pet translate
Usage: pet translate [-hsV] [-l=<lang>] [-o=<outputPath>] (-f=<file> | <text>)
AI Translation Tool
      <text>
  -f, --file=<file>       The file needs to be translated
  -h, --help              Show this help message and exit.
  -l, --language=<lang>   The translate target language.
  -o, --output=<outputPath>
                          Output file path.
  -s, --without-source    Printed without source text.
  -V, --version           Print version information and exit.
pet time-convert
Usage: pet time-convert [-hV] [-z=<timezone>] (-s=<timestamp> | -t=<datetime>)
Convert dates and timestamps to and from each other.
  -h, --help      Show this help message and exit.
  -s, --timestamp=<timestamp>
                  timestamp
  -t, --date-time=<datetime>
                  date time string, yyyy-MM-dd HH:mm:ss
  -V, --version   Print version information and exit.
  -z, --timezone=<timezone>
                  timezone, eg. Asia/Shanghai
pet improve-writing
Usage: pet improve-writing [-hV] <text>
Improve Writing.
      <text>
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
pet github-trending
Usage: pet github-trending [-hV] [-l=<language>] [-s=<since>]
Github Trending.
  -h, --help            Show this help message and exit.
  -l, --language=<language>
                        eg. kotlin, javascript, java...
  -s, --since=<since>   eg. DAILY WEEKLY MONTHLY
  -V, --version         Print version information and exit.

Build

Releases

No releases published

Packages

No packages published