ai-cli-edit automates code refactoring via CLI, integrating with AI coding tools like Claude Code, OpenCode, and VSCode Copilot. It benefits developers and operations teams by streamlining codebase maintenance, reducing manual effort, and improving consistency. The tool connects to existing codebases and CI/CD pipelines, enabling automated refactoring tasks.
git clone https://github.com/istarkov/ai-cli-edit.gitai-cli-edit provides a browser-based interface for selecting and editing code elements, generating structured prompts that integrate with AI coding tools including Claude Code, OpenCode, VSCode Copilot, and Cursor. Users select DOM elements or code sections using keyboard shortcuts, then copy formatted edit instructions directly to their AI assistant. The tool streamlines code refactoring workflows by translating visual selections into context-rich prompts that work with both high-end reasoning models and faster, lightweight models. Developers and ops teams benefit from reduced manual effort and consistent, automated codebase maintenance without requiring CI/CD pipeline modifications.
Clone the repository and run `bun run --hot ./index.html` to start the development server. Use Ctrl/Cmd+E to toggle selection mode, Alt+↑/↓ to navigate the DOM tree, and Escape to copy formatted edit prompts to clipboard. Paste the generated prompts into your AI coding tool to apply changes.
Visual selection and bulk code refactoring across multiple files
Generating structured prompts for AI assistants from code selections
DOM tree navigation and targeted element editing
Streamlining code review feedback implementation with AI tools
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/istarkov/ai-cli-editCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Refactor the following code snippet to improve readability and performance. The code is from [COMPANY]'s [PROJECT_NAME] repository. Focus on [SPECIFIC_ISSUE] and ensure the changes align with [INDUSTRY] standards. Provide the refactored code and a brief explanation of the improvements.
# Code Refactoring Report
## Original Code
```python
def calculate_discount(price, discount_rate):
if discount_rate > 0:
return price * (1 - discount_rate)
else:
return price
```
## Refactored Code
```python
def apply_discount(price: float, discount_rate: float) -> float:
"""
Apply a discount to the given price.
Args:
price: The original price.
discount_rate: The discount rate (0 <= discount_rate <= 1).
Returns:
The discounted price.
"""
return price * (1 - discount_rate) if discount_rate > 0 else price
```
## Improvements
- **Type Hints**: Added type hints for better code clarity and IDE support.
- **Docstring**: Included a detailed docstring explaining the function's purpose and parameters.
- **Simplified Logic**: Simplified the conditional logic into a single line for better readability.
- **Naming**: Renamed the function to better reflect its purpose.
## Recommendations
- Consider adding input validation to ensure `discount_rate` is within the valid range (0 <= discount_rate <= 1).
- Unit tests should be updated to reflect the new function signature.Cloud ETL platform for non-technical data integration
IronCalc is a spreadsheet engine and ecosystem
Get more done every day with Microsoft Teams – powered by AI
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan