Connecting Cloud IDE to Code Studio

  • Last updated
  • minute read

Goal

Connect your personal Cloud IDE to a Code Studio project

  1. Prerequisites

  2. 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

  3. 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.

  4. Authenticate with Code Studio

    1. In the Cloud IDE terminal, run the following command: glab auth login
    2. The command will present you with a prompt: Which gitlab instance do you want to connect to? Answer by selecting code.acquia.com

    3. 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
    4. Create a personal access token. As directed by the terminal output, you must select both the api and write_repository_access scopes for the token.

    5. Once you’ve created the token, copy and paste it into the Cloud IDE terminal.
    6. The command will present you with a prompt: Choose your default git protocol Select HTTPS.
    7. 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!

  5. 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 
  6. 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:

    1. View GitLab Merge Requests for your project
      glab mr list

    1. Checkout the source branch for a given merge request
      glab mr checkout [MR ID]
    2. View GitLab issues for your project
      glab issue list

    1. Closing a merge request through Glab CLI
      glab mr close

    1. To view all the GitLab commands supported through GLab CLI in Cloud IDE
      glab --help