PHPackages                             sven/forge-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. sven/forge-cli

Abandoned → [laravel/forge-cli](/?search=laravel%2Fforge-cli)ArchivedLibrary[CLI &amp; Console](/categories/cli)

sven/forge-cli
==============

A set of commands to interact with your Laravel Forge servers, sites, and more

v0.5.0(6y ago)6369613MITPHPPHP ^7.2

Since Apr 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/svenluijten/forge-cli)[ Packagist](https://packagist.org/packages/sven/forge-cli)[ RSS](/packages/sven-forge-cli/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (14)Used By (0)

[![forge-cli](https://cloud.githubusercontent.com/assets/11269635/24330714/fdfddfaa-1224-11e7-8f84-f1b4efa7a8b7.jpg)](https://cloud.githubusercontent.com/assets/11269635/24330714/fdfddfaa-1224-11e7-8f84-f1b4efa7a8b7.jpg)

Forge CLI
=========

[](#forge-cli)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2b4ecb762c1b942bd22ecf2b69cc989837b7640ad3f2945209647baa2ff6d1c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7376656e2f666f7267652d636c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/forge-cli)[![Total Downloads](https://camo.githubusercontent.com/822b22cf5acc0fdd13fe7dcf2c469a4c7452e63d555c8d7332a5c72479e4b207/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7376656e2f666f7267652d636c692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/forge-cli)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://github.com/svenluijten/forge-cli/workflows/Tests%20(PHP)/badge.svg)](https://github.com/svenluijten/forge-cli/actions?query=workflow%3ATests%20(PHP))[![StyleCI](https://camo.githubusercontent.com/968991b134b3c0a8c3a927a0152c5d05f96df7ff150355c9efc3eae5cc99369a/68747470733a2f2f7374796c6563692e696f2f7265706f732f38353830343330302f736869656c64)](https://styleci.io/repos/85804300)

---

⚠️ Notice
---------

[](#️-notice)

**This package is abandoned**: Use [the official `laravel/forge-cli`](https://github.com/laravel/forge-cli) instead.
--------------------------------------------------------------------------------------------------------------------

[](#this-package-is-abandoned-use-the-official-laravelforge-cli-instead)

Interact with your [Laravel Forge](https://forge.laravel.com) servers and sites via the command line with this package. Create and list servers, add sites, and install repositories all without leaving the comfort of your command line. An overview of all available commands can be found [here](#usage).

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

[](#installation)

Via [composer](http://getcomposer.org):

```
$ composer global require sven/forge-cli
```

Setup
-----

[](#setup)

Ensure Composer's global `bin` directory is included in your path. This directory is located at `~/.composer/vendor/bin` on macOS / Linux, and at `%APPDATA%/Composer/vendor/bin` on Windows.

Before using the commands, you have to provide an API token. To generate a new token, visit [this page](https://forge.laravel.com/user/profile#/api), give the token a name (like `ForgeCLI`) and click "Create new token".

Then, execute the following command on the command line:

```
$ forge authorize
```

When prompted for it, paste in your API key. You may optionally pass in the key directly as an argument to the command:

```
$ forge authorize
```

If the API key on your Forge account changed, you'll need to run the same command again. A hidden configuration file will be saved to your home directory (`~/.forge.json` on macOS / Linux, `%USERPROFILE%/.forge.json` on Windows).

Usage
-----

[](#usage)

A list of commands with their explanation can be found below. You can also find a list of commands and their arguments by installing the package and running `forge list` or `forge help {command}`.

---

### Servers

[](#servers)

#### server:list

[](#serverlist)

Show all servers associated with your account.

```
$ forge server:list

+----------------+--------+----------------+-------------+-------+
| Name           | Id     | IP Address     | Region      | Ready |
+----------------+--------+----------------+-------------+-------+
| sparkling-reef | 124833 | 95.85.60.157   | Amsterdam 2 | Yes   |
+----------------+--------+----------------+-------------+-------+
```

#### server:show

[](#servershow)

Show information about one of your servers.

```
$ forge server:show {serverId}

Name:        sparkling-reef
IP Address:  95.85.60.157
Size:        512MB
Region:      Amsterdam 2
PHP version: php71
Created:     2017-03-13 20:59:16
```

#### server:make

[](#servermake)

Create a new server.

```
$ forge server:make
    --provider=ocean2
    --credentials={credentialId}
    --region=ams2
    --ip=127.0.0.1
    --private-ip=192.168.1.1
    --php=php71
    --database=some_database
    --install-maria
    --load-balancer
    --network={otherServerId}
    --network={anotherServerId}
```

#### server:update

[](#serverupdate)

Update the metadata on one of your servers. This will only update the data in Forge, it won't make any actual changes to your server.

```
$ forge server:update {serverId}
    --name=sluggish-cheetah
    --size=1GB
    --ip=127.0.0.1
    --private-ip=192.168.1.1
    --max-upload-size=256
    --network={otherServerId}
    --network={anotherServerId}
```

#### server:reboot

[](#serverreboot)

Reboot one of your servers. You will need to confirm your action.

```
$ forge server:reboot {serverId}
```

#### server:delete

[](#serverdelete)

Delete an existing server. You will need to confirm your action.

```
$ forge server:delete {serverId}
```

---

### Sites

[](#sites)

#### site:list

[](#sitelist)

Show all sites installed on a server.

```
$ forge site:list {serverId}

+--------+-----------------+------+-----------------------------+--------+
| Id     | Name            | Type | Repository                  | Branch |
+--------+-----------------+------+-----------------------------+--------+
| 303243 | default         | php  | -                           | -      |
| 303246 | svenluijten.com | html | svenluijten/svenluijten.com | master |
| 303247 | pkgst.co        | php  | svenluijten/slack-packagist | master |
+--------+-----------------+------+-----------------------------+--------+
```

#### site:show

[](#siteshow)

Show information about a site on a specified server.

```
$ forge site:show {serverId} {siteId}

Name:            svenluijten.com
Repository info: svenluijten/svenluijten.com @ master
Directory:       /build_production
Quick deploy:    Off
Status:          installed
Project type:    html
Created:         2017-03-13 21:14:19
```

#### site:make

[](#sitemake)

Create a new site on one of your servers. Use `--alias` to include one or more additional domains.

```
$ forge site:make {serverId}
    --domain=example.com
    --alias=example.org
    --alias=another-site.net
    --type=php
    --directory=/public
```

#### site:update

[](#siteupdate)

Update a site on a specified server.

```
$ forge site:update {serverId} {siteId}
    --directory=/html
```

#### site:deploy

[](#sitedeploy)

Deploy the given site.

```
$ forge site:deploy {serverId} {siteId}
```

#### site:delete

[](#sitedelete)

Delete a site. You will need to confirm your action.

```
$ forge site:delete {serverId} {siteId}
```

---

### Services

[](#services)

#### service:reboot

[](#servicereboot)

Reboot a service on the given server. Supported services are `nginx`, `mysql`, and `postgres`.

```
$ forge service:reboot {serverId} {service}
```

#### service:stop

[](#servicestop)

Stop a service on the given server. Supported services are `nginx`, `mysql`, and `postgres`.

```
$ forge service:stop {serverId} {service}
```

#### service:install

[](#serviceinstall)

Install a service on the given server. Supported services are `blackfire` and `papertrail`. The `--host` option is only required when installing Papertrail, `--server-id` and `--server-token` are only required when installing Blackfire.

```
$ forge service:install {serverId} {service}
    --host=192.168.1.1
    --server-id=12345
    --server-token=YOUR_SERVER_TOKEN
```

#### service:uninstall

[](#serviceuninstall)

Uninstall a service from the given server. Supported services are `blackfire` and `papertrail`.

```
$ forge service:uninstall {serverId} {service}
```

---

### Daemons

[](#daemons)

#### daemon:list

[](#daemonlist)

List all active daemons on the given server.

```
$ forge daemon:list {serverId}

+-------+------------+---------------------------------+---------------------+
| Id    | Status     | Command                         | Created             |
+-------+------------+---------------------------------+---------------------+
| 12345 | installing | echo 'hello world' >> /dev/null | 2017-03-13 21:14:19 |
+-------+------------+---------------------------------+---------------------+
```

#### daemon:show

[](#daemonshow)

Show information about the given daemon.

```
$ forge show:daemon {serverId} {daemonId}

Status:  installing
Command: echo 'hello world' >> /dev/null
Created: 2017-03-21 18:26:33
```

#### daemon:make

[](#daemonmake)

Create a new daemon to run on the given server. If no user is supplied, it defaults to `forge`.

```
$ forge make:daemon {serverId}
    --command="command to run"
    --user=root
```

#### daemon:reboot

[](#daemonreboot)

Reboot the given daemon. You will need to confirm your action.

```
$ forge reboot:daemon {serverId} {daemonId}
```

#### daemon:delete

[](#daemondelete)

Delete the given daemon from the given server. You will need to confirm your action.

```
$ forge delete:daemon {serverId} {daemonId}
```

---

### MySQL Users

[](#mysql-users)

#### mysql-user:make

[](#mysql-usermake)

Create a new MySQL user with access to the given databases.

```
$ forge mysql-user:make {serverId}
    --username="your_username"
    --password="password"
    --database=456
    --database=789
```

#### mysql-user:list

[](#mysql-userlist)

List all MySQL users on the given server.

```
$ forge mysql-user:list {serverId}

+-------+---------------+------------+---------------------+
| Id    | Name          | Status     | Created             |
+-------+---------------+------------+---------------------+
| 67890 | your_username | installing | 2017-03-13 21:14:19 |
+-------+---------------+------------+---------------------+
```

#### mysql-user:show

[](#mysql-usershow)

Show information about the given MySQL user.

```
$ forge mysql-user:show {serverId} {userId}

Status:  installing
Name:    your_username
Created: 2017-03-21 18:26:33
```

#### mysql-user:update

[](#mysql-userupdate)

Update the databases a MySQL user has access to.

```
$ forge mysql-user:update {serverId} {userId}
    --database=987
    --database=654
```

#### mysql-user:delete

[](#mysql-userdelete)

Delete the given MySQL user from your server. You will need to confirm your action.

```
$ forge mysql-user:delete {serverId} {userId}
```

### Firewall Rules

[](#firewall-rules)

#### rule:make

[](#rulemake)

Create a new firewall rule.

```
$ forge rule:make {serverId}
    --name="firewall rule"
    --port=88
```

#### rule:list

[](#rulelist)

Show all firewall rules.

```
$ forge rule:list {serverId}
```

#### rule:show

[](#ruleshow)

Show information about one of your firewall rules.

```
$ forge rule:show {serverId} {ruleId}
```

#### rule:delete

[](#ruledelete)

Delete a given firewall rule from one of your servers. You will need to confirm your action.

```
$ forge rule:delete {serverId} {ruleId}
```

---

### Scheduled Jobs

[](#scheduled-jobs)

#### job:make

[](#jobmake)

Create a new scheduled job.

```
$ forge job:make {serverId}
    --user="forge"
    --command="echo 'hello world' > /dev/null"
    --frequency="hourly"
```

#### job:list

[](#joblist)

Show all scheduled jobs.

```
$ forge job:list {serverId}
```

#### job:show

[](#jobshow)

Show information about one of your scheduled jobs.

```
$ forge job:show {serverId} {jobId}
```

#### job:delete

[](#jobdelete)

Delete a given scheduled job from one of your servers. You will need to confirm your action.

```
$ forge job:delete {serverId} {jobId}
```

---

### Databases

[](#databases)

#### database:make

[](#databasemake)

Create a new database. The flags `--user` and `--password` must either both be present or both be absent.

```
$ forge database:make {serverId}
    --user="sven"
    --password="My_P45sw0rD"
```

#### database:list

[](#databaselist)

Show all databases on a server.

```
$ forge database:list {serverId}
```

#### database:show

[](#databaseshow)

Show information about one of your databases.

```
$ forge database:show {serverId} {databaseId}
```

#### database:delete

[](#databasedelete)

Delete a given database from one of your servers. You will need to confirm your action.

```
$ forge database:delete {serverId} {databaseId}
```

---

### SSL Certificates

[](#ssl-certificates)

#### certificate:list

[](#certificatelist)

Show all certificates installed on the given site.

```
$ forge certificate:list {serverId} {siteId}
```

#### certificate:show

[](#certificateshow)

Show information about the specified certificate.

```
$ forge certificate:show {serverId} {siteId} {certificateId}
```

#### certificate:make

[](#certificatemake)

Create a new certificate for one of your sites.

```
$ forge certificate:make {serverId} {siteId}
    --domain="www.example.com"
    --country="US"
    --state="NY"
    --city="New York"
    --organization="Acme, Inc."
    --department="Development"
```

#### certificate:activate

[](#certificateactivate)

Activate a currently installed SSL certificate.

```
$ forge certificate:activate {serverId} {siteId} {certificateId}
```

#### certificate:install

[](#certificateinstall)

Install a certificate on the given site.

```
$ forge certificate:install {serverId} {siteId} {certificateId}
```

#### certificate:delete

[](#certificatedelete)

Revoke and remove a certificate from the given site. You will need to confirm you action.

```
$ forge certificate:delete {serverId} {siteId} {certificateId}
```

---

### SSH Keys

[](#ssh-keys)

#### key:make

[](#keymake)

Create a new SSH key and add it to a server.

```
$ forge key:make {serverId}
    --name="Macbook"
    --file="~/.ssh/id_rsa.pub"
```

If you do not supply the `--file` option, the command will look in `STDIN` for any input:

```
$ forge key:make {serverId} --name="Macbook"  file.txt
```

#### deploy-script:set

[](#deploy-scriptset)

Update the deployment script of the given site.

```
$ forge deploy-script:set {serverId} {siteId}
    --file=file.txt
```

If you do not supply the `--file` option, the command will look in `STDIN` for any input:

```
$ forge deploy-script:set {serverId} {siteId}  file.log
```

#### reset-deploy-state

[](#reset-deploy-state)

Reset the state of the deployment.

```
$ forge reset-deploy-state {serverId} {siteId}
```

---

### Configuration

[](#configuration)

#### env:get

[](#envget)

Get the environment file of one of your sites.

```
$ forge env:get {serverId} {siteId}
```

The output will be written to `STDOUT`, so you can save it to a file directly:

```
$ forge env:get {serverId} {siteId} > env-file.txt
```

#### env:set

[](#envset)

Update the environment file for one of your sites.

```
$ forge env:set {serverId} {siteId}
    --file=new-env.txt
```

If you do not supply the `--file` option, the command will look in `STDIN` for any input:

```
$ forge env:set {serverId} {siteId}  nginx.conf
```

#### nginx-config:set

[](#nginx-configset)

Update the nginx config file for one of your sites.

```
$ forge nginx-config:set {serverId} {siteId}
    --file=new.conf
```

If you do not supply the `--file` option, the command will look in `STDIN` for any input:

```
$ forge nginx-config:set {serverId} {siteId}
