Skip to main content

A CLI tool to edit files using LLMs

Project description

LLM Editor

A CLI tool to edit files using LLMs.

Installation

pip install .

Configuration

You can configure the tool using a YAML file.

YAML Configuration

Run the following command to generate a default configuration file at ~/.llm-editor/config.yaml:

edit --init-config

Then edit the file to add your API key:

llm:
  provider: openai
  api_key: "your-api-key"
  model: "gpt-4o"

app:
  backup_enabled: true
  backup_suffix: ".backup"

Usage

1. Using Prompt Tags (Scripting Mode)

Add your instructions directly to the file using <tag> markers.

Example input.txt:

<tag> start_prompt
Convert the following Python code to JavaScript.
<tag> end_prompt

def greet(name):
    print(f"Hello, {name}!")

greet("World")

Run the tool:

edit input.txt

2. Interactive Mode

If the input file does not contain prompt tags, the tool will open your default text editor (configured via $EDITOR). You can type your instructions there, save, and close the editor to proceed.

Options

  • --outfile <path>: Write output to a specific file (input file is preserved).
  • --inplace: Overwrite the input file directly (skips backup).
  • --init-config: Initialize the configuration file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_editor-0.1.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_editor-0.1.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_editor-0.1.3.tar.gz.

File metadata

  • Download URL: llm_editor-0.1.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_editor-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4feb8dc29fcd62902e80bfaba99daf75a49d0e893598b5ef7beefc00fc2a4d05
MD5 abf17378e955be0a19b764a4ab409dad
BLAKE2b-256 c25cdde472721d6ca0b17802c8ebbb5c6541d13b3444ad8928cbc54b2bfb6c10

See more details on using hashes here.

File details

Details for the file llm_editor-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: llm_editor-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_editor-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c5a35ddd37806ffe7eeadfded796a4f04696d303920b0c31b126addf20f852b
MD5 932b4f611c97736039263da5ad83f95e
BLAKE2b-256 98c1d7617e0bd463b95ec0e46c0cc22ee42790ee655a9aa8091bff10ac6c9894

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page