Ragex.CLI.EditorConfig (Ragex v0.17.2)

View Source

Editor configuration generator for AI code editors.

Generates the correct MCP configuration file for each supported editor, pointing to the ragex-mcp binary. Respects existing config files by merging rather than overwriting.

Supported Editors

EditorConfig PathFormat
Claude Code.mcp.jsonJSON
Cursor.cursor/mcp.jsonJSON
VS Code.vscode/settings.jsonJSON merge
Zed.zed/settings.jsonJSON merge
Gemini.gemini/settings.jsonJSON
NeoVim/LunarVim.nvim-mcp.jsonJSON
OpenCode.opencode.jsonJSON
Warp(uses Warp's native MCP)--

Summary

Functions

Returns info for all supported editors.

Detect which editors have config files present in the project directory.

Returns a list of editor keys (atoms) for selection menus.

Generate and write the MCP config for a specific editor.

Generate configs for all detected editors in the project.

Functions

all_editors()

@spec all_editors() :: map()

Returns info for all supported editors.

detect_editors(project_dir)

@spec detect_editors(String.t()) :: [{atom(), map()}]

Detect which editors have config files present in the project directory.

Returns a list of {editor_key, editor_info} tuples.

editor_choices()

@spec editor_choices() :: [{String.t(), atom()}]

Returns a list of editor keys (atoms) for selection menus.

generate(editor, project_dir, opts \\ [])

@spec generate(atom(), String.t(), keyword()) :: {:ok, String.t()} | {:error, term()}

Generate and write the MCP config for a specific editor.

Options

  • :force -- overwrite existing config (default false)
  • :ragex_bin -- path to ragex-mcp binary (auto-detected)
  • :project_dir -- project root (default: cwd)

Returns

{:ok, path} with the written config path, or {:error, reason}.

generate_all(project_dir, opts \\ [])

@spec generate_all(
  String.t(),
  keyword()
) :: map()

Generate configs for all detected editors in the project.

Returns a map of %{editor => {:ok, path} | {:error, reason}}.