Connecting Cloud IDE to Code Studio
- Last updated
- minute read
Goal
Connect your personal Cloud IDE to a Code Studio project
-
Prerequisites
- Acquia Cloud Platform or Site Factory subscription
- A configured Acquia Code Studio project
- Access to Acquia Cloud IDE
-
Create your Cloud IDE
If you already have a Cloud IDE, you can skip this step.
Create a Cloud IDE by navigating to your Acquia Cloud application, selecting the “actions” dropdown, and clicking “Create Cloud IDE.”
Your Cloud IDE will open in your browser
-
Configure your IDE
If you had a pre-existing IDE that you’d already configured, you can skip this step.
Click the “Configure IDE” button on the “Welcome to Acquia Cloud IDE” page. This button will authenticate the Cloud IDE with your Cloud Platform account by creating and uploading an SSH Key.
-
Authenticate with Code Studio
- In the Cloud IDE terminal, run the following command:
glab auth login
- The command will present you with a prompt:
Which gitlab instance do you want to connect to?
Answer by selecting
code.acquia.com
- You will be prompted to create a Code Studio personal access token. You can do so by ctrl+clicking the URL printed in the terminal, which will look something like
https://code.acquia.com/-/profile/personal_access_tokens
- Create a personal access token. As directed by the terminal output, you must select both the
api
andwrite_repository_access
scopes for the token. - Once you’ve created the token, copy and paste it into the Cloud IDE terminal.
- The command will present you with a prompt:
Choose your default git protocol
SelectHTTPS
. - The command will present you with a prompt: Authenticate Git with your GitLab credentials? Select yes.
Your Cloud IDE is now connected to Code Studio!
- In the Cloud IDE terminal, run the following command:
-
Add the Code Studio project as a git remote
If you pulled your Acquia git repository into your Cloud IDE, your origin will point to Acquia Cloud’s default git remote. When using Code Studio, we do not recommend using the default remote.
Instead, add Code Studio as a git remote. E.g., run the following command in the Cloud IDE terminal:
git remote add codestudio [url]
You may then pull code from and push code to Code Studio using these commands:
git pull codestudio
git push codestudio
-
Explore the glab cli tool in Cloud IDE
Cloud IDE comes with Glab CLI installed by default. In step 3, we used the GLab CLI to authenticate Cloud IDE with Code Studio. The
glab
command can do much more! It allows you to interact with Code Studio through the CLI.Here are just a few examples that we suggest trying:
- View GitLab Merge Requests for your project
glab mr list
- Checkout the source branch for a given merge request
glab mr checkout [MR ID]
- View GitLab issues for your project
glab issue list
- Closing a merge request through Glab CLI
glab mr close
- To view all the GitLab commands supported through GLab CLI in Cloud IDE
glab --help
- View GitLab Merge Requests for your project