CLI Commands Reference
Overview
Section titled “Overview”The Nagare CLI provides commands for release management, version control, and project initialization. All commands support both interactive and non-interactive modes.
Synopsis
Section titled “Synopsis”nagare [command] [arguments] [options]nagare release [bumpType] [options]nagare rollback [version] [options]nagare retry [version] [options]nagare init [options]Description
Section titled “Description”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.
Commands
Section titled “Commands”release {#release}
Section titled “release {#release}”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:
# Auto-determine version bump from commitsnagare release
# Force specific version bumpnagare release minor
# Preview without making changesnagare release --dry-run
# Non-interactive modenagare release patch --skip-confirmationrollback {#rollback}
Section titled “rollback {#rollback}”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:
# Rollback to specific versionnagare rollback 1.2.0
# Rollback by tagnagare rollback v1.2.0
# Rollback last release (interactive)nagare rollback
# Preview rollback changesnagare rollback 1.2.0 --dry-runretry {#retry}
Section titled “retry {#retry}”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:
# Retry specific versionnagare retry 1.2.3
# Retry last tagged versionnagare retry
# With custom confignagare retry 1.2.3 --config ./custom-nagare.config.tsinit {#init}
Section titled “init {#init}”Arguments: None Description: Initialize Nagare in current directory
Creates initial setup including:
nagare-launcher.tsfor local execution.nagare.config.tswith example configuration.- Optional AI auto-fix configuration.
- Suggested deno.json task entries.
Examples:
# Initialize projectnagare init
# Initialize with custom languagenagare init --lang jaOptions
Section titled “Options”--help / -h {#help}
Section titled “--help / -h {#help}”Display comprehensive help information including usage examples and configuration guidance.
Example:
nagare --help--version / -v {#version}
Section titled “--version / -v {#version}”Display Nagare version number.
Example:
nagare --version# Output: Nagare v2.9.1--version-detailed {#version-detailed}
Section titled “--version-detailed {#version-detailed}”Display detailed version information including build info and release notes.
Example:
nagare --version-detailedOutput includes:
- Application metadata (name, description, repository)
- Build information (date, commit, environment)
- Release notes for current version
- Runtime information (Deno, V8, TypeScript versions)
--version-json {#version-json}
Section titled “--version-json {#version-json}”Output version information as structured JSON for programmatic access.
Example:
nagare --version-json | jq .nagare.version--config / -c {#config}
Section titled “--config / -c {#config}”Type: string Description: Path to custom configuration file
Override default configuration file location.
Example:
nagare release --config ./custom-nagare.config.ts--dry-run {#dry-run}
Section titled “--dry-run {#dry-run}”Type: boolean Description: Preview changes without applying them
Shows what would be changed without modifying files or creating commits.
Example:
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:
# Non-interactive releasenagare release patch --skip-confirmation
# Automated rollbacknagare rollback 1.2.0 -y--log-level {#log-level}
Section titled “--log-level {#log-level}”Type: string
Values: DEBUG, INFO, WARN, ERROR
Description: Set logging verbosity
Control the amount of output during operations.
Example:
# Debug mode for troubleshootingnagare release --log-level DEBUG
# Quiet mode for scriptsnagare release --log-level ERROR--lang {#lang}
Section titled “--lang {#lang}”Type: string
Values: en, ja
Description: Set language for messages
Override language detection for CLI output.
Example:
# Use Japanese messagesnagare release --lang ja
# Force Englishnagare init --lang enExit Codes
Section titled “Exit Codes”| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error (validation, git state, etc.) |
| 2 | Configuration error |
| 3 | File operation error |
Configuration Files
Section titled “Configuration Files”Nagare looks for configuration in these locations (in order):
- Path specified with
--config ./nagare.config.ts./nagare.config.js./release.config.ts./.nagarerc.ts
Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
NAGARE_DEBUG | Enable debug output | false |
NAGARE_LANG | Default language | System locale |
NAGARE_LOCALE | Alternative to NAGARE_LANG | System locale |
GITHUB_TOKEN | GitHub authentication | None |
CI | CI environment flag | Auto-detected |
Workflow Examples
Section titled “Workflow Examples”Standard Release Workflow
Section titled “Standard Release Workflow”# 1. Check current statusgit status
# 2. Preview releasenagare release --dry-run
# 3. Perform releasenagare release
# 4. Push changesgit push && git push --tagsCI/CD Automation
Section titled “CI/CD Automation”# In GitHub Actions or similarnagare release --skip-confirmation --log-level INFOEmergency Rollback
Section titled “Emergency Rollback”# 1. Identify problematic versionnagare --version-detailed
# 2. Preview rollbacknagare rollback 2.0.0 --dry-run
# 3. Perform rollbacknagare rollback 2.0.0
# 4. Push rollbackgit pushFailed Release Recovery
Section titled “Failed Release Recovery”# When CI fails after tag creation# 1. Clean up failed releasenagare retry 1.2.3
# 2. Fix issues# ... make necessary fixes ...
# 3. Retry with same versionnagare release patch --skip-confirmationShebang Execution
Section titled “Shebang Execution”The CLI can be executed directly with proper permissions:
#!/usr/bin/env deno run --allow-read --allow-write --allow-run --allow-net
# Make executablechmod +x cli.ts
# Run directly./cli.ts releaseRequired Permissions
Section titled “Required Permissions”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:
deno run -A cli.ts releaseCommon Issues
Section titled “Common Issues”Git State Errors
Section titled “Git State Errors”Problem: “Git working directory not clean”
Solution: Commit or stash changes before release
git add .git commit -m "chore: prepare for release"nagare releaseConfiguration Not Found
Section titled “Configuration Not Found”Problem: “No configuration file found”
Solution: Run init or create config manually
nagare init# Edit nagare.config.tsnagare releaseVersion Conflict
Section titled “Version Conflict”Problem: “Version already exists”
Solution: Use retry command to clean up
nagare retry 1.2.3Advanced Usage
Section titled “Advanced Usage”Custom Version File Updates
Section titled “Custom Version File Updates”# With custom update function in confignagare release --dry-run # Preview custom updatesnagare release # Apply updatesMulti-Language Projects
Section titled “Multi-Language Projects”# Switch languages per commandnagare release --lang ennagare rollback --lang jaDebug Failed Releases
Section titled “Debug Failed Releases”# Maximum verbositynagare release --log-level DEBUG --dry-run > debug.log 2>&1See also
Section titled “See also”- Configuration Reference - All configuration options
- Template Reference - Template syntax and variables
- Getting Started Guide - Initial setup
- Troubleshooting Guide - Common problems and solutions