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

The recipe for RAG: How cloud services enable generative AI outcomes across industries

4 min read - According to research from IBM®, about 42 percent of enterprises surveyed have AI in use in their businesses. Of all the use cases, many of us are now extremely familiar with natural language processing AI chatbots that can answer our questions and assist with tasks such as composing emails or essays. Yet even with widespread adoption of these chatbots, enterprises are still occasionally experiencing some challenges. For example, these chatbots can produce inconsistent results as they’re pulling from large data…

Rethink IT spend in the age of generative AI

3 min read - It’s the burning question for today’s CIOs: what do you spend your IT budget on? Cloud costs were already a challenge—in a recent survey, 24% estimated they wasted software spend. The explosion of generative AI makes it critical for organizations to consider frameworks like FinOps and technology business management (TBM) for visibility and accountability of all tech spend. But what does this all mean in practice? How can organizations shift to a more disciplined, value-driven approach to IT spend? What…

Announcing Dizzion Desktop as a Service for IBM Virtual Private Cloud (VPC)

2 min read - For more than four years, Dizzion and IBM Cloud® have strategically partnered to deliver incredible digital workspace experiences to our clients. We are excited to announce that Dizzion has expanded their Desktop as a Service (DaaS) offering to now support IBM Cloud Virtual Private Cloud (VPC). Powered by Frame, Dizzion’s cloud-native DaaS platform, clients can now deploy their Windows and Linux® virtual desktops and applications on IBM Cloud VPC and enjoy fast, dynamic, infrastructure provisioning and a true consumption-based model.…

IBM Newsletters

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