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

Import from cURL (feature) #48

Open
vn971 opened this issue Apr 24, 2024 · 7 comments
Open

Import from cURL (feature) #48

vn971 opened this issue Apr 24, 2024 · 7 comments
Labels

Comments

@vn971
Copy link

vn971 commented Apr 24, 2024

TL&DR; add the ability to import cURL please!

Full explanation:
It would be a useful feature to be able to import a request from cURL.
Currently, browsers such as Firefox and Chromium allow you to select a request and click Copy > Copy as cURL. This is very convenient, because you can immediately start altering your request in CLI if you want.

Native support for that in atac could look like an import feature, upon which the cURL command line would be read (from user's input), parsed and transformed into an atac request.

Thank you for the tool!

@Julien-cpsn
Copy link
Owner

Hello!

That is totally a great idea, if the curl has to be inside a file is it ok to you?

@vn971
Copy link
Author

vn971 commented Apr 24, 2024

@Julien-cpsn that'd definitely be appreciated!

To be 100% transparent, the ideal case would be to paste the code in some kind of input text area. However, reading from a file is definitely a good start, and the UX can probably be polished when there's broader demand for this feature. So I think it's definitely a good feature to have now!

P.S. Also, since atac is a terminal client, some people may use the tool remotely. It's not easy for me to think of these situations, but I imagine situations where a file input would be preferred could exist. To be frank, I'm not sufficiently aware of TUI best practices. For me personally, either approach would be good ^^

@Julien-cpsn
Copy link
Owner

@vn971 hmm Ok I see, and what about the app trying to get what's on your clipboard?

@vn971
Copy link
Author

vn971 commented Apr 24, 2024

@Julien-cpsn For me personally, this may not always work as it'd be impossible in e.g. a remote scenario, or if atac is running in a sandboxed environment with no graphical session access. I don't really know TUI best practices though. Is a little bit of graphical APIs usage considered okay, for e.g. for the clipboard, or mouse clicks? Again for me, a text box or file import would be ideal

Thanks for considering!

@Julien-cpsn
Copy link
Owner

@Julien-cpsn For me personally, this may not always work as it'd be impossible in e.g. a remote scenario, or if atac is running in a sandboxed environment with no graphical session access. I don't really know TUI best practices though. Is a little bit of graphical APIs usage considered okay, for e.g. for the clipboard, or mouse clicks? Again for me, a text box or file import would be ideal

Thanks for considering!

Text boxes and mouse events are really things to avoid. When speaking of TUI UX, the goal is to make it the simplest way. E.g. if a feature involves many graphical elements that are not needed or what I personally call crackhead knowledge (you haven't read line 301 part 5 of the documentation ☝️🤓)

In our case:
The simplest would be a file imported with the import command that already exist

So I think we'll go with that

@jwtly10
Copy link
Contributor

jwtly10 commented Apr 25, 2024

Hey @Julien-cpsn if its alright with you, I'd like to work on this.

I've already made a bit of a start, and have an initial implementation done.

I will raise PR and get some feedback as I may have a few questions.

Thanks

@Julien-cpsn
Copy link
Owner

Julien-cpsn commented Apr 25, 2024

@jwtly10 that's very great! Thanks

I have been working on pre and post-request scripts, and request export for the whole day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants