tokcount
// count tokens. know before you send.
installation
npm install -g pnkd-tokcountusage
# count tokens in file
tokcount prompt.txt
# count for specific model
tokcount prompt.txt --model gpt-4
# count from stdin
cat prompt.txt | tokcount
# show cost estimate
tokcount prompt.txt --cost