PHPackages                             mglaman/drupalorg-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. mglaman/drupalorg-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

mglaman/drupalorg-cli
=====================

Command line interface for interacting with Drupal.org

0.10.2(1mo ago)1611.8k35[39 issues](https://github.com/mglaman/drupalorg-cli/issues)[7 PRs](https://github.com/mglaman/drupalorg-cli/pulls)GPL-2.0-or-laterPHPPHP ^8.1CI passing

Since Feb 13Pushed 3w ago3 watchersCompare

[ Source](https://github.com/mglaman/drupalorg-cli)[ Packagist](https://packagist.org/packages/mglaman/drupalorg-cli)[ GitHub Sponsors](https://github.com/mglaman)[ Fund](https://ko-fi.com/mglaman)[ RSS](/packages/mglaman-drupalorg-cli/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (10)Dependencies (36)Versions (69)Used By (0)

Drupal.org CLI
--------------

[](#drupalorg-cli)

[![Latest Stable Version](https://camo.githubusercontent.com/e26351aed561e1a53361987cff0ea25f0d063d5c0177a9775d3787403b0e0f5c/68747470733a2f2f706f7365722e707567782e6f72672f6d676c616d616e2f64727570616c6f72672d636c692f762f737461626c65)](https://packagist.org/packages/mglaman/drupalorg-cli) [![Total Downloads](https://camo.githubusercontent.com/6ccd0c6839be0d1f38b8eab346b62d72fd933e9155ad70300b1758ba75d09512/68747470733a2f2f706f7365722e707567782e6f72672f6d676c616d616e2f64727570616c6f72672d636c692f646f776e6c6f616473)](https://packagist.org/packages/mglaman/drupalorg-cli) [![Latest Unstable Version](https://camo.githubusercontent.com/1729664d4a1a480990e8a16d901144e76a1911811704bfd39abce9f249648c9a/68747470733a2f2f706f7365722e707567782e6f72672f6d676c616d616e2f64727570616c6f72672d636c692f762f756e737461626c65)](https://packagist.org/packages/mglaman/drupalorg-cli) [![License](https://camo.githubusercontent.com/7ac9bdaed1f4a361cbdb544cd6f277adf6d50a29243bead9122141ce5ee012da/68747470733a2f2f706f7365722e707567782e6f72672f6d676c616d616e2f64727570616c6f72672d636c692f6c6963656e7365)](https://packagist.org/packages/mglaman/drupalorg-cli)

A command line tool for interfacing with Drupal.org and GitLab (git.drupalcode.org). Uses the Drupal.org REST API and GitLab REST API.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher, with cURL support
- [Git](https://git-scm.com/) - Currently required to apply and create patches. Very useful for contributing patches back to an issue.

Installation
------------

[](#installation)

### Installing manually

[](#installing-manually)

1. Download the `drupalorg.phar` file from the [latest release](https://github.com/mglaman/drupalorg-cli/releases/latest).

    ```
    curl -OL https://github.com/mglaman/drupalorg-cli/releases/latest/download/drupalorg.phar
    ```
2. Rename the file to `drupalorg`, ensure it is executable, and move it into a directory in your PATH (use `echo $PATH` to see your options).

    ```
    chmod +x drupalorg.phar
    mv drupalorg.phar /usr/local/bin/drupalorg
    ```
3. Run `drupalorg` and verify you can see the list of available commands.

### Installing via Composer (deprecated)

[](#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

[](#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

[](#installing-zsh-completion)

`drupalorg` comes with namespace-aware completion out of the box. If [`jq`](https://jqlang.org/) 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 `is` and `pi`
- positional argument placeholders such as ``

In those placeholders, angle brackets mean the argument is required, and square brackets mean it is optional. For example, `` 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
--------

[](#updating)

Automatic updating is not yet supported. You will need to manually download new releases.

Usage
-----

[](#usage)

Use the 'list' command to see available commands.

```
drupalorg list

```

Commands
--------

[](#commands)

```
Available commands:
  help                      Display help for a command
  list                      List commands
 issue
  issue:apply               Applies the latest patch from an issue.
  issue:branch              Creates a branch for the issue.
  issue:checkout            Check out a branch from the GitLab issue fork.
  issue:get-fork            Show the GitLab issue fork URLs and branches.
  issue:interdiff           Generate an interdiff for the issue from committed local changes.
  issue:link                Opens an issue
  issue:patch               Generate a patch for the issue from committed local changes.
  issue:search        [is]  Searches issues for a project by title keyword.
  issue:setup-remote        Add the GitLab issue fork as a git remote and fetch it.
  issue:show                Show a given issue information.
 maintainer
  maintainer:issues   [mi]  Lists issues for a user, based on maintainer.
  maintainer:release-notes  [rn|mrn] Generate release notes.
 mcp
  mcp:config                Output the Claude Desktop MCP configuration snippet.
  mcp:serve                 Start a Model Context Protocol server over stdio.
 mr
  mr:diff                   Show the unified diff for a merge request.
  mr:files                  List changed files in a merge request.
  mr:list            [mrl]  List merge requests for a Drupal.org issue fork or project.
  mr:logs                   Show failed job traces from the latest pipeline for a merge request.
  mr:status                 Show the pipeline status for a merge request.
 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 the drupalorg-cli discovery skill into .claude/skills/ in the current directory.
  skill:get                 Outputs current skill content for agent consumption.

```

GitLab work items
-----------------

[](#gitlab-work-items)

Some Drupal.org projects have migrated their issue queues to GitLab work items at `git.drupalcode.org`. These projects are detected automatically via `field_project_has_issue_queue` on the project node.

**`project:issues`** fetches from the GitLab API instead of Drupal.org for these projects.

The following commands accept a work item reference in place of a Drupal.org issue NID:

```
# Full URL
drupalorg issue:show https://git.drupalcode.org/project/ai_context/-/work_items/3586157

# Explicit path
drupalorg issue:show project/ai_context#3586157

# Shorthand (project/ prefix assumed)
drupalorg issue:show ai_context#3586157
```

The same formats work for `issue:get-fork` and `mr:list`. MR URLs also work directly:

```
drupalorg mr:list https://git.drupalcode.org/project/ai_context/-/merge_requests/131
```

AI agent skills
---------------

[](#ai-agent-skills)

`drupalorg-cli` ships with skills for Claude Code and other AI agents that support the [skills format](https://agentskills.io/home).

### Install via [npx skills](https://www.skills.sh/)

[](#install-via-npx-skills)

```
npx skills add mglaman/drupalorg-cli
```

### Install via the CLI

[](#install-via-the-cli)

Run this inside your Drupal project directory:

```
drupalorg skill:install
```

Both methods install a discovery stub into `.claude/skills/drupalorg-cli/`. The stub tells agents to call `drupalorg skill:get` for current instructions, so skills never go stale between releases.

### Available skills

[](#available-skills)

SkillDescription`drupalorg-cli`Full CLI reference — commands, output formats, error handling`drupalorg-work-on-issue`End-to-end GitLab MR contribution workflow`drupalorg-issue-search`Search issues across API, Drupal.org scrape, and web`drupalorg-issue-summary-update`Analyse and draft updated issue summariesFetch any skill on demand:

```
drupalorg skill:get drupalorg-cli
drupalorg skill:get drupalorg-work-on-issue
```

Getting Started
---------------

[](#getting-started)

### Working with project issues

[](#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
------------

[](#contributing)

### Installing and running from source

[](#installing-and-running-from-source)

1. Clone the repository
2. In the drupalorg-cli directory, run `composer install`
3. Run the script with `./drupalorg`

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance89

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 64.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Recently: every ~14 days

Total

33

Last Release

41d ago

PHP version history (4 changes)v0.0.7PHP &gt;=5.6.0

v0.1.0PHP &gt;=7.2

0.3.0PHP ^7.4 || ^8.0

0.5.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c03d4d2a6aa9b5ecdfc565e8f90f53f0a8f6c2757048a148b34b166d78266c?d=identicon)[mglaman](/maintainers/mglaman)

---

Top Contributors

[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (240 commits)")[![violinist-bot](https://avatars.githubusercontent.com/u/27495990?v=4)](https://github.com/violinist-bot "violinist-bot (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (36 commits)")[![hansfn](https://avatars.githubusercontent.com/u/92755?v=4)](https://github.com/hansfn "hansfn (17 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (7 commits)")[![truls1502](https://avatars.githubusercontent.com/u/913581?v=4)](https://github.com/truls1502 "truls1502 (6 commits)")[![damienmckenna](https://avatars.githubusercontent.com/u/429?v=4)](https://github.com/damienmckenna "damienmckenna (5 commits)")[![jhedstrom](https://avatars.githubusercontent.com/u/76833?v=4)](https://github.com/jhedstrom "jhedstrom (3 commits)")[![daggerhart](https://avatars.githubusercontent.com/u/1205329?v=4)](https://github.com/daggerhart "daggerhart (3 commits)")[![jameswilson](https://avatars.githubusercontent.com/u/243532?v=4)](https://github.com/jameswilson "jameswilson (2 commits)")[![malcomio](https://avatars.githubusercontent.com/u/428782?v=4)](https://github.com/malcomio "malcomio (2 commits)")[![smmccabe](https://avatars.githubusercontent.com/u/4956338?v=4)](https://github.com/smmccabe "smmccabe (2 commits)")[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (1 commits)")[![dpi](https://avatars.githubusercontent.com/u/21850?v=4)](https://github.com/dpi "dpi (1 commits)")[![manuee](https://avatars.githubusercontent.com/u/105582?v=4)](https://github.com/manuee "manuee (1 commits)")[![marvil07](https://avatars.githubusercontent.com/u/73675?v=4)](https://github.com/marvil07 "marvil07 (1 commits)")[![normanlolx](https://avatars.githubusercontent.com/u/3585653?v=4)](https://github.com/normanlolx "normanlolx (1 commits)")[![plopesc](https://avatars.githubusercontent.com/u/161282?v=4)](https://github.com/plopesc "plopesc (1 commits)")[![theodorosploumis](https://avatars.githubusercontent.com/u/1315321?v=4)](https://github.com/theodorosploumis "theodorosploumis (1 commits)")[![andyg5000](https://avatars.githubusercontent.com/u/1800052?v=4)](https://github.com/andyg5000 "andyg5000 (1 commits)")

---

Tags

clidrupal

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mglaman-drupalorg-cli/health.svg)

```
[![Health](https://phpackages.com/badges/mglaman-drupalorg-cli/health.svg)](https://phpackages.com/packages/mglaman-drupalorg-cli)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.5k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19664.8M1.6k](/packages/drupal-core)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.2k](/packages/infection-infection)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M526](/packages/shopware-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
