Skip to content

Commit 1c1109b

Browse files
committed
Readme init
1 parent 072b657 commit 1c1109b

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Perplexity CLI
2+
Perplexity CLI is a simple and convenient command-line client for the Perplexity API, allowing users to quickly ask questions and receive answers directly from the terminal.
3+
4+
## Features
5+
- Easy querying of the Perplexity API
6+
- Support for various language models
7+
- Optional display of token usage statistics
8+
- Optional display of citations
9+
- Colorful output formatting (with glow support)
10+
- API key handling from environment variable or command-line argument
11+
12+
## Requirements
13+
- Python 3.6+
14+
- `requests` library
15+
16+
## Installation
17+
No installation is required. You can run the script directly from the GitHub repository or install it locally.Example of local installation:
18+
19+
```bash
20+
curl -s https://raw.githubusercontent.com/dawid-szewc/perplexity-cli/main/perplexity.py > ~/.local/bin/perplexity \
21+
chmod +x ~/.local/bin/perplexity \
22+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc \
23+
echo 'export PERPLEXITY_API_KEY="your-api-key"' >> ~/.bashrc
24+
```
25+
## Usage
26+
```bash
27+
perplexity "What is the meaning of life?"
28+
```
29+
30+
## With Additional Options
31+
```bash
32+
perplexity -uc -m llama-3.1-sonar-large-128k-online "Explain Einstein's theory of relativity"
33+
```
34+
35+
## Options
36+
- `-v`, `--verbose`: Enable debug mode
37+
- `-u`, `--usage`: Show token usage statistics
38+
- `-c`, `--citations`: Show citations
39+
- `-g`, `--glow`: Use Glow-compatible formatting
40+
- `-a API_KEY`, `--api-key API_KEY`: Set the API key (optional, defaults to `PERPLEXITY_API_KEY` environment variable)
41+
- `-m MODEL`, `--model MODEL`: Choose the language model (default: llama-3.1-sonar-small-128k-online)
42+
43+
## Available Models
44+
- llama-3.1-sonar-small-128k-online
45+
- llama-3.1-sonar-large-128k-online
46+
- llama-3.1-sonar-huge-128k-online
47+
48+
## Configuration
49+
Set the `PERPLEXITY_API_KEY` environment variable with your Perplexity API key:
50+
```bash
51+
export PERPLEXITY_API_KEY="your-api-key"
52+
```
53+
54+
## License
55+
This project is released under the MIT License.
56+
57+
## Author
58+
Dawid Szewc
59+
60+
## Contributing
61+
We welcome issue reports and suggestions for improvements through GitHub Issues.It's worth noting that the project is actively developed and may contain additional features or changes not included in this description. It's recommended to check the latest documentation in the GitHub repository for the most up-to-date information.

0 commit comments

Comments
 (0)