"export: not valid in this context"

targeter
targeter
Community Member
edited September 2017 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

  • cohix
    cohix
    1Password Alumni

    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 :)

  • ctrld
    ctrld
    Community Member

    The same for my account:

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

  • cohix
    cohix
    1Password Alumni

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

  • ctrld
    ctrld
    Community Member

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

  • cohix
    cohix
    1Password Alumni

    @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

  • ctrld
    ctrld
    Community Member
    edited September 2017

    @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.

  • cohix
    cohix
    1Password Alumni

    Perfect! Glad to hear it.

This discussion has been closed.