|
| 1 | +--- |
| 2 | +description: Use the [[= product_name_cloud =]] CLI to manage your I[[= product_name_cloud =]] projects from the command line. |
| 3 | +month_change: true |
| 4 | +--- |
| 5 | + |
| 6 | +# [[= product_name_cloud =]] CLI |
| 7 | + |
| 8 | +The [[= product_name_cloud =]] CLI (`ibexa_cloud`) is a command-line tool for managing your [[= product_name_cloud =]] projects. |
| 9 | +It's based on the [Upsun CLI](https://developer.upsun.com/cli) and shares the same commands. |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +Follow the installation instructions at [cli.ibexa.cloud](https://cli.ibexa.cloud/). |
| 14 | + |
| 15 | +After installation, authenticate with your [[= product_name_cloud =]] account: |
| 16 | + |
| 17 | +```bash |
| 18 | +ibexa_cloud auth:browser-login |
| 19 | +``` |
| 20 | + |
| 21 | +## Command reference |
| 22 | + |
| 23 | +To get started, try the following commands: |
| 24 | + |
| 25 | +- `ibexa_cloud list` lists all available commands |
| 26 | +- `ibexa_cloud ssh` opens an SSH session to the current environment, or executes a command remotely |
| 27 | +- `ibexa_cloud log` reads an environment's logs |
| 28 | +- `ibexa_cloud rel` shows an environment's service relationships |
| 29 | +- `ibexa_cloud var` lists environment variables |
| 30 | + |
| 31 | +To get help and see usage examples for any command, run: |
| 32 | + |
| 33 | +```bash |
| 34 | +ibexa_cloud <command> --help |
| 35 | +``` |
| 36 | + |
| 37 | +For the full list of available commands, run `ibexa_cloud list` or see the [Upsun CLI reference](https://developer.upsun.com/cli/reference). |
| 38 | +In all examples, replace `upsun` with `ibexa_cloud`. |
| 39 | + |
| 40 | +## Examples |
| 41 | + |
| 42 | +### Run a SQL script |
| 43 | + |
| 44 | +To execute a SQL upgrade script on a [[= product_name_cloud =]] environment, pass it to `ibexa_cloud sql`: |
| 45 | + |
| 46 | +=== "MySQL" |
| 47 | + |
| 48 | + ```bash |
| 49 | + ibexa_cloud sql < vendor/ibexa/installer/upgrade/db/mysql/ibexa-x.x.x-to-x.x.y.sql |
| 50 | + ``` |
| 51 | + |
| 52 | +=== "PostgreSQL" |
| 53 | + |
| 54 | + ```bash |
| 55 | + ibexa_cloud sql < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-x.x.x-to-x.x.y.sql |
| 56 | + ``` |
| 57 | + |
| 58 | +### Connect with a SQL client |
| 59 | + |
| 60 | +To connect to the database using any SQL client, start SSH tunnels to all services (database, Redis, Solr, and others except Varnish) by running the following command in the project directory: |
| 61 | + |
| 62 | +```bash |
| 63 | +ibexa_cloud tunnel:open |
| 64 | +``` |
| 65 | + |
| 66 | +The command outputs connection details for each service, for example: |
| 67 | + |
| 68 | +``` shell-session |
| 69 | +SSH tunnel opened to database at: mysql://user:<PASSWORD>@127.0.0.1:30000/main |
| 70 | +``` |
| 71 | + |
| 72 | +Use the displayed host, port, database name, username, and password to configure your SQL client. |
| 73 | + |
| 74 | +When you're done, close the tunnels: |
| 75 | + |
| 76 | +```bash |
| 77 | +ibexa_cloud tunnel:close |
| 78 | +``` |
0 commit comments