Skip to content

CLI tool for more use-cases #13

Open

Description

@Mahmoudgalalz
          I would like to create the CLI, I have a previous expreiance to build it, also consider the options

That I told you about that, api can response text
As we could make it export the env and inject them to the system or we can leave this to the CLI,

This is would make a point for us cause there's no tool for that

Originally posted by @Mahmoudgalalz in #3 (comment)

Activity

  1. chronark commented on Jan 17, 2023

    @chronark
    Owner

    Yes, I think building a cli is the next step after the API

  2. chronark commented on Jan 17, 2023

    @chronark
    Owner

    I've had a great experience using oclif to build a CLI in the past

    Probably I would split this up into different packages and manage it using turborepo

    /apps/web // current nextjs app
    /apps/cli
    /packages/encryption
    

    Or similar

    I can take a better look tonight

  3. Mahmoudgalalz commented on Jan 17, 2023

    @Mahmoudgalalz
    Author

    I would like to start with you, we should cosider the size of it and its performance, some CI/CD tools as pricing as pay as you go, so we should cosider that, let me know to collaborate in this together 🦀

  4. chukwumaokere commented on Jan 17, 2023

    @chukwumaokere
    Contributor

    So just brainstorming the CLI functionality here.
    One would probably use it something like this:

    envshare share some-pre-encrypted-secret --reads=999 --ttl=7 --units=days
    and get a response like...

    URL: https://envshare.dev/unseal#{id}
    Id: {id}
    Expires In: 7 days
    Expires At: January 24, 2023 19:41:33 (UTC)
    Reads: 999

    and maybe can do

    envshare unseal --id={id}
    And receive a response like

    Secret: some-decrypted-secret
    Remaining Reads: 998

    Does that look sound right for the functionality or were you guys planning something else? 🤔

  5. Mahmoudgalalz commented on Jan 18, 2023

    @Mahmoudgalalz
    Author

    for the cli tool, actually we need to export them directly to the system, and the developer should be able to share env file
    and the purpose of the cli tool, just to config a server, the seal and unseal will happen between a Developer and an Instance (server)
    envshare share --file ./src/.env --reads=10 --ttl=7 -d

    .env
    
    DATABASE_URL=postgres://dwdw-dswd.com
    API_URL=https://api.com/api
    
    

    the unseal, would be like
    envshare inject {id}
    if the variables, doesn't have export we should put it after each newLine, and then output

    env that got injected
    
    DATABASE_URL
    API_URL
    

    envshare get {id}

    this one will output the regular output and he can do any thing later like grep then assign it to a variable etc.

  6. chronark commented on Jan 18, 2023

    @chronark
    Owner

    There should be 2 groups right now I think

    • env share ...: upload pre-encrypted data with ttl and reads
    • env encrypt: generate key on the client, encrypt and upload the encrypted data + iv, then display the id and full link

    @Mahmoudgalalz

    I would like to start with you, we should cosider the size of it and its performance, some CI/CD tools as pricing as pay as > you go, so we should cosider that, let me know to collaborate in this together 🦀

    Sounds good, what did you have in mind?

    Also let's consider the use of piping entire .env files

    $ cat .env | env encrypt --ttl=500` --reads=20
    
    Key: ""
    ID: ""
    Url: ""
    ... etc
    

    Also a --json flag would be very good to return the data in machine readable format for CI

  7. Mahmoudgalalz commented on Jan 18, 2023

    @Mahmoudgalalz
    Author

    we will consider using go, as its good to distribute, also I will start building it, we will rely on the api, so the API should have the options

    and anything else will be within the CLI

  8. chronark commented on Jan 18, 2023

    @chronark
    Owner

    haha I was about to mention go with cobra for example
    I love using that

    api is ready btw, check the readme for the api contract

  9. Mahmoudgalalz commented on Jan 18, 2023

    @Mahmoudgalalz
    Author

    I will, and I will mention you when I setup everything and make the first req from the CLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions