43 ‐ OCI Code Editor and CLI Utility Overview - SanjeevOCI/Ocidocs GitHub Wiki

OCI Code Editor and CLI Utility Guide

This guide walks through how to use the Oracle Cloud Infrastructure (OCI) Code Editor and basic OCI CLI commands from within the Code Editor environment. You’ll learn how to launch the Code Editor, create and edit files, run shell scripts, and execute OCI CLI commands—all from within the browser-based IDE.

OCI Code Editor provides an in-console editing environment tightly integrated with Cloud Shell, Git, and OCI services, helping developers and cloud engineers make quick code changes without switching tools.


Prerequisites

Before starting this lab, ensure:

  • You have access to the OCI Console
  • Your user has IAM permissions for Code Editor and Cloud Shell
  • You understand basic CLI and shell scripting

The Code Editor uses the same IAM policies as Cloud Shell. For Cloud Shell access, policies must allow compartment inspection.


1. Navigate to Code Editor

Navigate to Developer Tools --> Code Editor

OCI_Code_Editor_Overview_1

OCI_Code_Editor_Overview_2

2. Create New Folder & shell script

Click on Explorer on the Left side --> Create a Folder "Test_Folder" --> Inside folder, create a shell script - TestScript.sh --> Add shell script code and save.

OCI_Code_Editor_Overview_3

OCI_Code_Editor_Overview_4

OCI_Code_Editor_Overview_5

OCI_Code_Editor_Overview_6

3. Run the shell script code.

Right-Click on the TestScript.sh --> Select "Open in Integrated Terminal" Create a Folder --> Run the shell script code.

OCI_Code_Editor_Overview_7

OCI_Code_Editor_Overview_8

4. Run the OCI CLI commands

Run the OCI CLI commands

a) Get OCI CLI Version

 `oci cli -v`

b) OCI CLI command to get Instance details of Application-Server-1 using OCID instance

OCI_Code_Editor_Overview_9

 `oci compute instance get --instance-id ocid1.instance.oc1.iad.anuwcljsdal6jricawmf33prlow3g57dgs7ewxdqqzc75bqssdgj4ppebulq`

OCI_Code_Editor_Overview_10

OCI_Code_Editor_Overview_11