https://github.com/nyzss/cli-openai
OpenAI CLI tool made to learn about the API and Deno.
https://github.com/nyzss/cli-openai
chatgpt cli deno openai
Last synced: about 2 months ago
JSON representation
OpenAI CLI tool made to learn about the API and Deno.
- Host: GitHub
- URL: https://github.com/nyzss/cli-openai
- Owner: nyzss
- Created: 2024-11-10T22:42:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-10T23:36:25.000Z (over 1 year ago)
- Last Synced: 2025-01-08T12:42:54.030Z (over 1 year ago)
- Topics: chatgpt, cli, deno, openai
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CLI OpenAI Tool (Deno)
A simple CLI tool to interact with OpenAI’s API using Deno. Send prompts, get responses, and log conversations locally. Built as a learning project.
## Setup
1. **Prerequisites**: Install [Deno](https://deno.land/).
2. **Environment**: Create a `.env` file (based on `.env.template`) with:
```env
OPENAI_API_KEY=
OPENAI_URL=https://api.openai.com/v1/chat/completions
```
## Usage
Run with necessary permissions:
```bash
deno run --allow-net --allow-read --allow-write your_script.ts
```
- **Prompt**: Enter a prompt when asked.
- **Logs**: All prompts and responses are saved in `logs.json`.
## Notes
- `.env` keeps API keys hidden.
- Run with `Ctrl+C` to exit.
---
This is a learning project, and I’m open to suggestions for improvement!