July 13, 2022 By Sara Fosshat 3 min read

As a developer, knowing the best way to save time is partly about knowing the best tools for the job.

Specifically, when you’re developing in Visual Studio Code, having to navigate away from your IDE to do some quick task on your local terminal can quickly become an annoying hassle.

If you find yourself using the IBM Cloud CLI while also developing on Visual Studio Code, try this handy shortcut. The revamped IBM Cloud CLI Extension for Visual Studio Code provides access to capabilities from the IBM Cloud CLI directly within the Visual Studio Code editor’s Command Palette. This enables you to quickly access a subset of ibmcloud commands, including to view a targeted environment, modify Kubernetes clusters, build and deploy cloud-native applications and more — all without the need to leave the editor’s context.

IBM Cloud CLI Extension for Visual Studio Code.

To get started, just install the IBM Cloud CLI VS Code extension in VS Code and type ibmcloud in the Command Palette to see a list of all the available commands.

Installation

The fastest way to install the IBM Cloud CLI extension is to open VS Code’s Quick Open (⌘P for Mac and Ctrl+P for Windows/Linux) and enter the ext install IBM Cloud CLI command. 

You can also install the IBM Cloud CLI extension by opening the Extensions sidebar inside of the VS Code editor and searching for IBM Cloud CLI.  From there, click Install. You’ll also need IBM Cloud CLI plugin installed on your system.

Usage

To begin using the IBM Cloud CLI, go to View > Command Palette (⇧⌘P for Mac and Ctrl+Shift+P for Windows/Linux) and type ibmcloud to see the list of all available commands.

You’ll need to log in to interact with IBM Cloud. If you’re already logged in by using the CLI in a terminal window, you won’t have to log in again. 

Here are some main IBM Cloud CLI commands that you can utilize in the VS Code Command Palette:

  • ibmcloud login: Log in to the IBM Cloud CLI.
  • ibmcloud target: View targeted IBM Cloud org, space, account, and resource group.
  • ibmcloud regions: View the information for all regions on IBM Cloud.
  • ibmcloud ks: View and modify your Kubernetes clusters and worker nodes.

How to build/deploy an app using the IBM Cloud dev workflow

Prerequisite tools:

  • IBM Cloud CLI: The command-line interface to interact with IBM Cloud API.
  • Docker: You need Docker to deliver and run software in packages called containers — this is required for ibmcloud dev.

Before you begin, make sure you’ve done the following:

  • Installed the IBM Cloud CLI Extension for VS Code.
  • Logged into IBM Cloud:
    • Open the VS Code Command Palette (⇧⌘P for Mac and Ctrl+Shift+P for Windows/Linux).
    • Use the ibmcloud login command to log in to IBM Cloud (using your IBM Cloud credentials).

To get started:

  1. Create a project on IBM Cloud by typing ibmcloud dev create in the VS Code integrated terminal and following the steps. For more information, visit the IBM Cloud CLI Documentation.
  2. Open the project’s folder in VS Code (File > Open Folder or ⌘O for Mac, Ctrl+O for Windows).
  3. Begin building, running and deploying your app by using the following commands in the VS Code Command Palette:
    • Use the ibmcloud dev build command to build the app into a Docker image.
    • Use the ibmcloud dev debug command to debug the app in local Docker for development.
    • Use the ibmcloud dev run command to run the app in local Docker in release mode.
    • Use the ibmcloud dev deploy command to deploy the app (in the Docker container) to IBM Cloud.
    • Use the ibmcloud dev view command to open your deployed project on IBM Cloud in a web browser.
    • Use the ibmcloud dev console command to open the IBM Cloud console for your project in a web browser.

IBM Cloud CLI dev plugin commands in VS Code Command Palette.

What’s next?

Now, it’s time to try it out for yourself and build amazing things on IBM Cloud.  

If you find a bug or have a feature request, then let us know by opening an issue. For additional support, you can also find us on Slack.

Was this article helpful?
YesNo

More from Cloud

IBM Cloud Virtual Servers and Intel launch new custom cloud sandbox

4 min read - A new sandbox that use IBM Cloud Virtual Servers for VPC invites customers into a nonproduction environment to test the performance of 2nd Gen and 4th Gen Intel® Xeon® processors across various applications. Addressing performance concerns in a test environment Performance testing is crucial to understanding the efficiency of complex applications inside your cloud hosting environment. Yes, even in managed enterprise environments like IBM Cloud®. Although we can deliver the latest hardware and software across global data centers designed for…

10 industries that use distributed computing

6 min read - Distributed computing is a process that uses numerous computing resources in different operating locations to mimic the processes of a single computer. Distributed computing assembles different computers, servers and computer networks to accomplish computing tasks of widely varying sizes and purposes. Distributed computing even works in the cloud. And while it’s true that distributed cloud computing and cloud computing are essentially the same in theory, in practice, they differ in their global reach, with distributed cloud computing able to extend…

How a US bank modernized its mainframe applications with IBM Consulting and Microsoft Azure

9 min read - As organizations strive to stay ahead of the curve in today's fast-paced digital landscape, mainframe application modernization has emerged as a critical component of any digital transformation strategy. In this blog, we'll discuss the example of a US bank which embarked on a journey to modernize its mainframe applications. This strategic project has helped it to transform into a more modern, flexible and agile business. In looking at the ways in which it approached the problem, you’ll gain insights into…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters