Does NOT work: op run – …

export TEST_USER_NAME=op://your-vault-name/TEST_USER/username
export TEST_USER_PASSWORD=op://your-vault-name/TEST_USER/password

op run -- echo ${TEST_USER_NAME} ${TEST_USER_PASSWORD}

> op://your-vault-name/TEST_USER/username op://your-vault-name/TEST_USER/password

Works: op run – bash -c ‘…’

export TEST_USER_NAME=op://your-vault-name/TEST_USER/username
export TEST_USER_PASSWORD=op://your-vault-name/TEST_USER/password

op run -- bash -c 'echo ${TEST_USER_NAME} ${TEST_USER_PASSWORD}'

> foo-username foo-password

If it’s just checking if you didn’t have a type, it’s much easier to run

op run -- printenv TEST_USER_NAME
op run -- printenv TEST_USER_PASSWORD

which gives you useful errors like

[ERROR] "your-vault-name" isn't a vault in this account. Specify the vault with its ID or name.