Serverless config credentials default value not recognized

I ranserverless config credentials --provider aws --key $AWS_KEY --secret $AWS_SECRET --profile profile
but it returned an error Trying to populate non string value into a string for variable ${opt:stage}. Please make sure the value of the property is a string. However in my serverless.yml file, i have a default value for stage
provider: name: aws runtime: nodejs8.10 role: ${self:custom.env.role} stage: ${opt:stage, 'dev'} region: ${self:custom.env.region} vpc: ${self:custom.env.vpc} profile: ${self:custom.env.profile}
Why am I seeing this error then? There is no sense for me to specify a stage at the config credentials command.