PHPackages                             devshop/github-api-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. [API Development](/categories/api)
4. /
5. devshop/github-api-cli

ActiveLibrary[API Development](/categories/api)

devshop/github-api-cli
======================

Simple console wrapper for GitHub API

2.x-dev(3y ago)233MITPHPPHP ^7.1||^8.0

Since Apr 7Pushed 1y agoCompare

[ Source](https://github.com/devshop-packages/github-api-cli)[ Packagist](https://packagist.org/packages/devshop/github-api-cli)[ Docs](https://getdevshop.com)[ RSS](/packages/devshop-github-api-cli/feed)WikiDiscussions 1.x Synced 5d ago

READMEChangelogDependencies (5)Versions (200)Used By (0)

GitHub API CLI Component
========================

[](#github-api-cli-component)

The GitHubApiCli component a simple console wrapper for the GitHub API to allow abstract command line interaction.

Built on knp-labs/github-api.

Usage
-----

[](#usage)

```
composer require devshop/github-api-cli
export GITHUB_TOKEN=aRealToken
bin/github whoami

--------------------------- ----------------------------------------------------------------
  Name                        Value
 --------------------------- ----------------------------------------------------------------
  login                       devshopbot
  id                          11931385
  node_id                     MDQ6VXNlcjExOTMxMzg1
  avatar_url                  https://avatars2.githubusercontent.com/u/11931385?v=4
  gravatar_id
  url                         https://api.github.com/users/devshopbot
  html_url                    https://github.com/devshopbot
  followers_url               https://api.github.com/users/devshopbot/followers
  following_url               https://api.github.com/users/devshopbot/following{/other_user}
  gists_url                   https://api.github.com/users/devshopbot/gists{/gist_id}
  starred_url                 https://api.github.com/users/devshopbot/starred{/owner}{/repo}
  subscriptions_url           https://api.github.com/users/devshopbot/subscriptions
  organizations_url           https://api.github.com/users/devshopbot/orgs
  repos_url                   https://api.github.com/users/devshopbot/repos
  events_url                  https://api.github.com/users/devshopbot/events{/privacy}
  received_events_url         https://api.github.com/users/devshopbot/received_events
  type                        User
  site_admin
  name                        devshopbot
  company
  blog
  location
  email
  hireable
  bio
  public_repos                2
  public_gists                0
  followers                   0
  following                   0
  created_at                  2015-04-13T20:05:05Z
  updated_at                  2020-02-28T17:13:13Z
  private_gists               0
  total_private_repos         0
  owned_private_repos         0
  disk_usage                  0
  collaborators               0
  two_factor_authentication
 --------------------------- ----------------------------------------------------------------

```

Commands
--------

[](#commands)

### `github api`

[](#github-api)

Passes directly to `GitHub\\Api\\AbstractAPI classes.

```
 ./github api me
 --------------------------- ----------------------------------------------------------------
  Name                        Value
 --------------------------- ----------------------------------------------------------------
  login                       devshopbot
  id                          11931385
  node_id                     MDQ6VXNlcjExOTMxMzg1
  avatar_url                  https://avatars2.githubusercontent.com/u/11931385?v=4
```

Only "show" works right now, but it should successfully return any object.

```
/github api user show jonpugh
 --------------------- -------------------------------------------------------------
  Name                  Value
 --------------------- -------------------------------------------------------------
  login                 jonpugh
  id                    106420
  node_id               MDQ6VXNlcjEwNjQyMA==
  avatar_url            https://avatars2.githubusercontent.com/u/106420?v=4
  gravatar_id
  url                   https://api.github.com/users/jonpugh
  html_url              https://github.com/jonpugh
  followers_url         https://api.github.com/users/jonpugh/followers

```

Load info about an organization:

```
./github api organization show department-of-veterans-affairs
 --------------------------- ------------------------------------------------------------------------------------
  Name                        Value
 --------------------------- ------------------------------------------------------------------------------------
  login                       department-of-veterans-affairs
  id                          5421563
  node_id                     MDEyOk9yZ2FuaXphdGlvbjU0MjE1NjM=
  url                         https://api.github.com/orgs/department-of-veterans-affairs
  repos_url                   https://api.github.com/orgs/department-of-veterans-affairs/repos

```

Show info about a repo:

```
./github api repo show department-of-veterans-affairs va.gov-cms
 ------------------- -----------------------------------------------------------------------------------------------------------------
  Name                Value
 ------------------- -----------------------------------------------------------------------------------------------------------------
  id                  154174777
  node_id             MDEwOlJlcG9zaXRvcnkxNTQxNzQ3Nzc=
  name                va.gov-cms
  full_name           department-of-veterans-affairs/va.gov-cms
  private
  html_url            https://github.com/department-of-veterans-affairs/va.gov-cms

```

### `github deployment:start`

[](#github-deploymentstart)

Creates a new deployment and saves the ID as a git config item.

```
bin/github deployment:start --environment=dev --description="Manual deployment triggered as an example."

```

Then use `deployment:update` to change the status.

### `github deployment:update`

[](#github-deploymentupdate)

Updates the status of a deployment.

```
bin/github deployment:update --state=in_progress --description="Building our thing..." --log_url=$OUR_BUILD_LOGS_URL

```

You can use bash operators to set different state based on exit code of a script.

Use `&&` after a command to designate a command to run on success. Use `||` after a command to designate a command to run on failure.

```
deploy.sh \
   && bin/github deployment:update --state=success --description="This deployment update will only happen if deploy.sh returns exit code 0" \
   || ( bin/github deployment:update --state=failure --description="This deployment update will only happen if deploy.sh returns exit 1." && exit 1 )

```

See The DevShop Build tests as an example

If you are using a CI runner, be sure to `exit 1` after the failure command, to ensure the overall script exits with a failure as well.

SSL Issues
----------

[](#ssl-issues)

If you encounter any SSL errors, such as the one below, you can tell the HTTPClient Library Guzzle to skip SSL verification.

```
60: SSL certificate problem: self signed certificate in certificate chain

```

All DevShop components that use the GitHub API can be configured to skip the SSL certificate verification. Set the following environment variable to ignore SSL errors:

```
export DEVSHOP_GITHUB_API_IGNORE_SSL=1

```

See [YamlTasksConsoleCommand.php](https://github.com/opendevshop/devshop/blob/1.x/src/DevShop/Component/YamlTasks/Command/YamlTasksConsoleCommand.php#L271) and [GitHubApiCli.php](https://github.com/opendevshop/devshop/blob/1.x/src/DevShop/Component/GitHubApiCli/GitHubApiCli.php) to see the implementation.

Resources
---------

[](#resources)

- [Documentation](https://github.com/opendevshop/devshop/blob/develop/README.md)
- [Contributing](https://github.com/opendevshop/devshop/blob/develop/docs/DEVELOPING.md)
- [Report issues](https://github.com/opendevshop/devshop/issues) and [send Pull Requests](https://github.com/opendevshop/devshop/pulls)in the [main DevShop repository](https://github.com/opendevshop/devshop)

Credits
-------

[](#credits)

$CREDITS

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98% 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 ~86 days

Recently: every ~0 days

Total

13

Last Release

1192d ago

Major Versions

1.8.x-dev → 2.x-dev2023-02-10

PHP version history (2 changes)1.6.0-alpha4PHP ^7.1

1.8.x-devPHP ^7.1||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/10539fb9e887c35b626eba70c97dd9d53ba14e987d4f129b55a488664a834eca?d=identicon)[jonpugh](/maintainers/jonpugh)

---

Top Contributors

[![jonpugh](https://avatars.githubusercontent.com/u/106420?v=4)](https://github.com/jonpugh "jonpugh (48 commits)")[![devshopbot](https://avatars.githubusercontent.com/u/11931385?v=4)](https://github.com/devshopbot "devshopbot (1 commits)")

### Embed Badge

![Health badge](/badges/devshop-github-api-cli/health.svg)

```
[![Health](https://phpackages.com/badges/devshop-github-api-cli/health.svg)](https://phpackages.com/packages/devshop-github-api-cli)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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