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

add file support to cli #50

Open
dillonstreator opened this issue Dec 29, 2024 · 3 comments · May be fixed by #79
Open

add file support to cli #50

dillonstreator opened this issue Dec 29, 2024 · 3 comments · May be fixed by #79
Labels
cli enhancement New feature or request good first issue Good for newcomers

Comments

@dillonstreator
Copy link
Contributor

allow a local file to be provided to @crypt.fyi/cli

@dillonstreator dillonstreator added enhancement New feature or request cli good first issue Good for newcomers labels Dec 29, 2024
@vr-varad
Copy link

hey @dillonstreator I would like to work on this issue if its open for contribution.
Could u give some info regarding the issue

@dillonstreator
Copy link
Contributor Author

dillonstreator commented Jan 17, 2025

@vr-varad - thanks for taking interest in the project. It is open for contribution, if you're able to support.

The thinking here is that the CLI (in packages/cli) should allow users to specify a file path during the encrypt command.
This can be done by either introducing a new flag or by performing a fuzzy file check if the input string 'looks' like I filepath. I prefer the former, as it is safer and more intentional.

# fuzzy/implicit
# if there is a matching file path, encrypt the contents and store
# if there is not a matching file path, encrypt the literal string and store (default string encryption behavior)
cryptfyi encrypt ./some-file-path.txt


# explicit
cryptfyi encrypt -f ./some-file-path.txt

The encrypt command should read the contents of the file and use that as the input for encryption.

Conversely, in the decrypt method, if the contents after decryption are determined to be a file, save it to a sane location. This might just be the current directory or the downloads folder.
Another option on the decrypt side is to prompt the user for where to send the file.

Make sure to use the node standard library to maintain a platform agnostic implementation.

@vr-varad
Copy link

@dillonstreator I will try my best!! and will contact u for any doubts

@vr-varad vr-varad linked a pull request Feb 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants