Changelog Command

View release notes and changelogs for specific packages directly in your terminal. cli-changelog.png

Usage

whatsdiff changelog <package> <?version> [options]

Arguments

  • <package> - Package name (e.g., symfony/console for Composer, react for npm)
  • [version] - Optional version or version range (e.g., 5.1.0 or 5.0.0...5.1.0)

Options

You can filter by changes mad in your project:

  • --from=FROM - Git commit, branch, or tag to get the starting version from
  • --to=TO - Git commit, branch, or tag to get the ending version from (defaults to HEAD)
  • --ignore-last - Ignore last uncommitted changes

Or if you want a changelog for a specific package even outside of your project:

  • -t, --type=TYPE - Specify package manager type (composer or npm)

Other options:

  • -f, --format=FORMAT - Output format: text (default), json, or markdown
  • -s, --summary - Show summarized changelog (combines all releases into one view)
  • --no-cache - Disable caching for this request
  • --include-prerelease - Include pre-release versions (beta, alpha, RC, etc.)

Two Modes of Operation

The changelog command works in two distinct modes depending on how you use it:

Inside a Project (Git-Based)

When you run the command inside a git repository with lock files:

whatsdiff changelog symfony/console

The command:

  • Detects the package in your composer.lock or package-lock.json
  • Automatically determines version changes from your git history
  • Compares the current version with the previous version in your commits
  • Perfect for reviewing changes after composer update or npm update

Outside a Project (Direct Query)

When you want to check any package's changelog without having it in your project:

whatsdiff changelog symfony/console --type=composer
whatsdiff changelog react --type=npm

The command:

  • Queries the package registry directly (Packagist or npm)
  • Requires the --type flag to specify the package manager
  • You can specify exact versions or ranges
  • Useful for researching packages before adding them to your project

Output Formats

The changelog command supports three output formats that can be selected with the --format option.

Text Format (Default)

Human-readable format with clear sections for each release:

whatsdiff changelog guzzlehttp/guzzle 7.8.1 --type=composer

Output:

Release Notes
--------------------------------------------------------------------------------

7.8.1 - Release 7.8.1
Date: 2023-12-03
URL: https://github.com/guzzle/guzzle/releases/tag/7.8.1

Changes:
  • Updated links in docs to their canonical versions
  • Replaced `call_user_func*` with native calls

--------------------------------------------------------------------------------

JSON Format

Structured data format perfect for automation and CI/CD pipelines:

whatsdiff changelog guzzlehttp/guzzle 7.8.1 --type=composer --format=json

Output:

{
    "total_releases": 1,
    "releases": [
        {
            "tag_name": "7.8.1",
            "title": "Release 7.8.1",
            "date": "2023-12-03T20:36:10Z",
            "url": "https://github.com/guzzle/guzzle/releases/tag/7.8.1",
            "body": "### Changed\r\n\r\n- Updated links in docs to their canonical versions\r\n- Replaced `call_user_func*` with native calls\r\n",
            "changes": [
                "Updated links in docs to their canonical versions",
                "Replaced `call_user_func*` with native calls"
            ],
            "fixes": [],
            "breaking_changes": []
        }
    ]
}

Markdown Format

Formatted markdown ready to copy into documentation:

whatsdiff changelog guzzlehttp/guzzle 7.8.1 --type=composer --format=markdown

Output:

# Release Notes

## 7.8.1 - Release 7.8.1

**Date:** 2023-12-03
**URL:** https://github.com/guzzle/guzzle/releases/tag/7.8.1

### Changes
- Updated links in docs to their canonical versions
- Replaced `call_user_func*` with native calls

Summary View

Use the --summary flag to aggregate changes across multiple releases:

whatsdiff changelog guzzlehttp/guzzle 7.7.0...7.8.1 --type=composer --summary

Output:

Release Notes Summary
--------------------------------------------------------------------------------

Total Releases: 3

Changes:
  • Updated links in docs to their canonical versions
  • Replaced `call_user_func*` with native calls
  • Added support for PHP 8.3
  • Improved error handling for network timeouts
  • Fixed issue with header parsing

--------------------------------------------------------------------------------

This is useful for getting a quick overview of all changes without the detail of individual releases.

Examples

Show Changelog for Latest Version

Display the changelog for the most recent version change in your lock file:

whatsdiff changelog symfony/console

This automatically detects the version from your composer.lock and shows the release notes.

Specific Version

View the changelog for a specific version release:

whatsdiff changelog laravel/framework 11.0.0

Version Range

See all release notes between two versions:

whatsdiff changelog symfony/console 6.0.0...6.4.0

Between Git Commits of your project

Compare package versions between two commits:

whatsdiff changelog doctrine/orm --from=abc123 --to=def456

Or between a previous commit and current state:

whatsdiff changelog guzzlehttp/guzzle --from=v1.0.0

Different Output Formats

Export changelog in different formats (see Output Formats section for examples):

# Markdown format (great for documentation)
whatsdiff changelog react --format=markdown

# JSON format (useful for automation)
whatsdiff changelog symfony/console --format=json

# Summary view (aggregated changelog)
whatsdiff changelog symfony/console --summary

Get changelog for any package even outside your project

If the package isn't in your lock files or you want to force a specific registry:

whatsdiff changelog react --type=npm
whatsdiff changelog symfony/mailer --type=composer

Option: Include Pre-releases

By default, pre-release versions are excluded. To include them:

whatsdiff changelog laravel/framework --include-prerelease

Use Cases

1. Review Changes Before Upgrading

Before running composer update, check what's new:

# See what's changed in the latest Laravel release
whatsdiff changelog laravel/framework

# Review all changes in a major version upgrade
whatsdiff changelog symfony/console 6.0.0...7.0.0

2. Understand Breaking Changes

Quickly identify breaking changes when debugging after an update:

whatsdiff changelog symfony/http-kernel --summary

The summary view aggregates all changes, making it easier to spot breaking changes.

3. Generate Release Notes

Extract changelogs for your own release documentation:

whatsdiff changelog doctrine/orm --format=markdown > release-notes.md

4. Code Review - Understand PR Dependencies

When reviewing a pull request that updates dependencies:

# Switch to the PR branch
git checkout feature/update-deps

# View changelogs for updated packages
whatsdiff changelog laravel/framework
whatsdiff changelog livewire/livewire

5. Audit Historical Changes

Investigate what changed in dependencies between production releases:

whatsdiff changelog symfony/security-core --from=v2.0.0 --to=v3.0.0

6. CI/CD Integration or Other tools

Use the JSON output for automation in scripts:

#!/bin/bash
echo "Dependency changelogs for this deployment:"
whatsdiff changelog laravel/framework --format=json > deployment-changes.json

Related Commands

  • Use analyse to see all dependency changes in your project
  • Use between to compare all dependencies between commits
  • Use tui for an interactive view with integrated changelog browsing
  • Use check to verify if a specific package changed