@fettstorch/clai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/cli.js +73056 -0
- package/dist/index.js +46165 -0
- package/package.json +38 -0
- package/src/cli.ts +137 -0
- package/src/index.ts +45 -0
- package/src/openai.ts +92 -0
- package/src/scraper.ts +102 -0
- package/src/summarizer.ts +77 -0
- package/tsconfig.json +14 -0
package/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Command Line AI Interface (CLAI)
|
2
|
+
|
3
|
+
A tool for AI powered web search/scrape and summarization in the Terminal.
|
4
|
+
Built for fun during a hack/jam in order to learn more about AI and CLIs.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Use this global installation in order to use the command line tool
|
9
|
+
```bash
|
10
|
+
npm install clai -g
|
11
|
+
```
|
12
|
+
Install it locally in order to use the clai function in your project.
|
13
|
+
```bash
|
14
|
+
npm install clai
|
15
|
+
```
|
16
|
+
Using both the CLI tool and the clai function requires an OpenAI API key.
|
17
|
+
|
18
|
+
## OpenAI API Key Setup
|
19
|
+
|
20
|
+
1. Check this project's code on GitHub in order to make sure I will not store your key :)
|
21
|
+
2. Go to [OpenAI's API platform](https://platform.openai.com/api-keys)
|
22
|
+
3. Sign up or log in to your OpenAI account
|
23
|
+
4. Click "Create new secret key"
|
24
|
+
5. Copy your API key
|
25
|
+
6. Set it as an environment variable:
|
26
|
+
|
27
|
+
|
28
|
+
## Features
|
29
|
+
### CLI Usage
|
30
|
+
```bash
|
31
|
+
clai https://example.com
|
32
|
+
clai "how tall can giraffes get?"
|
33
|
+
clai how tall can giraffes get
|
34
|
+
clai
|
35
|
+
```
|
36
|
+
<img width="300" src="https://github.com/user-attachments/assets/f4a81e24-ef5b-42b7-bca7-188763d4e5cf" />
|
37
|
+
|
38
|
+
|
39
|
+
### Programmatic API
|
40
|
+
```ts
|
41
|
+
import clai from 'clai';
|
42
|
+
|
43
|
+
const { summary, links, sources } = await clai('https://example.com', 'your-openai-api-key');
|
44
|
+
```
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
ISC
|