Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,25 @@ The workflow:
- Run the command, write instructions on what you want changed.
- Enjoy the sassy comments.

This tool calls the openai api. You'll need your own api key to use it.
Use `refac login` to enter your api key. It will be saved in your home directory
for future use. See [your api usage](https://platform.openai.com/account) .
This tool calls the Anthropic (Claude) API by default — bring your own API key.
Use `refac login` to enter it; the key is saved in your home directory for future
use. See [your API usage](https://console.anthropic.com/settings/usage).

OpenAI is still supported: set `provider = "openai"` in
`~/.config/refac/config.toml` (or `REFAC_PROVIDER=openai`), then `refac login`.

Config (`~/.config/refac/config.toml`, all optional):

```toml
provider = "anthropic" # or "openai"
model = "claude-opus-4-8" # default per provider; or set REFAC_MODEL
edit_mode = "tool" # "tool" (default, Anthropic): structured edits via a
# function call, not a full rewrite. "rewrite" = old
# behavior. OpenAI always rewrites. Or set REFAC_EDIT_MODE.
max_tokens = 16000 # Anthropic only
```

Keys may also be supplied via `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` env vars.

## SETUP

Expand Down
Loading