Skip to content

Commit 2e8d4d3

Browse files
authored
chore: update readme after addition of config feature (#9)
* update readme to include new config feature * remove references to OPENAI_API_KEY * fmt & whitespace
1 parent a92bedc commit 2e8d4d3

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

.github/workflows/rust.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -13,33 +13,33 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Build
18-
run: cargo build --verbose
19-
16+
- uses: actions/checkout@v4
17+
- name: Build
18+
run: cargo build --verbose
19+
2020
tests:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v4
24-
- name: Run tests
25-
env:
26-
AI_API_KEY: ${{ secrets.AI_API_KEY }}
27-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
28-
run: cargo build && cargo test --verbose
23+
- uses: actions/checkout@v4
24+
- name: Run tests
25+
env:
26+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
27+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
28+
run: cargo build && cargo test --verbose
2929

3030
review:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v4
34-
- name: GPT Code Review
35-
env:
36-
AI_API_KEY: ${{ secrets.AI_API_KEY }}
37-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
38-
run: cargo build && find . -path './target' -prune -o -name '*.rs' -exec echo {} \; -exec cat {} \; | ./target/debug/pipe-gpt --code-review --markdown
33+
- uses: actions/checkout@v4
34+
- name: GPT Code Review
35+
env:
36+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
37+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
38+
run: cargo build && find . -path './target' -prune -o -name '*.rs' -exec echo {} \; -exec cat {} \; | ./target/debug/pipe-gpt --code-review --markdown
3939

4040
fmt:
4141
runs-on: ubuntu-latest
4242
steps:
43-
- uses: actions/checkout@v4
44-
- name: Check formatting
45-
run: cargo fmt -- --check
43+
- uses: actions/checkout@v4
44+
- name: Check formatting
45+
run: cargo fmt -- --check

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,27 @@ Pipe your content to gpt directly from the command line. A concept that allows f
33

44
Installation via cargo `cargo install pipe-gpt`, build it locally via `cargo build --release`, or download from the releases page.
55

6-
Please note you will need an [OpenAI API Key](https://platform.openai.com/account/api-keys).
7-
8-
### Set the open api key env var
9-
- in linux: `export OPENAI_API_KEY=sk-12345abc`
10-
- in windows powershell `$env:OPENAI_API_KEY = 'sk-12345abc'`
6+
Please note you will need an api key e.g. [OpenAI API Key](https://platform.openai.com/account/api-keys).
7+
8+
### Set the API key env var
9+
- The app reads AI_API_KEY
10+
- in linux/macOS: `export AI_API_KEY=sk-12345abc`
11+
- in windows powershell `$env:AI_API_KEY = 'sk-12345abc'`
12+
13+
## Configuration
14+
- Config file path: ~/.config/pipe-gpt/config.yaml (Linux/macOS) or %APPDATA%/pipe-gpt/config.yaml (Windows)
15+
- Fields and defaults:
16+
- api_url: https://api.openai.com/v1/
17+
- model: gpt-4o
18+
- max_tokens: 8192
19+
- temperature: 0.6
20+
- Example:
21+
```
22+
api_url: "https://api.openai.com/v1/"
23+
model: "gpt-4o"
24+
max_tokens: 2048
25+
temperature: 0.6
26+
```
1127

1228
## Use cases
1329

@@ -16,7 +32,7 @@ Please note you will need an [OpenAI API Key](https://platform.openai.com/accoun
1632
- `cat main.rs | pipe-gpt -p "How would you improve this code? Include line numbers in your comments so I can tell where you mean."`
1733
- `cat main.rs | pipe-gpt -p "Is this code production ready? If yes reply 'Yes'. If no, then explain why not. Be concise."`
1834
- `cat file.json | pipe-gpt -p "Convert this JSON to YAML" > file.yaml`
19-
- `cat french.txt | pipe-gpt -p "Translate this to English please."`
35+
- `cat french.txt | pipe-gpt -p "Translate this to English please."`
2036
- `git diff --staged | pipe-gpt -p "Code review this code change"`
2137
- `cat src/main.rs | pipe-gpt -p "improve the code and only output the replacement code as I will pipe the output directly back into a file, no explanations, just pure code please" > src/main.new.rs`
2238

@@ -55,7 +71,7 @@ jobs:
5571
run: cargo test --verbose
5672
- name: GPT Code Review
5773
env:
58-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
74+
AI_API_KEY: ${{ secrets.AI_API_KEY }}
5975
run: pwd && find . -path './target' -prune -o -name '*.rs' -exec echo {} \; -exec cat {} \; | ./target/debug/pipe-gpt -p "how would you improve this code? include line numbers in your comments so I can tell where you mean"
6076
```
6177

0 commit comments

Comments
 (0)