Skip to content

varo6/tchat-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tchat-cli 🔗

Open t3.chat, chatGPT & more with a prefilled prompt from the CLI with quick file support!

Demo

Install

The package is just 22kb before minify, with no dependencies added 🪶

bun i -g @varo6/tchat-cli

Bun is needed as we use their native File I/O api.

Usage

Although it is recommended, tchat can be used with or without wrapping with "".

tchat "hi! how are you"
tchat -f README.md -f tchat.ts review these files

There's also sending context from stdin and print the url without opening the browser

echo "context from stdin" | tchat --stdin "extra prompt"
tchat --print "only output the URL"

tchat works better on linux. Expect some problems in Windows until testing is done.

Config

Some options can be chosen with an interactive menu by typing tchat --config . Default options are t3.chat with last used model as the default. You are free to change either the model, baseUrl , or browser with openCmd

Config file location is: ~/.config/tchat/config.json

{
  "model": "model-id",
  "baseUrl": "https://t3.chat/new",
  "openCmd": "firefox"
}

You can find a list of available model IDs here.

baseUrl for chagpt is: https://chatgpt.com/ and it is recommended to set model as ""

Options

Options that can make your experience better

-m, --model <model>     Model id (env: TCHAT_MODEL)
-f, --file <path>       Read content from file(s), can be used multiple times
--base <url>            Base URL (env: TCHAT_BASE_URL)
--open-cmd <cmd>        Override opener command (env: TCHAT_OPEN_CMD)
--print                 Print the URL instead of opening
--stdin                 Read stdin even if TTY
--no-stdin              Ignore stdin
-h, --help              Show help

Build (optional)

The published package uses a bundled/minified build.

bun run build

About the package

Huge thanks to theo, markr and t3.chat team for developing such a great product. This package is intended to use with quick prompts and small files and not for abusing the chat. The package will be changed or deleted if it breaks any of the terms of service

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published