Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
This script provides a simple way to chat with OpenAI. It allows you to communicate with the ChatGPT model directly from your terminal.
$ ch -m 'Write a Python function to greet the person reading this text.'
Chat
Model: gpt-3.5-turbo, temperature: 0.0
System: You are a skilled Python programmer who writes tersely.
Message: Write a Python function to greet the person reading this text.
Sure, here you go!
```python
def greet():
print("Hello there!")
```
This code defines a function called `greet()` that, when called, will print the greeting "Hello there!" to the console.
(83 tokens used.)
First, there is a recap of the request sent to the API with selected arguments. Next, chat completion API's response is displayed. Output also includes token count (e.g., 83 tokens used) at the end.
The message is specified using the --message, -m
argument.
$ ch -m 'Write a Python function `hello_world`.'
The default system
message is: 'You are a skilled Python programmer who writes tersely.' You can change it by specifying the --system, -s
argument inside the current command:
$ ch -s 'You are a remarkable Italian teacher.' -m 'Translate "Hello there!"'
From the version v1.1.0
the recent system message becomes the default one until further change (or configuration file deletion).
On/off flag indicating whether a conversation is intended and messages will be appended to the list of messages in the configuration file. Use --conversation, -c
argument inside the current command.
You may specify the model that will be used for the API requests (until further change).
The temperature may be set using the --temperature, -t
argument. The default value for this script is 0 (lowest).
Specify the path to save the audio response using the --save-audio
argument.
List available OpenAI models using the --available-models
argument.
List available ChatGPT models using the --available-models-gpt
argument.
To use this script, you will need to have the following:
OPENAI_API_KEY
)To use the script:
OPENAI_API_KEY
environment variable.pip install chat-in-a-nutshell
This script was developed for chatting with OpenAI's ChatGPT from the comfort of the terminal. The API used in the script incurs charges (depending on its usage). For more information about pricing, refer to the OpenAI documentation. Please note that there is no warranty for script functionality. Also, keep in mind that it is suitable for brief and straightforward messages.
o1 model support:
Added CI/CD Pipeline:
chat
to ch
to avoid conflicts with other programs.~/.chatconfig.json
).--help
now prints the list of available gpt
models)conversation
that enables longer conversation.Feel free to leave suggestions in the form of GitHub issues. Thank you!
FAQs
A terminal-based script for interacting with OpenAI's API.
We found that chat-in-a-nutshell demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.