CONR: Code Only, No Repo

A Golang module packaging tool that clones your repos, filters code, and streams zip files for each tagged module.

CONR helps developers assemble valid Go module zip archives without fuss— you specify the repositories, conr handles ephemeral clones, tag checkouts, and filtering.

Contents

1. Quick Start

Install CONR, then run one command to produce a Go module zip:

# Install conr
go install code.nicktrevino.com/conr/cmd/conr@latest
conr --mod ./cool-module --outDir ./dist --clean

Within ./dist, you’ll see a structured output for each discovered tag, including zip archives (.zip) and accompanying metadata (.mod, .info). This matches Go’s official module layout so that downstream tooling recognizes it.

2. Features

3. How It Works

CONR clones your repo, enumerates v* tags, then checks each out in turn, copying relevant Go source files into a streamed zip. We also build go.mod-like files (.mod), version info (.info), and a list of tags, all structured in @v subdirectories. Finally, @latest is updated to the newest version.

Workflow Outline

  1. Clone: Provide --mod for each repo or path. CONR clones them into fresh temp directories.
  2. Tag Discovery: We gather Git tags beginning with v (e.g. v1.2.3), then sort them.
  3. Checkout & Packaging: For each tag, the tool checks out the commit, includes/excludes the right files, and zips them up as Go module archives.
  4. Metadata Prep: We generate list (containing all discovered tags), @latest, .mod, and .info so that Go tooling sees a valid module structure.
  5. Cleanup: Once done, the temporary clone is removed, leaving your local machine clutter-free.

4. Advanced Usage

5. Internals

6. Q&As

Why "Code Only, No Repo"?

Does it replace standard Git usage entirely?

Not exactly. We rely on Git under the hood, but CONR automates and abstracts the process of checking out tags, filtering, and archiving the code.

How does this compare to gopack or similar tools?

Some existing tools like gopack also offer packaging functionalities. The key differences with CONR are: