Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Create a command to import configs from a .env file #503

Open
rajdip-b opened this issue Oct 18, 2024 · 0 comments
Open

CLI: Create a command to import configs from a .env file #503

rajdip-b opened this issue Oct 18, 2024 · 0 comments
Assignees
Labels
difficulty: 4 hacktoberfest Hacktoberfest is on! help wanted Extra attention is needed priority: high scope: cli Everything related to the CLI type: feature Release drafter tag for tagging PRs related to adding new features

Comments

@rajdip-b
Copy link
Member

rajdip-b commented Oct 18, 2024

Description

In our CLI, we would like to have a command that can do the following:

  • Take a .env file as an input
  • Use the secret-scan package to organize the entries into secrets and variables
  • Upload the secrets and variables to a project

Ideally, the command should look like this:

keyshade project import <project-slug> <env-file-name>

Solution

  • Add the import command in project command
  • The import command should parse the env file into Record<string, string> format, and send it to secret-scan(CLI: Expose a function to scan JSON objects for secrets #502 )
  • Once the values are returned, show it to the users to confirm if the changes are okay to them
  • If yes, then push it to the project mentioned in project-slug. You would be basically calling createSecret and createVariable endpoints from SecretController and VariableController.
  • After the operation is finished, print a nice and tidy message stating that you have created x secrets and y variables.
  • While creating the secrets and variables, if you get an error from the backend, don't stop the entire operation. Save that into an array, and once all the uploads are done, print the errors nice and tidy.

Additional Context

Depends on #502

@rajdip-b rajdip-b added help wanted Extra attention is needed type: feature Release drafter tag for tagging PRs related to adding new features priority: high difficulty: 4 scope: cli Everything related to the CLI hacktoberfest Hacktoberfest is on! labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 4 hacktoberfest Hacktoberfest is on! help wanted Extra attention is needed priority: high scope: cli Everything related to the CLI type: feature Release drafter tag for tagging PRs related to adding new features
Projects
None yet
Development

No branches or pull requests

2 participants