--compartment-id
--compartment-id
~/.oci/config
OCI_CONFIG_FILE
OCI_CLI_PROFILE
[PROFILE_NAME]
--profile PROFILE_NAME
~/.oci/active_profile
~/.oci/config_prod
~/.oci/config_staging
~/.oci/config_dev
~/.oci/config_prod
~/.oci/config_staging
~/.oci/config_dev
~/.oci/config_prod
~/.oci/config_staging
~/.oci/config_dev
config_<profile>
ocswitch prod
ocswitch prod
ocswitch prod
~/.oci/active_profile
OCI_CONFIG_FILE
OCI_CLI_PROFILE
_oci_state="${HOME}/.oci/active_profile"
if [[ -f "$_oci_state" ]]; then _oci_profile=$(cat "$_oci_state") _oci_cfg="${HOME}/.oci/config_${_oci_profile}" if [[ -f "$_oci_cfg" ]]; then export OCI_CONFIG_FILE="$_oci_cfg" export OCI_CLI_PROFILE="config_${_oci_profile}" fi
fi
_oci_state="${HOME}/.oci/active_profile"
if [[ -f "$_oci_state" ]]; then _oci_profile=$(cat "$_oci_state") _oci_cfg="${HOME}/.oci/config_${_oci_profile}" if [[ -f "$_oci_cfg" ]]; then export OCI_CONFIG_FILE="$_oci_cfg" export OCI_CLI_PROFILE="config_${_oci_profile}" fi
fi
_oci_state="${HOME}/.oci/active_profile"
if [[ -f "$_oci_state" ]]; then _oci_profile=$(cat "$_oci_state") _oci_cfg="${HOME}/.oci/config_${_oci_profile}" if [[ -f "$_oci_cfg" ]]; then export OCI_CONFIG_FILE="$_oci_cfg" export OCI_CLI_PROFILE="config_${_oci_profile}" fi
fi
ocswitch list
~/.oci/config_*
ocswitch clear
Tenant Name: mycompany-production
Tenant ID: ocid1.tenancy.oc1..aaaa...
User Email: [email protected]
Tenant Name: mycompany-production
Tenant ID: ocid1.tenancy.oc1..aaaa...
User Email: [email protected]
Tenant Name: mycompany-production
Tenant ID: ocid1.tenancy.oc1..aaaa...
User Email: [email protected]
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.zsh \ -o ~/.oci/ocswitch.zsh
echo 'source ~/.oci/ocswitch.zsh' >> ~/.zshrc
source ~/.zshrc
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.zsh \ -o ~/.oci/ocswitch.zsh
echo 'source ~/.oci/ocswitch.zsh' >> ~/.zshrc
source ~/.zshrc
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.zsh \ -o ~/.oci/ocswitch.zsh
echo 'source ~/.oci/ocswitch.zsh' >> ~/.zshrc
source ~/.zshrc
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.bash \ -o ~/.oci/ocswitch.bash
echo 'source ~/.oci/ocswitch.bash' >> ~/.bashrc
source ~/.bashrc
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.bash \ -o ~/.oci/ocswitch.bash
echo 'source ~/.oci/ocswitch.bash' >> ~/.bashrc
source ~/.bashrc
curl -fsSL https://gist.githubusercontent.com/amaanx86/2621a181e2f4b572a1904d65748d66bd/raw/ocswitch.bash \ -o ~/.oci/ocswitch.bash
echo 'source ~/.oci/ocswitch.bash' >> ~/.bashrc
source ~/.bashrc
ocswitch # show help + logo
ocswitch list # list profiles (active highlighted)
ocswitch <profile> # switch profile (persists across all terminals)
ocswitch clear # clear active profile
ocswitch # show help + logo
ocswitch list # list profiles (active highlighted)
ocswitch <profile> # switch profile (persists across all terminals)
ocswitch clear # clear active profile
ocswitch # show help + logo
ocswitch list # list profiles (active highlighted)
ocswitch <profile> # switch profile (persists across all terminals)
ocswitch clear # clear active profile
~/.oci/config_<profile>
[config_prod]
user=ocid1.user.oc1..aaaa...
fingerprint=xx:xx:xx:...
tenancy=ocid1.tenancy.oc1..aaaa...
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem
[config_prod]
user=ocid1.user.oc1..aaaa...
fingerprint=xx:xx:xx:...
tenancy=ocid1.tenancy.oc1..aaaa...
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem
[config_prod]
user=ocid1.user.oc1..aaaa...
fingerprint=xx:xx:xx:...
tenancy=ocid1.tenancy.oc1..aaaa...
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem
~/.oci/config_staging
[config_staging]
~/.oci/config_dev
[config_dev]