OCI CLI setup
Setup OCI
You'll need a terminal and a browser. Log in to OCI and go to your profile. You'll need the user OCID and the tenant OCID. Note the region you are in.
Install oci
- Oracle Linux 8
sudo dnf -y install oraclelinux-developer-release-el8
sudo dnf install python36-oci-cli
- Other Linux
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
- MacOS
brew upgrade && brew update && brew install oci-cli
- Windows
lol. No. Get a Linux box or use WSL.
Configure
At the command line:
oci setup config
In a browser open the OCI console copy the user OCID.
Open the Profile menu (User menu icon) and click User Settings.
Copy the user OCID and return to the command line. Paste the user OCID at the User OCID prompt and hit return.
Return to the OCI console and navigate to Administration > Tenancy Details. In the Tenancy Information tab, click Copy to copy the OCID.
Return to the command line and paste the value at the OICD prompt and hit return.
Enter the associated region, hit enter.
Generate or enter the path to the private PEM file. For example, ~/.oci/oci_api_key.pem If required, enter the passphrase used with the key. Enter y or no to the prompt asking about whether to store the passphrase.
The configuration process is complete.