mglaman / drupalorg-cli
Command line interface for interacting with Drupal.org
Requires
- php: ^8.1
- composer-runtime-api: ^2.0.0
- ext-dom: *
- ext-json: *
- caseyamcl/guzzle_retry_middleware: ^2.13
- consolidation/self-update: ^3.1
- czproject/git-php: ^4.1
- dg/rss-php: ^1.2
- guzzlehttp/guzzle: ^6.1 || ^7.3
- jolicode/jolinotif: ^2.3
- mcp/sdk: ^0.4
- psr/log: ^3.0
- symfony/console: ^6.0 || ^7.0
- symfony/process: ^6.0 || ^7.0
Requires (Dev)
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.0.0
- phpstan/phpstan-deprecation-rules: ^1.0.0
- phpstan/phpstan-strict-rules: ^1.0.0
- phpstan/phpstan-symfony: ^1.0.0
- phpunit/phpunit: ^10.1
- squizlabs/php_codesniffer: ^4.0
- dev-main
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.1
- 0.4.0
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- v0.2.0
- v0.1.1
- v0.1.0
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-copilot/make-mr-iid-optional
- dev-copilot/automatically-select-branch-in-checkout
- dev-copilot/allow-specifying-issue-type
- dev-copilot/fix-latest-comments-fetch
- dev-copilot/add-prompt-for-setup-remote
- dev-fix/306-install-drupalorg-issue-summary-update-skill
- dev-improve-drupal-work-on-issue-skill
- dev-feature/issue-290-with-comments
- dev-issue/273-skill-md-skill-install
- dev-issue-272-llm-output-formatters
- dev-issue-277-get-issue-action
- dev-issue/276-action-result-interfaces
- dev-phar-version
- dev-copilot/support-semantic-version-branches
- dev-fix/deprecated-set-output-github-actions
- dev-claude-files
- dev-update-symfony
- dev-new-commit-format
- dev-remove-ppv
- dev-gh-48
- dev-hackathon
- dev-mrn-change-records
- dev-phar
- dev-travis
This package is auto-updated.
Last update: 2026-04-22 01:53:46 UTC
README
A command line tool for interfacing with Drupal.org. Uses the Drupal.org REST API.
Requirements
- PHP 8.1 or higher, with cURL support
- Git - Currently required to apply and create patches. Very useful for contributing patches back to an issue.
Installation
Installing manually
-
Download the
drupalorg.pharfile from the latest release.curl -OL https://github.com/mglaman/drupalorg-cli/releases/latest/download/drupalorg.phar
-
Rename the file to
drupalorg, ensure it is executable, and move it into a directory in your PATH (useecho $PATHto see your options).chmod +x drupalorg.phar mv drupalorg.phar /usr/local/bin/drupalorg
-
Run
drupalorgand verify you can see the list of available commands.
Installing via Composer (deprecated)
Use the following command to install the command line tool via Composer:
composer global require mglaman/drupalorg-cli
Installing (Bash) completion
drupalorg comes with completion support for all commands, excluding options.
To activate it, either source the completion file or add it to the system-wide completion directory, normally /etc/bash_completion.d/.
In your .bashrc (or .profile) add
source [...]/vendor/mglaman/drupalorg-cli/drupalorg-cli-completion.bash
Installing (Zsh) completion
drupalorg comes with namespace-aware completion out of the box. If jq is installed, the Zsh completion script upgrades itself to use drupalorg list --format=json once per shell session and can complete:
- commands and namespace-prefixed commands
- documented long and short options (i.e. flags)
- command aliases such as
isandpi - positional argument placeholders such as
<nid>
In those placeholders, angle brackets mean the argument is required, and square brackets mean it is optional. For example, <nid> is required and [nid] is optional.
Without jq, the script falls back to the original command and namespace completion behavior.
Copy the Zsh completion file to ~/.zsh/completions/_drupalorg:
mkdir -p ~/.zsh/completions curl -L https://raw.githubusercontent.com/mglaman/drupalorg-cli/refs/heads/main/drupalorg-cli-completion.zsh -o ~/.zsh/completions/_drupalorg
In your ~/.zshrc add (if not already present):
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit
compinit
Restart your shell or run source ~/.zshrc.
Updating
Automatic updating is not yet supported. You will need to manually download new releases.
Usage
Use the 'list' command to see available commands.
drupalorg list
Commands
Available commands:
help Displays help for a command
list Lists commands
cache
cache:clear (cc) Clears caches
issue
issue:apply Applies the latest patch from an issue.
issue:branch Creates a branch for the issue.
issue:interdiff Generate an interdiff for the issue from local changes.
issue:link Opens an issue
issue:patch Generate a patch for the issue from committed local changes.
maintainer
maintainer:issues (mi) Lists issues for a user, based on maintainer.
maintainer:release-notes (rn, mrn) Generate release notes.
project
project:issues (pi) Lists issues for a project.
project:kanban Opens project kanban
project:link Opens project page
project:release-notes (prn) View release notes for a release
project:releases Lists available releases
skill
skill:install Installs all drupalorg-cli agent skills into .claude/skills/ in the current directory.
Getting Started
Working with project issues
If you want to use this to generate patches that you can contribute back to a Drupal project, it's best to work within a cloned repo of that project. To get instructions for cloning a project's repo, visit the "Version Control" tab on the project page.
From within the directory of the project we're working on:
drupalorg issue:apply [issue number]- Create a new branch for the given issue, apply the latest patch on the issue to the new branch, then commit the changes locally.drupalorg issue:patch [issue number]- Create a new patch for the given issue from the changes committed locally.
Contributing
Installing and running from source
- Clone the repository
- In the drupalorg-cli directory, run
composer install - Run the script with
./drupalorg