Skip to content

CLI Commands Reference

The Nagare CLI provides commands for release management, version control, and project initialization. All commands support both interactive and non-interactive modes.

Terminal window
nagare [command] [arguments] [options]
nagare release [bumpType] [options]
nagare rollback [version] [options]
nagare retry [version] [options]
nagare init [options]

Nagare’s CLI interface manages semantic versioning releases following conventional commits. It handles version bumping, changelog generation, git tagging, and optional GitHub release creation. The CLI requires Deno runtime due to file system and process APIs.

Aliases: Default command when none specified
Arguments: [bumpType] - Optional: major, minor, or patch
Description: Create a new release with automatic or manual version bump

Performs a full release cycle including:

  • Analyzing commits to determine version bump (if not specified)
  • Updating version files and configured files
  • Generating changelog entries
  • Creating git commit and tag
  • Optionally creating GitHub release

Examples:

Terminal window
# Auto-determine version bump from commits
nagare release
# Force specific version bump
nagare release minor
# Preview without making changes
nagare release --dry-run
# Non-interactive mode
nagare release patch --skip-confirmation

Arguments: [version|tag] - Version number or git tag to rollback
Description: Rollback to a previous release by version or tag

Reverses a release by:

  • Restoring previous file states from git history
  • Removing git tags (local and remote)
  • Optionally deleting GitHub release
  • Creating rollback commit

Examples:

Terminal window
# Rollback to specific version
nagare rollback 1.2.0
# Rollback by tag
nagare rollback v1.2.0
# Rollback last release (interactive)
nagare rollback
# Preview rollback changes
nagare rollback 1.2.0 --dry-run

Arguments: [version] - Version to retry
Description: Retry a failed release

Retries a release that failed during CI/CD by:

  • Cleaning up existing tags (local and remote)
  • Pulling latest changes
  • Re-running release process for specified version

Examples:

Terminal window
# Retry specific version
nagare retry 1.2.3
# Retry last tagged version
nagare retry
# With custom config
nagare retry 1.2.3 --config ./custom-nagare.config.ts

Arguments: None Description: Initialize Nagare in current directory

Creates initial setup including:

  • nagare-launcher.ts for local execution.
  • nagare.config.ts with example configuration.
  • Optional AI auto-fix configuration.
  • Suggested deno.json task entries.

Examples:

Terminal window
# Initialize project
nagare init
# Initialize with custom language
nagare init --lang ja

Display comprehensive help information including usage examples and configuration guidance.

Example:

Terminal window
nagare --help

Display Nagare version number.

Example:

Terminal window
nagare --version
# Output: Nagare v2.9.1

Display detailed version information including build info and release notes.

Example:

Terminal window
nagare --version-detailed

Output includes:

  • Application metadata (name, description, repository)
  • Build information (date, commit, environment)
  • Release notes for current version
  • Runtime information (Deno, V8, TypeScript versions)

Output version information as structured JSON for programmatic access.

Example:

Terminal window
nagare --version-json | jq .nagare.version

Type: string Description: Path to custom configuration file

Override default configuration file location.

Example:

Terminal window
nagare release --config ./custom-nagare.config.ts

Type: boolean Description: Preview changes without applying them

Shows what would be changed without modifying files or creating commits.

Example:

Terminal window
nagare release minor --dry-run

--skip-confirmation / -y {#skip-confirmation}

Section titled “--skip-confirmation / -y {#skip-confirmation}”

Type: boolean Description: Skip confirmation prompts for automation

Essential for CI/CD pipelines and automated workflows.

Example:

Terminal window
# Non-interactive release
nagare release patch --skip-confirmation
# Automated rollback
nagare rollback 1.2.0 -y

Type: string
Values: DEBUG, INFO, WARN, ERROR
Description: Set logging verbosity

Control the amount of output during operations.

Example:

Terminal window
# Debug mode for troubleshooting
nagare release --log-level DEBUG
# Quiet mode for scripts
nagare release --log-level ERROR

Type: string
Values: en, ja
Description: Set language for messages

Override language detection for CLI output.

Example:

Terminal window
# Use Japanese messages
nagare release --lang ja
# Force English
nagare init --lang en
CodeDescription
0Success
1General error (validation, git state, etc.)
2Configuration error
3File operation error

Nagare looks for configuration in these locations (in order):

  1. Path specified with --config
  2. ./nagare.config.ts
  3. ./nagare.config.js
  4. ./release.config.ts
  5. ./.nagarerc.ts
VariableDescriptionDefault
NAGARE_DEBUGEnable debug outputfalse
NAGARE_LANGDefault languageSystem locale
NAGARE_LOCALEAlternative to NAGARE_LANGSystem locale
GITHUB_TOKENGitHub authenticationNone
CICI environment flagAuto-detected
Terminal window
# 1. Check current status
git status
# 2. Preview release
nagare release --dry-run
# 3. Perform release
nagare release
# 4. Push changes
git push && git push --tags
Terminal window
# In GitHub Actions or similar
nagare release --skip-confirmation --log-level INFO
Terminal window
# 1. Identify problematic version
nagare --version-detailed
# 2. Preview rollback
nagare rollback 2.0.0 --dry-run
# 3. Perform rollback
nagare rollback 2.0.0
# 4. Push rollback
git push
Terminal window
# When CI fails after tag creation
# 1. Clean up failed release
nagare retry 1.2.3
# 2. Fix issues
# ... make necessary fixes ...
# 3. Retry with same version
nagare release patch --skip-confirmation

The CLI can be executed directly with proper permissions:

#!/usr/bin/env deno run --allow-read --allow-write --allow-run --allow-net
# Make executable
chmod +x cli.ts
# Run directly
./cli.ts release

Nagare requires these Deno permissions:

  • --allow-read: Read configuration and source files
  • --allow-write: Update version files and create commits
  • --allow-run: Execute git commands
  • --allow-net: Create GitHub releases (optional)

For convenience, use --allow-all or -A:

Terminal window
deno run -A cli.ts release

Problem: “Git working directory not clean”
Solution: Commit or stash changes before release

Terminal window
git add .
git commit -m "chore: prepare for release"
nagare release

Problem: “No configuration file found”
Solution: Run init or create config manually

Terminal window
nagare init
# Edit nagare.config.ts
nagare release

Problem: “Version already exists”
Solution: Use retry command to clean up

Terminal window
nagare retry 1.2.3
Terminal window
# With custom update function in config
nagare release --dry-run # Preview custom updates
nagare release # Apply updates
Terminal window
# Switch languages per command
nagare release --lang en
nagare rollback --lang ja
Terminal window
# Maximum verbosity
nagare release --log-level DEBUG --dry-run > debug.log 2>&1