Quickstart
Get up and running with Nyron in minutes
Quickstart
This guide will help you set up Nyron in your project and create your first automated release.
Initialize Nyron
Run the initialization command to create a configuration file:
npx @nyron/cli initThis creates a nyron.config.ts file in your project root with the following structure:
import { defineConfig } from "@nyron/cli/config"
export default defineConfig({
repo: "owner/repo", // Your GitHub repo
projects: {
sdk: {
tagPrefix: "@my-package/sdk@",
path: "packages/sdk",
},
service: {
tagPrefix: "@my-package/service@",
path: "apps/service",
},
},
autoChangelog: true,
onPushReminder: true,
})Edit this file to match your project structure.
Single-Package Repository
For a single-package repo, use this simpler configuration:
import { defineConfig } from "@nyron/cli/config"
export default defineConfig({
repo: "your-org/your-repo",
projects: {
main: {
tagPrefix: "v",
path: ".",
},
},
autoChangelog: true,
onPushReminder: true,
})Setup GitHub Token (Required)
Nyron requires a GitHub token to function properly:
# Create .env in your project root
echo "GITHUB_TOKEN=your_github_token_here" > .envGenerate a token at GitHub Settings → Developer settings → Personal access tokens and ensure you check all of the following permissions:
repo(Full control of private repositories)repo:status(Access commit status)repo_deployment(Access deployment status)public_repo(Access public repositories)repo:invite(Access repository invitations)security_events(Read and write security events)
A GitHub token is required for Nyron to access repository metadata, commit information, and create releases. Be sure to select all the permissions listed above. Without the correct permissions, Nyron will not work.
Understanding Nyron Tags
Nyron uses a dual-tag system that separates version tracking from release boundaries:
Project Tags (Version Tracking)
- Format:
v1.2.0,@pkg/name@1.2.0(based on yourtagPrefixconfig) - Created by:
nyron bumpcommand - Purpose: Track package versions in your repository
- Used for: Version metadata, changelog file generation
Nyron-Release Tags (Release Boundaries)
- Format:
nyron-release@2024-01-15@14-30-25.123 - Created by:
nyron push-tagornyron releasecommand - Purpose: Mark release boundaries for GitHub releases
- Used for: Determining which commits to include in releases
Important: Nyron only uses nyron-release@* tags to determine release boundaries. Your existing tags (like v1.0.0, v2.0.0, etc.) won't interfere with Nyron, but they also won't be used as release boundaries. Nyron-release tags are completely independent of your project tag prefixes.
Starting with an Existing Repository
If your repository already has many commits and tags (e.g., 500+ commits with various version tags), here's how to get started:
Step 1: Initialize Nyron
npx @nyron/cli initEdit nyron.config.ts to match your project structure. Your existing tags won't interfere with Nyron.
Step 2: Create Your First Nyron-Release Tag
For existing repositories, you need to establish a baseline nyron-release tag. This marks where Nyron will start tracking releases from:
# First, bump your version (if needed)
npx @nyron/cli bump --type minor --prefix v
# Commit the changes
git add .
git commit -m "chore: initialize nyron"
# Create and push the first nyron-release tag
npx @nyron/cli push-tagThis creates your first nyron-release@* tag at the current HEAD. Future releases will include commits since this tag.
For existing repos: When you create your first nyron-release tag, Nyron will use all commits from that tag forward for future releases. If you want to create a release for commits that happened before this tag, you'll need to manually create a nyron-release tag at an earlier commit point first.
Step 3: Create Your First Release
After pushing your first nyron-release tag, create a release:
# Use -n flag since you already pushed the tag
npx @nyron/cli release -nThe -n flag tells Nyron to use the existing nyron-release tag you just pushed, rather than creating a new one.
Start Using Nyron
Now you're ready to use Nyron! Here's the typical workflow:
Standard Workflow (Recommended)
This workflow uses GPG-signed tags and separates tag creation from release creation:
# 1. Bump version and auto-generate changelog
npx @nyron/cli bump --type minor --prefix v
# 2. Commit your changes
git add .
git commit -m "chore: bump version to 1.2.0"
# 3. Create and push nyron-release tag (GPG-signed if configured)
npx @nyron/cli push-tag
# 4. Create GitHub release (use -n since tag already exists)
npx @nyron/cli release -nWhy use -n? The -n (or --no-tag) flag tells Nyron to use the nyron-release tag you just pushed with push-tag, rather than creating a duplicate tag. When using -n, the command fetches commits BETWEEN the previous tag and the tag you just pushed. This is especially important when:
- You want GPG-signed tags (created locally with
push-tag) - You're using CI/CD workflows that trigger on tag pushes
- You've already created a nyron-release tag manually
- You want to control exactly when tags are created
Simplified Workflow (Alternative)
If you don't need GPG-signed tags, you can let release create the tag automatically:
# 1. Bump version and auto-generate changelog
npx @nyron/cli bump --type minor --prefix v
# 2. Commit your changes
git add .
git commit -m "chore: bump version to 1.2.0"
# 3. Create GitHub release
# Note: This requires at least one existing nyron-release tag.
# After creating the release, it will create a NEW tag for the NEXT release.
npx @nyron/cli release
# 4. Push commits and tags (including the new tag created by release)
git push --follow-tagsImportant: When using release without -n, it creates a new nyron-release tag AFTER the release is published. This tag marks the boundary for the NEXT release. Make sure to push tags with git push --follow-tags or git push && git push --tags.
When to use -n: Always use -n when you've already created a nyron-release tag (with push-tag or manually). Without -n, the release command will create a new nyron-release tag AFTER the release, which marks where the NEXT release will start from.
Next Steps
Important: For the best experience with Nyron, configure your GitHub repository settings to enforce clean commit history and conventional commit format. See the GitHub repository setup guide for required settings.
- Learn about configuration options
- Explore all available commands
- Understand how Nyron works
- Read about conventional commits