Keeper-Security / Commander

Keeper Commander is a python-based CLI and SDK interface to the Keeper Security platform. Provides administrative controls, reporting, import/export and vault management.
https://www.keepersecurity.com/commander.html
MIT License
182 stars 74 forks source link

:sparkles: Add ability to pipe commands #1153

Open jptechnical opened 7 months ago

jptechnical commented 7 months ago

Add the ability to pipe commands, specifically for retrieving secrets. This would greatly accelerate the day-to-day use of this in the terminal. Ideally, this should be possible via your actual bash/powershell/etc., but invoking the keeper command requires a login every time it is run (or --config path/to/config.json, but I still think a login takes place).

For instance, to retrieve a record detail, it requires two separate commands, some scrolling (see this bug report), and possibly some copy and paste. It should be possible on a one-liner.

You should be able to do the following in keeper shell:

s  test-e2e@example.com | g --unmask

This sequence of commands below is what is currently required.

My Vault>  s  test-e2e@example.com

  #  record uid              type    title                 description
---  ----------------------  ------  --------------------  --------------------
  1  xxxxxxxxxxxxxxxxxxxxxx  login   hourglass testflight  test-e2e@example.com
                 uid: xxxxxxxxxxxxxxxxxxxxxx
                type: login
               title: hourglass testflight
                    ...
             (login): test-e2e@example.com
          (password): ********
                    ...

My Vault> g XXXXXXXXXXXXXXXXXXXXXX  --unmask
                 UID: XXXXXXXXXXXXXXXXXXXXXX
                Type: login
                    ...
             (login): test-e2e@example.com
          (password): !9v5D$chxuNTpa