Skip to content

Tokens that start with -O breaks glab config set token

Not sure if this is a general GitLab issue, or a glab issue, although I'm leaning towards the latter.

I came across the this error in my CI pipeline:

$ glab config set token "${ROBOT_TOKEN}"
ERROR: unknown shorthand flag: 'O' in [MASKED]

Which tells me that something in the token is interpreted as a command line option, and simple quoting had no effect.

I played around a little and found that if the token starts with -O glab breaks as seen here:

$ export TOK="-Osddsf-Osddf"
$ glab config set token "$TOKEN"
ERROR: unknown shorthand flag: 'O' in -Osddsf-Osddf
Try 'glab config set --help' for more information.

With proper quoting glab should be able to handle tokens that start with a dash.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information