Noureddine RAMDI / mex: CLI tool for AI prompt and codebase synchronization

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

theDakshJaitly/mex

mex tackles a familiar developer headache: keeping your AI prompts aligned with your evolving codebase. If you use AI-assisted coding tools, you know how quickly prompts can get out of sync as your project changes. mex offers a CLI-driven solution to automate prompt generation, detect drift, and fix inconsistencies, improving your AI tooling workflow.

What mex does and how it’s built

mex is a command-line tool published as an npm package named promexeus, exposing a CLI command called mex. It’s implemented in TypeScript, designed for Node.js environments, and focuses on automating AI prompt management tied to your codebase.

Under the hood, mex creates a local scaffold directory .mex/ when you run the setup command. This scaffold contains the necessary metadata and prompt templates that mex generates by pre-scanning your codebase. During setup, mex asks which AI tool you use (e.g., OpenAI, Claude, etc.) to tailor the generated prompt and workflow accordingly.

The architecture is straightforward: a CLI interface drives the workflow, interacting with your project files to analyze and generate AI prompts that stay targeted and relevant. mex doesn’t handle AI inference itself; instead, it manages the prompt lifecycle around your existing AI tools, acting as a glue layer between your code and AI-driven development.

This design choice keeps mex lightweight and focused on a specific pain point—prompt drift—without reinventing AI tooling or adding complex AI runtime components. By integrating closely with your source files, mex aims to keep your AI prompts synchronized with your code changes over time.

Why mex’s prompt drift management matters

Developers using AI tools often struggle with the problem of prompt drift: as your code evolves, the prompts you feed to AI models can become outdated, leading to irrelevant or incorrect suggestions. mex addresses this by scanning your project to generate a “drift score” that quantifies how out-of-sync your AI prompt is with your current code.

The CLI exposes two key commands after setup:

  • mex check: Calculates and reports the drift score, helping you understand if your AI prompt needs updating.
  • mex sync: Fixes the drift by updating the prompt and any related metadata to realign with your current codebase.

This workflow lets you maintain prompt relevance proactively. The tradeoff is that initial setup takes a few minutes to scan your code and generate the prompt scaffold, and you must adopt mex’s conventions and prompt format. However, for teams relying heavily on AI-assisted development, this upfront cost can save time and frustration later.

The code quality and developer experience seem solid from the README and repo structure. The interactive setup guides you through configuration, minimizing manual steps. The CLI commands are clear and well scoped, focusing on the core problem without bloat.

One limitation is that mex currently supports only AI tools it recognizes during setup, so integration with new or custom AI providers may require updates. Also, it doesn’t provide AI generation itself, so it’s complementary rather than a full AI development platform.

Quick start with mex

Getting started with mex is simple. The core setup command creates the .mex/ scaffold in your project, scans your codebase, and generates a targeted prompt based on your AI tool choice. This takes about five minutes.

Run:

npx promexeus setup

After setup, mex suggests installing itself globally for convenience. You can then check your prompt drift or fix it:

mex check        # drift score
mex sync         # fix drift

If you prefer not to install globally, you can run the commands via npx:

npx promexeus check        # drift score
npx promexeus sync         # fix drift

You can install mex globally anytime with:

npm install -g promexeus

This straightforward CLI approach means you can integrate mex into your existing workflow with minimal friction.

Verdict

mex is a pragmatic tool for developers using AI-assisted coding who want to keep their AI prompts in sync with rapidly changing codebases. Its TypeScript CLI offers an automated way to generate, check, and fix prompt drift, improving the reliability of AI suggestions.

It’s most relevant for teams and individuals who rely on AI tools for code generation, refactoring, or assistance and who have experienced the frustration of prompt staleness. The upfront setup time and conventions are tradeoffs for more sustainable prompt maintenance.

mex does not replace AI models or inference engines; it’s a complementary tool that manages the prompt lifecycle, making it easier to maintain a high-quality AI-assisted development workflow. If you’re integrating AI deeply into your dev process, mex is worth exploring.


→ GitHub Repo: theDakshJaitly/mex ⭐ 699 · TypeScript