- Step1: Install refact-lsp via npm or binary release and configure your OpenAI API key in ~/.refact/config.json.
- Step2: Enable refact-lsp in your LSP-compatible editor (e.g., VSCode, Neovim) via editor settings.
- Step3: Open a source file and select the code region you want to refactor.
- Step4: Trigger a refactoring command (e.g., Extract Method, Rename Variable) from the command palette or key binding.
- Step5: Review the AI-generated suggestions and apply them to your codebase.