Moderne Documentation

website·Indexed 34 days ago

https://docs.moderne.io

Administrator documentation for Moderne DX and Moderne Platform, covering large-scale code insights, repository ingestion, recipe management, and connector configurations for GitHub, GitLab, and Azure DevOps. Includes guides on telemetry exports, architecture, and using the Moderne CLI for build trace analysis.

Tokens
1.1M
Snippets
4.3K
Records
8.9K
Agent score
66%

What's inside Moderne

  1. Overview of Moderne Trigrep

    Moderne Trigrep provides fast, indexed code search across an entire codebase, delivering sub-second search times even across thousands of repositories. It operates within a Moderne organization, allowing searches to be scoped to specific business units, teams, or application portfolios. It supports Sourcegraph query syntax and Comby structural patterns. Unlike traditional grep, it uses trigram indexes derived from Lossless Semantic Trees (LSTs) to provide structural awareness, enabling filters by symbol type, visibility, inheritance relationships, return types, and thrown exceptions.
  2. Overview of C# refactoring recipes

    C# refactoring recipes use OpenRewrite to perform precise, type-aware changes across large codebases. They operate on a Lossless Semantic Tree (LST), which preserves exact formatting and provides type attribution for every element. C# recipes build upon the Java LST; shared constructs (method invocations, identifiers, etc.) are found in the J namespace, while C#-specific constructs are in the Cs namespace. Most recipes are implemented declaratively using structural patterns (CSharpPattern) and templates (CSharpTemplate) to match and replace code.
  3. Overview of Moderne MCP server components

    The mod mcp server consists of several internal components that handle code analysis, search, and recipe execution. Key components include:

    • MCP server: Handles MCP protocol messages via stdin/stdout.
    • LST manager: Orchestrates Lossless Semantic Tree (LST) builds (Gradle, Maven, etc.) and watches for changes.
    • Trigram indexer: Maintains a zoekt-based search index.
    • Recipe runner: Executes OpenRewrite recipes and writes results to the filesystem and local .csv.gz DataTable files.
    • Recipe-DSL engine: Compiles and runs Kotlin recipe-DSL (pattern_replace) for structural edits without AI inference.
    • Transcript watcher: Monitors AI client conversation transcripts to record tool usage observations in a local CSV.
  4. Overview of Moderne CLI (mod) commands

    The mod CLI is used for automated code remediation and managing Lossless Semantic Tree (LST) artifacts. Key capabilities include:

    • LST Management: build (generate artifacts), publish (upload to platform), prebuild (extract metadata), and clean (remove artifacts).
    • Recipe Execution: run (execute OpenRewrite recipes locally) and run-history (view recent runs).
    • Repository Operations: git (multi-repo git ops), list (list buildable repos), and search (trigram index search).
    • AI Agent Integration: Integration with tools like Amp, Claude Code, Codex, GitHub Copilot, Cursor, Kiro, and Windsurf for deterministic multi-repository work.
    • Diagnostics & Config: doctor (verify environment), config (global settings), and login (authenticate with Moderne).
    mod --version
  5. Overview of Moderne Mass Run

    Mass run is a central worker (or set of workers) that utilizes the Moderne CLI to execute recipes across all organization repositories at scale. It is primarily used by central teams and business unit leaders to extract org-wide insights via search recipes, deploy critical security fixes, and generate reports or DevCenter dashboards.
  6. Overview of the Moderne mass ingest process

    Mass ingest is a scheduled pipeline (typically running daily) that builds and publishes Lossless Semantic Tree (LST) artifacts to a user-controlled artifact repository. This ensures all repositories remain current, including those that rarely change or those whose dependencies have changed. The process is executed via the Moderne CLI command mod publish --sync-csv using a repos.csv file as the source list.
  7. Overview of Moderne DX

    Moderne DX is a "platform development kit" that allows organizations to perform large-scale code insights and remediations in air-gapped or highly secure environments. Unlike the Moderne Platform, DX requires users to manage their own access control and drive the creation of reports. It provides the same LST (Lossless Semantic Tree) building and recipe running capabilities as the SaaS platform but keeps all code and data under the organization's own security controls.
  8. Overview of the Moderne mass ingest process

    Mass ingest is a scheduled pipeline (typically running once per day) that ensures all repositories remain current by building and publishing Lossless Semantic Tree (LST) artifacts to a user-controlled artifact repository. This approach is recommended over CI-integrated builds to capture repositories that rarely build or those with dependency changes despite no code changes.

    For each repository listed in a repos.csv file, the Moderne CLI performs the following steps:

    1. Clones the repository.
    2. Builds the LST.
    3. Publishes the LST to the artifact repository.
    4. Records the result in a repos-lock.csv file.
    5. Deletes the checkout before moving to the next repository.

    To optimize performance, the CLI skips repositories if the repos-lock.csv indicates the current remote HEAD has already been built by the same CLI version and the build was reproducible. Bazel repositories and repositories with previous failures are always rebuilt.

  9. Overview of Python refactoring recipes

    Python refactoring recipes are used to make consistent, type-aware changes across large codebases (e.g., renaming deprecated functions or swapping imports). They operate on a Lossless Semantic Tree (LST), which preserves exact formatting and provides type attribution for every element.

    Each recipe is a class that defines a name, display name, and description, and provides a visitor via the editor() method. The visitor traverses the LST and returns modified nodes to effect changes; unchanged nodes are preserved exactly as they were.

  10. Overview of Code Remix Weekly sessions

    Code Remix is a weekly live session hosted by Moderne and OpenRewrite. These sessions cover the latest product changes, community Q&A, and deep dives into specific technical topics such as automated refactoring, AI agents, and language migrations. Sessions are streamed and archived on YouTube.
  11. Overview of JavaTemplate for LST construction

    JavaTemplate is used in OpenRewrite to parse textual code snippets into Lossless Semantic Tree (LST) elements. This allows developers to avoid the tedious manual construction of complex LST elements. The resulting LSTs are correctly formatted, fully type-attributed, and can reference symbols from the lexical scope of insertion.
  12. Overview of Moddy AI agent

    Moddy is a multi-repo AI agent (currently in restricted beta) integrated into the Moderne Platform. It combines natural language processing with the accuracy and scalability of Moderne and OpenRewrite to analyze and modify large, complex codebases. It can identify and execute OpenRewrite recipes based on natural language prompts, such as upgrading to a specific framework version or understanding library usage across thousands of repositories and organizations.