Skip to content

Get started

Five commands to your first validated release. Run them inside a Git repo with a clean working tree and a remote called origin.

1. Create the config

sh
npx tagsmith@latest init

Writes .tagsmith.jsonc at the repo root. The template ships with three example targets (web, api, auth) and a full alpha → beta → rc → stable channel ladder. Edit it down to what your repo actually has.

A minimal single-target shape:

jsonc
{
  "$schema": "https://raw.githubusercontent.com/sadiksaifi/tagsmith/refs/heads/main/schema/v1.json",
  "configVersion": 1,

  "git": {
    "remote": "origin",
    "baseBranch": "main",
  },

  "defaults": {
    "tagPattern": "v{version}",
    "tagMessage": "Release {version}",
    "initialVersion": "0.0.0",
  },

  "targets": {
    "app": {
      "path": ".",
      "channels": [{ "name": "stable", "strategy": "stable" }],
    },
  },
}

When the config has exactly one target, --target is optional on tag and validate.

Editor schema

The $schema line wires JSON Schema completion in any editor that supports it. init writes it for you.

2. Check configured targets

sh
npx tagsmith@latest targets

Validates the config and target paths, then prints each target. It does not read tags, remotes, or remote refs.

3. Preview the next tag

sh
npx tagsmith@latest tag --channel stable --bump patch --dry-run --json

Runs the full preflight and skips create/push. The --json payload has the same shape as a real run with created: false, pushed: false, dryRun: true. See Output modes.

4. Create the annotated tag

Pick one. Bare creates the annotated tag locally; --push also pushes to the configured git.remote and verifies the remote tag is annotated and peels to the same commit.

sh
# Local only.
npx tagsmith@latest tag --channel stable --bump patch

# Create and push.
npx tagsmith@latest tag --channel stable --bump patch --push

Run one of these — both resolve --bump patch against managed tag history, so running the second after the first would create and push a second tag instead of pushing the first. If push or verification fails, the local tag remains and Tagsmith exits non-zero. See Git safety model.

5. Validate in CI

sh
npx tagsmith@latest validate --tag "$GITHUB_REF_NAME" --github-output

Runs the validation pipeline and writes single-line KEY=VALUE records to $GITHUB_OUTPUT after every check passes. Use the keys as inputs for downstream release jobs. See GitHub Actions for a ready-to-paste workflow.

Bump types at a glance

Channel strategy--bump major--bump minor--bump patch--bump prerelease
stable2.0.01.3.01.2.4rejected
prereleasenew X.Y.Z-<ch>.1 linenew X.Y.Z-<ch>.1 linenew X.Y.Z-<ch>.1 lineincrements N on the highest existing same-channel line

--version <semver> overrides bump and supplies the version literally. Channel shape, monotonicity, and dependsOn rules still apply. See Versioning.

What's next

Released under the MIT License.