← Back to blog

Pi Prompt Translate: My Open-Source Pi Coding Agent Extension for Seamless Prompt Translation

I built pi-prompt-translate to remove the friction of translating every thought into English before prompting an AI. It is open-source, MIT-licensed, and installs in seconds.

Pi Prompt Translate: My Open-Source Pi Coding Agent Extension for Seamless Prompt Translation

Pi Prompt Translate: My Open-Source Pi Coding Agent Extension for Seamless Prompt Translation

You form an idea in your native language, yet you are forced to translate it into English before feeding it to an AI coding assistant. This process creates serious cognitive overhead, especially in projects that demand rapid iteration. To solve exactly this problem, I built pi-prompt-translate for the Pi Coding Agent ecosystem. It is open-source, lightweight, and integrates transparently into your workflow.

In this post I share the motivation behind the extension, its technical architecture, how to install it, and the future roadmap. If you are a multilingual developer working with English-centric AI tools, this extension is built for you.

The Problem: Thinking in Your Native Language, Writing in English

Today, large language models and coding assistants deliver the best results with English prompts. Prompts written in Turkish, Spanish, or other languages often lead to inconsistent responses, language mixing, or loss of context. The cleanest workaround is to write everything in English, yet constantly translating your own thoughts becomes exhausting over time.

This issue does not only hurt individual productivity. In team settings, it also creates an unfair disadvantage for developers with varying levels of English proficiency. An environment where everyone can express ideas freely in their natural language leads to healthier products and faster iterations.

The Solution: pi-prompt-translate

Terminal screen with code lines

pi-prompt-translate acts as a transparent middleware layer that translates user inputs into a target language before they reach the Pi Coding Agent. It reuses the active LLM model, so no extra API key or cost is required. Written in TypeScript and released under the MIT license, it is open source on GitHub.

The core features are:

  • Seamless Integration: Intercepts and translates user input without requiring any workflow changes.
  • Smart Preservation: Code blocks, file paths, variable names, and technical terms remain untouched; only natural language is translated.
  • Active LLM Reuse: Uses your already configured model for translation, adding zero extra cost.
  • Persistent State: Toggle and language settings survive across sessions.
  • Minimal Footprint: A single-turn LLM call with no token waste.

Installation: Ready in 30 Seconds

The extension can be installed from npm, git, or a local path. The easiest route is npm:

pi install npm:pi-prompt-translate

To try it without permanently installing:

pi -e npm:pi-prompt-translate

For project-local installation:

pi install -l npm:pi-prompt-translate

After installation, three simple slash commands control the extension:

  • /translate-toggle Enables or disables translation.
  • /translate-lang <language> Sets the target language; defaults to English.
  • /translate-status Shows current status and target language.

Technical Architecture and Design Decisions

Circuit board and microprocessor detail

The extension registers an input event listener inside extensions/index.ts. When a user message arrives and the extension is enabled, the text is sent to the active LLM with a specialized system prompt that requests translation only. The model returns the translated text with no explanations or commentary. The translated message is then forwarded to the agent as if the user had typed it directly in English. Attached images are preserved and forwarded unchanged.

Three critical design decisions shaped the architecture:

  1. Loop Prevention: Messages injected by the extension itself are skipped, avoiding infinite translation loops.
  2. Graceful Degradation: If translation fails or no model is available, the original message is passed through unchanged.
  3. Minimal Prompt: The translation system prompt is carefully tuned to preserve technical content while translating only natural language.

These decisions make the extension reliable and predictable. The codebase is intentionally compact, which simplifies maintenance and encourages contributions.

Usage Scenario: A Real Example

A Spanish-speaking developer types:

Crea una funcion que sume dos numeros

The extension automatically translates this to:

Create a function that adds two numbers

The agent processes the English prompt normally and responds. The user never has to deal with manual translation or break their flow. This simple example captures the daily value the extension provides.

The Pi Coding Agent Ecosystem and Open Source

Pi Coding Agent is a lightweight and extensible AI coding assistant built by Mario Zechner. Thanks to its plugin architecture, the community can build tools tailored to their own needs. I contributed to this ecosystem by targeting a real problem that multilingual developers face every day.

Being open source increases transparency and trust. You can inspect the code, fork it for your own needs, or submit improvements. The MIT license imposes no restrictions on commercial or personal use. As developers, we understand how critical it is that the tools we rely on remain open and auditable. We frequently emphasize this in our coverage of the open-source model revolution.

If you have been following our analysis of Karpathy's autoresearch project, you can see how extensions like this amplify the capability of coding assistants. Similarly, as we highlighted in our deep dive into Small Language Models, efficient and focused tooling matters just as much as large models.

Future Work and Contributing

The extension already covers the core need, yet many areas remain for improvement:

  • Per-project language profiles.
  • Translation caching to reduce API calls.

If you would like to contribute, feel free to open an issue or pull request on the GitHub repository. Every piece of feedback, bug report, or feature suggestion is valuable.

Conclusion

pi-prompt-translate is a simple yet effective extension that lets multilingual developers interact with AI coding assistants more naturally and productively. Born from a personal pain point during my own development workflow, it became an open-source solution that I could share with the community. If you use Pi Coding Agent and want to stop worrying about prompt translation, give it a try on GitHub.

Share your thoughts after using it, and let us build a better developer experience together.

Efe Hüseyin Özkan

Software Engineer & AI Developer

Working on AI systems, full-stack development, and scalable product architecture. Follow the blog for more technical articles.