How to Configure Local Development Mode with GO_MODERN_GUIDELINES_DEV=1

Set the environment variable GO_MODERN_GUIDELINES_DEV=1 before launching your AI agent to force it to load the CLI binary from your local checkout instead of the released version.

The JetBrains/go-modern-guidelines repository supports hot-reloading local changes during development through a dedicated environment flag. When enabled, agents like Junie, Claude Code, or Cursor execute the CLI from the cache directory at ~/.cache/go-modern-guidelines, allowing immediate testing of modifications to internal/cli/cli.go without waiting for official releases.

How GO_MODERN_GUIDELINES_DEV=1 Works

The local development mode intercepts the agent's normal binary resolution logic. Instead of downloading or referencing the production release, the agent checks for the presence of the GO_MODERN_GUIDELINES_DEV environment variable. When set to 1, the system routes all CLI invocations to the cached binary built from your current working directory.

This mechanism relies on two components in the repository:

  • scripts/dev-install.sh – Compiles the local source and copies the binary into ~/.cache/go-modern-guidelines
  • Makefile – Provides the dev-install and dev-uninstall convenience targets that wrap the shell script

Enabling Local Development Mode

Follow these steps to configure your environment for local development and testing.

Build the Local CLI

First, compile the current checkout and install it into the cache directory. Run the provided Make target:

make dev-install

This executes scripts/dev-install.sh, which builds the binary from internal/cli/cli.go and places it in ~/.cache/go-modern-guidelines where the agent can locate it.

Export the Environment Variable

Before starting your AI agent, export the development flag in your shell:

export GO_MODERN_GUIDELINES_DEV=1

Ensure this variable is present in the process environment that launches the agent. You can verify it with:

echo $GO_MODERN_GUIDELINES_DEV

Launch the Agent

Start your preferred agent while the environment variable is active:

junie

# Or: claude, cursor, codex, etc.

The agent now loads the CLI from your local cache instead of the official release binary.

Iterating During Development

After modifying source files—such as those in internal/cli/cli.go—rebuild the cached binary to apply changes:

make dev-install

The next agent invocation automatically picks up the new build. This cycle allows rapid iteration without reconfiguring the environment, as the GO_MODERN_GUIDELINES_DEV=1 flag remains set across terminal sessions until explicitly unset.

Disabling Local Development Mode

To return to the released binary, either unset the environment variable or remove the cached build entirely.

Option 1: Unset the variable in your current session:

unset GO_MODERN_GUIDELINES_DEV

Option 2: Remove the cached binary using the Makefile:

make dev-uninstall

This deletes the local build from ~/.cache/go-modern-guidelines, forcing the agent to revert to the standard release version on next launch.

Summary

Configuring GO_MODERN_GUIDELINES_DEV=1 enables rapid local development of the Go Modern Guidelines CLI by redirecting agent invocations to a cached binary built from source.

  • Build locally using make dev-install to compile internal/cli/cli.go into ~/.cache/go-modern-guidelines
  • Activate development mode by exporting GO_MODERN_GUIDELINES_DEV=1 before launching agents such as Junie or Claude Code
  • Iterate quickly by rebuilding with make dev-install after each code change; the agent picks up changes immediately
  • Revert cleanly by running make dev-uninstall or unsetting the environment variable to restore the released binary

Frequently Asked Questions

What does GO_MODERN_GUIDELINES_DEV=1 actually do?

When set to 1, this environment variable signals the agent to bypass the released CLI binary and instead execute the version stored in ~/.cache/go-modern-guidelines. This allows developers to test modifications to internal/cli/cli.go and other source files immediately without publishing a new release.

Where is the local CLI binary stored?

The make dev-install command compiles the project and copies the binary to ~/.cache/go-modern-guidelines. The scripts/dev-install.sh script handles the actual file placement and permissions, ensuring the agent can locate and execute the cached build.

Do I need to restart the agent after rebuilding?

No. The agent reads the binary from the cache directory on each invocation. After running make dev-install to update the cached build, the next request to the agent automatically uses the new code. You only need to restart the agent if you modify the environment variable itself.

How do I verify the agent is using my local build?

Check that GO_MODERN_GUIDELINES_DEV=1 is set in the agent's environment, then inspect the cache directory to confirm the binary timestamp matches your recent make dev-install execution. If the variable is unset or the cache is empty, the agent falls back to the standard released binary.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →