Add an "Open in IDX" button

With Project IDX, you can simplify the steps for someone new to your codebase to set up their development environment and get productive.

For example,

  • If you're working on a team with other contributors, you can customize your environment precisely for your project and then commit your .idx/dev.nix file to your project's Git repository. That way, when a teammate imports your Git repository in IDX, their new workspace will have the exact same configuration as yours, complete with the same system packages, IDE extensions, starter scripts, and more.

  • If you're building a framework or library for others to use, you can include a .idx/dev.nix file in your sample code repositories, so that when a user imports your samples into IDX, they can skip the environment setup and jump straight into trying out your framework.

Once you're happy with your environment customizations, you can make it even easier for others to import your project into IDX by adding an "Open in IDX" button to your documentation, such as your project's README.md file.

Common "Open in IDX" entry points

There are several URL patterns available for an "Open in IDX" button available:

  • To link to Import a Git repository, prefilled with your Git repository URL, use this URL pattern:

    https://idx.google.com/import?url=https://github.com/myorg/myproject
    

    At this time, only GitHub repositories are supported (both private and public).

  • To link to a predefined workspace template, find the template you're looking for in the Templates page in IDX, and copy its URL, which should follow this URL pattern:

    https://idx.google.com/new/gemini
    

Add an "Open in IDX" button

Use this tool to generate the HTML for an IDX button: