Skip to content

Latest commit

 

History

History
236 lines (161 loc) · 7.61 KB

cli-install.md

File metadata and controls

236 lines (161 loc) · 7.61 KB
copyright lastupdated keywords subcollection
years
2020, 2022
2022-11-21
command-line interface for code engine, cli, cli for code engine, install cli for code engine, configuring code engine cli, kubernetes and code engine cli, knative and code engine cli, kubectl and code engine cli
codeengine

{{site.data.keyword.attribute-definition-list}}

Setting up the CLI

{: #install-cli}

Install, update, and delete the required CLIs and set up your environment to use {{site.data.keyword.codeenginefull}}. {: shortdesc}

Supported environments for {{site.data.keyword.codeengineshort}} CLI

{: #cli-env}

The {{site.data.keyword.codeengineshort}} CLI supports the following environments:

  • Linux 64 bit
  • Linux 64 bit ARM
  • Linux 32 bit
  • Mac OS X 64 bit
  • Mac OS X M1/ARM
  • Windows 64 bit
  • Windows 32 bit

Installing the {{site.data.keyword.cloud_notm}} CLI

{: #cli-setup}

Install the latest version of the {{site.data.keyword.cloud_notm}} CLI. {: shortdesc}

Before you begin

You must create an {{site.data.keyword.cloud_notm}} account{: external}.

  1. Download and install the {{site.data.keyword.cloud_notm}} CLI.

    This installation includes the following files:

    • IBM Cloud Functions plug-in
    • IBM Cloud Object Storage plug-in
    • IBM Cloud Container Registry plug-in
    • IBM Cloud Kubernetes Service plug-in

    For more information, see {{site.data.keyword.cloud_notm}} CLI.

  2. Log in to the {{site.data.keyword.cloud_notm}} CLI.

    ibmcloud login

    {: pre}

  3. If you have more than one account, you are prompted to select which account to use. Follow the prompts or use the target command to select your {{site.data.keyword.cloud_notm}} account.

    ibmcloud target -c <account_id>

    {: pre}

  4. You must also specify a region. You can use the target command to target or change regions.

    ibmcloud target -r <region>

    {: pre}

  5. You must specify a resource group. To get a list of your resource groups, run the following command.

    ibmcloud resource groups

    {: pre}

    Example output

    Retrieving all resource groups under account <account_name> as [email protected]...
    OK
    Name      ID                                 Default Group   State   
    default   a8a12accd63b437bbd6d58fb8b462ca7   true            ACTIVE
    test      a8a12abbbd63b437cca6d58fb8b462ca7  false           ACTIVE

    {: screen}

  6. Target a resource group by running the following command.

    ibmcloud target -g <resource_group>

    {: pre}

    Example output

    Targeted resource group default

    {: screen}

Installing the {{site.data.keyword.codeengineshort}} CLI plug-in

{: #install-cli-plugin}

Install the latest version of the {{site.data.keyword.codeengineshort}} CLI. {: shortdesc}

Be sure that you installed the latest version of the {{site.data.keyword.cloud_notm}} CLI. Otherwise, your {{site.data.keyword.codeengineshort}} CLI installation might fail with a message similar to Could not find compatible binary to install for plug-in code-engine. {: tip}

  1. Install the {{site.data.keyword.codeengineshort}} plug-in.

    ibmcloud plugin install code-engine

    {: pre}

  2. Use the ibmcloud plugin show code-engine command to verify that the plug-in is installed.

    ibmcloud plugin show code-engine

    {: pre}

    Example output

    Plugin Name                              code-engine[ce]
    Plugin Version                           1.31.0
    Plugin SDK Version                       0.9.0
    Minimal IBM Cloud CLI version required   1.0.0
    Private endpoints supported              true
    
    Commands:
    code-engine,ce                    Manage Code Engine components.
    [...]

    {: screen}

  3. To run {{site.data.keyword.codeengineshort}} commands, use ibmcloud code-engine or ibmcloud ce. To see everything that you can do with the {{site.data.keyword.codeengineshort}} plug-in, run ibmcloud ce with no arguments.

    ibmcloud ce

    {: pre}

Optionally, you can install the jq package{: external}. Many {{site.data.keyword.codeengineshort}} commands include an option (--output JSON) to create JSON output. With this package, you can view and parse JSON responses from the command line. {: tip}

For more information about {{site.data.keyword.codeengineshort}} commands, see the ibmcloud ce commands.

Updating the {{site.data.keyword.codeengineshort}} CLI

{: #update-cli}

Update the CLI periodically to take advantage of new features.

  1. View your current plug-in list by running the ibmcloud plugin list command.

    ibmcloud plugin list

    {: pre}

    Example output

    Listing installed plug-ins...
    
    Plugin Name                                  Version   Status             Private endpoints supported
    code-engine[ce]                              1.31.0                       true
    container-registry                           0.1.571                      true
    container-service[kubernetes-service]        1.0.408                      false

    {: screen}

  2. If an update is available, run the ibmcloud plugin update command.

    ibmcloud plugin update code-engine

    {: pre}

Uninstalling the CLI

{: #uninstall-cli}

If you no longer need the CLI, you can uninstall it.

  1. List the plug-ins that are installed.

    ibmcloud plugin list

    {: pre}

  2. Uninstall the plug-ins. For example, to uninstall the {{site.data.keyword.codeengineshort}} CLI plug-in:

    ibmcloud plugin uninstall code-engine

    {: pre}

  3. Verify the plug-ins were uninstalled by running the following command and checking the list of the plug-ins that are installed.

    ibmcloud plugin list

    {: pre}

The plug-ins that you deleted are not displayed in the results.

Accessing the {{site.data.keyword.cloud-shell_notm}} in your web browser

{: #cloud-shell}

With the {{site.data.keyword.cloud-shell_full}}{: external}, you can use the {{site.data.keyword.cloud_notm}} CLI and other CLI plug-ins directly from your web browser. {: shortdesc}

The {{site.data.keyword.cloud-shell_notm}} is enabled with several plug-ins and tools, including the base {{site.data.keyword.cloud_notm}} CLI (ibmcloud) and the {{site.data.keyword.codeengineshort}} CLI.

While you use the {{site.data.keyword.cloud-shell_short}}, keep in mind the following limitations.

  • You can open up to five concurrent sessions, which operate independently so you can work with different resources, regions, and accounts at once.
  • Any files that you download and edit locally, such as YAML files, are stored temporarily in the {{site.data.keyword.cloud-shell_short}} and don't persist across sessions.
  • {{site.data.keyword.cloud-shell_short}} has a usage quota that limits you to 50 hours within a week.

To launch and use the {{site.data.keyword.cloud-shell_notm}}, in the {{site.data.keyword.cloud_notm}} console{: external} menu bar, click the {{site.data.keyword.cloud-shell_short}} icon {{site.data.keyword.cloud-shell_notm}} icon. A session starts and automatically logs you in to the {{site.data.keyword.cloud_notm}} CLI with your current account credentials.