"export: not valid in this context"

targetertargeter
edited September 7 in CLI

I get the following problem when I try to eval the output of op signin:

~ ❯❯❯ eval $(op signin de-kaper.1password.com myemail@example.com A3-(REST-OF-KEY)⏎
Please enter your password for user myemail@example.com at de-kaper.1password.com:
export: not valid in this context: OP_SESSION_de-kaper

The output seems fine:

~ ❯❯❯ op signin de-kaper.1password.com myemail@example.com A3-(REST-OF-KEY)⏎
Please enter your password for user myemail@example.com at de-kaper.1password.com:
export OP_SESSION_de-kaper="(TOKEN)"
# This command is meant to be used with your shell's eval function.
# Run 'eval $(op signin de-kaper)' to sign into your 1Password account.
# If you wish to use the session token itself, pass the --output=raw flag value.

Maybe it's related to the dash in my subdomain?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: macOs 10.12.6
Sync Type: Not Provided

Comments

  • cohixcohix

    AgileBits Team Member

    That is indeed the problem @targeter. For now, you can edit the ~/.op/config file and change the "shorthand" to something without a hypen. Alternatively, you can delete the file and use the --shorthand=[nickname] flag when doing the initial signin to choose something without the hypen. We're going to be pushing a build soon to fix this issue. Thanks for sending this report along :)

  • ctrldctrld Junior Member

    The same for my account:

    export "OP_SESSION_one-two-three"=...

  • cohixcohix

    AgileBits Team Member

    @ctrld The workaround I mentioned above will work, we're prepping a build with a fix for this issue now.

  • ctrldctrld Junior Member

    @cohix Great, it works! Thank you very much for help and long-waited utility!

  • cohixcohix

    AgileBits Team Member

    @targeter @ctrld You can grab the new 0.1.1 build that we just pushed with a fix for this issue: https://app-updates.agilebits.com/product_history/CLI

  • ctrldctrld Junior Member
    edited September 8

    @cohix it works, thank you.
    Now this variable looks like
    export OP_SESSION_one_two_three="..."
    instead of OP_SESSION_one-two-three, and
    op list items | jq .
    shows exactly what I need.

  • cohixcohix

    AgileBits Team Member

    Perfect! Glad to hear it.

Leave a Comment