Refrax

Refrax is an AI-powered refactoring agent for Java code, implemented in Go. It communicates using the A2A protocol.
⚠️ Early prototype — subject to rapid change.
Installation
Releases
Download the latest stable version from the releases page. Pre-built binaries are available for macOS, Windows, and Linux.
Using Go
If you have Go 1.24.1 or later installed, you can run:
go install github.com/cqfn/refrax@latest
To install a specific version, use:
go install github.com/cqfn/refrax@v0.0.1
Releases page.
From Source
Ensure that Go 1.24.1 or later is installed on your system.
-
Clone the repository:
git clone https://github.com/cqfn/refrax.git
cd refrax
-
Build the binary:
go build -o refrax
-
(Optional) Install the binary to your $GOPATH/bin:
go install
Usage
*
refrax refactor [path]: Refactor Java code in the specified directory (defaults to current directory).
refrax start [agent]: Start the server for agents like fixer, critic, or facilitator.
Configuration
--ai, -a: Specify the AI provider (e.g., deepseek).
--token, -t: Token for the AI provider.
--debug, -d: Enable debug logging.
Authentication
Some operations in Refrax require AI authentication using an API token. You can provide the token using one of the following methods:
Command-Line Flag
refrax refactor . --token your-token-here
Environment Variable
Set the DEEPSEEK_TOKEN environment variable:
export DEEPSEEK_TOKEN=your-token-here
refrax start facilitator
✅ The DEEPSEEK_TOKEN variable is the recommended option.
⚠️ The TOKEN variable is still supported but deprecated.
.env File
If a .env file is present in the working directory, Refrax will attempt to read the token from it:
# .env
DEEPSEEK_TOKEN=your-token-here
Priority Order
If multiple sources are provided, the following priority order is applied (highest priority first):
--token command-line flag
DEEPSEEK_TOKEN environment variable
TOKEN environment variable (deprecated)
.env file (DEEPSEEK_TOKEN > TOKEN)
License
Licensed under the MIT License.