π Automate text optimization with Large Language Models (LLMs)
Writing requires a focus on content creation without distractions. Editor AI is an open-source AI-powered content editing tool that automatically enhances content with Large Language Models (LLMs).
By utilizing automated editing and search engine optimization (SEO), Editor AI ensures your content remains high-quality, engaging, and up-to-date, without extra effort.
Benefits of Using Editor AI
- AI-driven editing β It refines your writing efficiently.
- Boosts SEO β Keeps content fresh and optimized for search engines.
- Hands-free workflow β It eliminates the need for manual editing.
Editor AI improves your content through AI-based text optimization:
- Reads content from the specified directory.
- Uses LLM-powered optimization to refine and improve the text.
- Applies any enhancements directly to your files.
- Saves the improved content automatically.
- Go installed (>=1.18)
- An OpenAI API key
To get started, you have two options:
Download the latest release binary for your operating system from the GitHub Releases page.
# Linux
chmod +x editor-ai-linux-amd64
./editor-ai-linux-amd64 --dir "/path/to/files" --api_key "your_openai_api_key"
# macOS
chmod +x editor-ai-darwin-amd64 # For Intel Macs
./editor-ai-darwin-amd64 --dir "/path/to/files" --api_key "your_openai_api_key"
# macOS (Apple Silicon)
chmod +x editor-ai-darwin-arm64
./editor-ai-darwin-arm64 --dir "/path/to/files" --api_key "your_openai_api_key"
# Windows
editor-ai-windows-amd64.exe --dir "C:\path\to\files" --api_key "your_openai_api_key"Clone the repository and navigate to the project directory:
git clone https://github.com/devslovecoffee/editor-ai.git
cd editor-aiBuild using the provided Makefile:
# Build the application
make build
# Run tests
make test
# Build releases for all platforms
make release
# Run the application
make run DIR="/path/to/files" API_KEY="your_openai_api_key" GLOB="*.md"Run make help to see all available commands.
Run the program with the required flags:
go run main.go --dir "absolute/path/to/files" --api_key "your_openai_api_key"If desired, specify a glob pattern to target particular files (e.g., markdown):
go run main.go --dir "absolute/path/to/files" --api_key "your_openai_api_key" --glob "*.md"| Flag | Description | Required |
|---|---|---|
--dir |
Absolute path to the directory containing files | β |
--api_key |
OpenAI API key | β |
--glob |
Glob pattern to filter files (default: **) |
β |
--config |
Path to custom configuration file | β |
--init-config |
Initialize a default configuration file | β |
--init-config-path |
Path where to save the default configuration file | β |
--keywords |
Path to CSV file with keywords data | β |
You can customize EditorAI's behavior using configuration files in YAML format. This allows you to adapt the tool to different content types and requirements without modifying the code.
To create a default configuration file:
# Create a config file in the default location (~/.config/editor-ai/config.yaml)
editor-ai --init-config
# Create a config file in a custom location
editor-ai --init-config-path ./my-config.yamlTo use a configuration file:
# Use a specific config file
editor-ai --dir "/path/to/files" --api_key "your_openai_api_key" --config ./my-config.yaml
# Use the default config file locations (searches in current directory, home directory, etc.)
editor-ai --dir "/path/to/files" --api_key "your_openai_api_key"The tool will automatically look for configuration files in these locations (in order):
- Current directory (
editor-ai.yamloreditor-ai.yml) - User's home directory (
.editor-ai.yamlor.editor-ai.yml) ~/.config/editor-ai/config.yamlor~/.config/editor-ai/config.yml
# LLM Model to use
model: gpt-4.1-mini-2025-04-14
# Prompts Configuration
prompts:
system_prompt: |
# Your system prompt template
user_prompt: |
# Your user prompt template
output_format: |
# Your output format template
# Rules Configuration
rules:
edit_rules: |
# Your editing rules
content_rules: |
# Your content handling rules
output_rules: |
# Your output formatting rules
# Examples Configuration
examples:
replace_examples: |
# Your replacement examplesSee the examples/ directory for complete configuration examples:
examples/config.yaml- Default configurationexamples/marketing-config.yaml- Specialized for marketing contentexamples/technical-docs-config.yaml- Specialized for technical documentation
Note: The configuration file uses Go templates with variables like
{{ .Content }}. Make sure to preserve these variables in your custom prompts to ensure proper functionality.
You can provide a CSV file containing keywords to target in your content for better SEO:
editor-ai --dir "/path/to/files" --api_key "your_openai_api_key" --keywords "/path/to/keywords.csv"The CSV file should have the following columns:
Cluster- Group or category the keyword belongs toKeyword- The actual keyword or phrase to targetVolume Range- Search volume informationCompetition- Competitive difficultyCPC- Cost per click
Example CSV format:
Cluster,Keyword,Volume Range,Competition,CPC
Tech,artificial intelligence,10K-100K,High,$2.50
Tech,machine learning,5K-10K,Medium,$1.80
Marketing,content marketing,1K-5K,Low,$0.95
The keywords will be included in the prompt to the AI, helping it optimize the content for specific search terms with priority given to high-volume, low-competition keywords.
A sample keywords CSV file is provided in examples/keywords.csv.
Optimized 5 changes for article example.md
Optimized 3 changes for article another-file.md
- Add release binaries.
- Support for custom keywords.
- Parallel processing of content.
- Tests.
- Support for more LLM providers.
- LLM Model selection.
- Customizable prompt via config file.
- Customizable edit rules via config file.
- Customizable examples via config file.
- Store memories for later reference after optimizing.
- Read your content from the web.
- Optimization as part of your github workflow (optimize on PR).
- Add contributing guidelines.
π Contributions are welcome!
- Report issues or suggest features via GitHub Issues.
- Fork the repo and submit a Pull Request.
- Star β the repository if you find it useful!
Coming Soon: CONTRIBUTING.md file with setup instructions.
The current editing rules are inspired by Eva Parish's guide, a fantastic resource on writing improvement.
This project is licensed under the Apache 2.0 License.