Publish Your Package

By the end of this page, palette is live on the registry and anyone can depend on it.

Flock's whole publishing contract is an org and a token:

  • an org — the namespace your package lives under (you set this in flock.toml on the last page),
  • a token — proof that you're allowed to publish to that org.

Step 1 — Sign in and create a token

Go to the account page and Sign in with GitHub. On your first sign-in the registry creates a personal organization matching your GitHub username — that's your namespace, and you're its owner.

On the account page, click New token. The token is shown once and looks like flock_…. Copy it now.

Step 2 — Save the token

Flock reads your token from ~/.kestrel/credentials, or from the FLOCK_TOKEN environment variable:

mkdir -p ~/.kestrel echo "flock_your_token_here" > ~/.kestrel/credentials

Treat it like a password — never commit it. You can revoke or rotate tokens anytime from the account page.

Step 3 — Confirm your org

You added org to flock.toml on the previous page. It has to be a namespace you can publish to — your personal org (your GitHub username) or a shared org you belong to:

[package] name = "palette" version = "0.1.0" org = "your-name"

FLOCK_ORG overrides the manifest value for a one-off or CI publish.

Step 4 — Publish

flock publish

Flock archives your package, generates API docs from your /// comments (the ones you wrote on the last page), and uploads both. You'll see something like:

wrote 1 modules, 7 items (Json)/tmp/flock-docs-palette-0.1.0 Publishing your-name/palette@0.1.0 to https://registry.kestrel-lang.com... {"ok":true,"checksum":"sha256:…"} Uploading documentation... {"ok":true}

The {"ok":true, …} is the registry confirming the upload.

Step 5 — See it live

Your package now has a page at kestrel-lang.com/flock/your-name/palette — the version, the README, and the doc comments you wrote, rendered as API reference. Anyone can depend on it now, which is the next page.

Versions are immutable

A published version can never be overwritten. Run flock publish again at the same version and the registry refuses it:

{"error":"Version already exists"}

To ship a change you bump the version — that's Ship a New Version.

Troubleshooting

Flock prints the registry's raw response, so failures show up as a short message or JSON:

You seeMeaningFix
No auth token found.no credentialssave a token to ~/.kestrel/credentials, or set FLOCK_TOKEN
No org specified.no namespaceadd org to [package], or set FLOCK_ORG
{"error":"Invalid token"}token is wrong or revokedmint a new one on the account page
{"error":"Not a member of this organization"}you're not in that orgpublish under your own org, or ask an owner to add you
{"error":"Version already exists"}that version is takenbump version

Next: Depend on It — pull palette into another project and use it.