---
title: "Publishing a package"
description: "A package is a git repository, and a version is a tag — what to do so another project can depend on yours."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.atoll.workreef.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Publishing a package

There is no registry and nothing to upload. **A package is a git repository,
its module path says where the repository is, and a version is a tag.** To
publish one, push the repository and tag a release; to depend on one,
`atoll add` its module path.

## 1. Name it after where it lives

The module path is the repository's address without the scheme:
`github.com/acme/forms` is fetched from `https://github.com/acme/forms`. Give
the package that path when you make it:

```sh
atoll new github.com/acme/forms --lib
```

```toml
# forms/atoll.toml
module = "github.com/acme/forms"
version = "0.1.0"
atoll-version = ">=0.1"
edition = "2026"
```

`atoll-version` is the range of `atoll` releases that can build the package; an
`atoll` outside it refuses it by name.

## 2. Decide what it offers

What a package importing yours can use is what you mark `pub` — see
[Visibility](https://docs.atoll.workreef.dev/language/modules/visibility/). Everything else is free to change
in any release. Write a `///` doc comment on each `pub` item, and read the
result as a user will:

```sh
atoll doc            # writes target/doc/, one page per file
atoll test           # its tests, from the `_test.at` files
```

## 3. Tag a release

A version is a `vX.Y.Z` tag on the commit it names. Before tagging, ask what
changed since the last one; `atoll api diff` classifies each change in the
public surface as major, minor or patch and checks the `version` in
`atoll.toml` against it:

```sh
atoll api diff v1.2.0              # since the last release
git commit -am "forms 1.3.0"
git tag v1.3.0
git push && git push --tags
```

The manifest at a tag must state the version the tag does, or none. **A
published version does not change:** a project that locked `v1.3.0` records the
commit it named, and if the tag is later moved to other code, its next build
refuses it rather than follow — publish the change as `v1.3.1`.

## 4. Depend on it

```sh
atoll add github.com/acme/forms
```

`atoll add` reads the repository's tags, writes the newest as a requirement —
`"github.com/acme/forms" = "^1.3"` — and refuses a module whose repository it
cannot read or that has no version the requirement admits, before it writes
anything. `atoll.lock` then records the version, the commit and a digest, and a
version moves only under `atoll update`. One version of each module serves the
whole build: the highest every requirement allows.

A module whose path is not where it lives names its repository:

```sh
atoll add example.dev/forms --git https://git.example.com/forms.git
```

## Major versions

A new major version is a new module path: `github.com/acme/forms/v2`, with
`v2.x.y` tags in the same repository. While the repository's root is still 1.x,
the 2.x package lives in its `v2/` directory. A project can depend on both, and
each is its own module.

## Private repositories and mirrors

Atoll fetches with git, so git's own setup is all a private repository needs —
an SSH key or a credential helper. To fetch a module path from somewhere else,
point it there with `url.<base>.insteadOf` in your git configuration.

## While you are working on both

A package you are changing alongside the one that uses it is a path
dependency until it is ready to tag:

```sh
atoll add github.com/acme/forms --path ../forms
```

[Projects](https://docs.atoll.workreef.dev/language/modules/projects/#dependency-forms) lists every
dependency form and what `atoll.lock` records for each.

Source: https://docs.atoll.workreef.dev/language/modules/publishing/index.mdx
