PHPackages                             servergrove/sgcli - 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. servergrove/sgcli

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

servergrove/sgcli
=================

ServerGrove CLI

613[1 PRs](https://github.com/servergrove/sgcli/pulls)PHP

Since Jan 17Pushed 13y ago3 watchersCompare

[ Source](https://github.com/servergrove/sgcli)[ Packagist](https://packagist.org/packages/servergrove/sgcli)[ RSS](/packages/servergrove-sgcli/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ServerGrove Control Panel Command Line Interface (CLI)
======================================================

[](#servergrove-control-panel-command-line-interface-cli)

The utility allows interaction with the ServerGrove Control Panel through the command line. It also provides an interactive shell.

The following command line tools are provided:

- API client Command Line Interface
- Interactive Shell

The API client CLI allows to connect to the ServerGrove Control Panel through a HTTP API. To connect to the API you will need to be a registered customer with access to the Control Panel and API, and you will need to enable API access in the user profile.

Installation:
-------------

[](#installation)

You will need PHP 5.3

Download [`sgcli.phar`](https://github.com/servergrove/sgcli/raw/master/sgcli.phar) executable and place it in a directory in your PATH.

Make sure sgcli.phar has executable permissions or use with php sgcli.phar

Configuration:
--------------

[](#configuration)

By default, the API client will use our demo API secret/key combination. This only lets you runs some tests against the server but it won't allow you to access your account and servers.

You will need to enable API access in your user profile in

Once you have the API key and secret, add it to your environment variables:

```
Example:
	$ export SG_API_KEY=yourkey
	$ export SG_API_SECRET=yoursecret

```

- For \*nix add these two lines to your user's ~/.profile

Usage:
------

[](#usage)

```
./sgcli.phar client call [args]

```

- call: call composed of namespace and action (ie. server/list)
- args: (optional) list of variables to send to the call (ie. serverId=abc123&amp;isActive=0)

Example:
--------

[](#example)

```
./sgcli.phar client test/version
./sgcli.phar client server/list
./sgcli.phar client server/stop serverId=abc123

```

Interactive shell:
------------------

[](#interactive-shell)

```
./sgcli.phar shell

```

Commands:

- help/h/? - list commands
- servers - list servers
- server \[option\] - selects a server from the servers list. option can be an numeric option from the list or a server name. A partial name can also be provided and it will select the first match
- exec cmd - executes a command in the selected server
- reboot \[server\] - reboots a server. \[server\] is optional. If not given it will use the selected server. It will ask for confirmation before proceding
- shutdown \[server\] - shuts down a server. \[server\] is optional. If not given it will use the selected server. It will ask for confirmation before proceding
- bootup \[server\] - boots up a server. \[server\] is optional. If not given it will use the selected server
- domains - list domains under selected server
- domain \[option\] - selects a domain from the domains list. option can be an numeric option from the list or a domain name. A partial name can also be provided and it will select the first match
- apps - list apps under selected server
- app \[option\] - selects a app from the apps list. option can be an numeric option from the list or a app name. A partial name can also be provided and it will select the first match
- restart \[app\] - restarts an application. \[app\] is optional. If not given it will use the selected app. It will ask for confirmation before proceding
- stop \[app\] - restarts an application. \[app\] is optional. If not given it will use the selected app. It will ask for confirmation before proceding
- start \[app\] - restarts an application. \[app\] is optional. If not given it will use the selected app
- . - runs the last command again
- x - resets internal selections
- exit/quit - exits shell

WARNING
-------

[](#warning)

**Notice:** The API is still under heavy development, so things MAY change. Please be aware of this.

More information:
-----------------

[](#more-information)

- [List of available API calls and parameters](https://control.servergrove.com/docs/api)
- [ServerGrove Website](http://www.servergrove.com/)
- [ServerGrove Blog](http://blog.servergrove.com/)
- [ServerGrove Control Panel](https://control.servergrove.com/)
- [ServerGrove Knowledge Base](https://secure.servergrove.com/clients)
- [Follow ServerGrove @ Twitter](http://twitter.com/servergrove)
- [GitHub Downloads](http://github.com/servergrove)

TODO &amp; Contributions
------------------------

[](#todo--contributions)

We have a bunch of features we want to add. If you have any cool ideas feel free to send us suggestions or even Pull Requests. This is a Github project, so anybody can fork it and extend it!

We love PRs!

Credits
-------

[](#credits)

- Fabien Potencier for the awesome Symfony Components.
- The Composer team for inspiration on the Application code and the phar file compiler.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/05f6e92a30f69a12acbdcd7602d53ebac895ff467d9434d5c3b37e592198b6b5?d=identicon)[pgodel](/maintainers/pgodel)

---

Top Contributors

[![pgodel](https://avatars.githubusercontent.com/u/18968?v=4)](https://github.com/pgodel "pgodel (15 commits)")[![raulfraile](https://avatars.githubusercontent.com/u/595160?v=4)](https://github.com/raulfraile "raulfraile (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")

### Embed Badge

![Health badge](/badges/servergrove-sgcli/health.svg)

```
[![Health](https://phpackages.com/badges/servergrove-sgcli/health.svg)](https://phpackages.com/packages/servergrove-sgcli)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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