shell-plugins icon indicating copy to clipboard operation
shell-plugins copied to clipboard

feat: Add plugin for prefect

Open avinash-santhanagopalan opened this issue 1 year ago • 6 comments

Overview

Adds a plugin for prefect cli

Type of change

  • [x] Created a new plugin
  • [ ] Improved an existing plugin
  • [ ] Fixed a bug in an existing plugin
  • [ ] Improved contributor utilities or experience

Related Issue(s)

  • Resolves: #
  • Relates: #

How To Test

Install prefect:

pip install prefect

Test the plugin:

op plugin init prefect      
####################################################################################
# WARNING: 'prefect' is not from the official registry.                            #
# Only proceed if you are the developer of 'prefect'.                              #
# Otherwise, delete the file at /Users/1password/.config/op/plugins/local/prefect. #
####################################################################################

Prefect [test build]
Authenticate with Prefect Access Key.

? Locate your Prefect Access Key: Search in 1Password...

? Locate your Prefect Access Key: <Prefect credentials>

? Configure when the chosen credential(s) will be used to authenticate: Prompt me for each new terminal session

The last step is to set up an alias for prefect.
You can do so by running the following command:

  echo "source /Users/1password/.config/op/plugins.sh" >> ~/.zshrc && source ~/.zshrc

Afterwards, run any prefect command to see it in action!
                                                                                                                                                   
29.395s 1password ❯ echo "source /Users/1password/.config/op/plugins.sh" >> ~/.zshrc && source ~/.zshrc
                                                                                                                                                  
154ms 1password ❯ prefect deployment ls
####################################################################################
# WARNING: 'prefect' is not from the official registry.                            #
# Only proceed if you are the developer of 'prefect'.                              #
# Otherwise, delete the file at /Users/1password/.config/op/plugins/local/prefect. #
####################################################################################
                                                   Deployments                                                    
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                                                                    ┃ ID                                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ The list of deployments
└─────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────┘

Changelog

Authenticate Prefect using 1Password Shell Plugin

avinash-santhanagopalan avatar Jun 09 '23 15:06 avinash-santhanagopalan