Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Set up OCI Cli

docs.oracle.com » Developer Resources » Required Keys and OCIDs docs.oracle.com » Developer Resources » Working with CLI » Configuring the CLI

  • Login to oracle cloud

  • Go to your profile and download the API Keys

  • Download private and public key pairs

  • Create the OCI directory

╰─ mkdir -p ~/.oci/
╰─ touch ~/.oci/config
  • Move the downloaded keys to the OCI directory
╰─ ls
config          oci-private.pem oci-public.pem
  • Set up your config file and repiar the config file permissions if needed
╰─ oci setup repair-file-permissions --file ~/.oci/oci-private.pem 
╰─ cat config
[DEFAULT]
user=<username>
fingerprint=<key-fingerprint>
tenancy=<tenancy>
region=<region>
key_file=~/.oci/oci-private.pem
  • If you have created any buckets, then you can list those buckets using the following command
╰─ oci os bucket list --compartment-id <compartment-id> | jq '.data[] | {name} '
## Alternatively you can pass the config file as argument as well
╰─ oci os bucket list --compartment-id <compartment-id> --config-file </path/to/file> | jq '.data[] | {name} '
.