Code Monkey home page Code Monkey logo

atac's People

Contributors

airone01 avatar alecthegeek avatar ccoveille avatar ckaznable avatar julien-cpsn avatar jwtly10 avatar kalinivanov-l avatar orhun avatar v3rmine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

atac's Issues

Support the input file format to YAML

Just a suggestion, can you add support for yaml as the input for the collection, yaml is more human friendly, for read and write. You can also have references (anchors) to reduce repetitive blocks.

Just a thought :)

Feature Request: Generate items like UUIDs in headers

There are times where you want to generate a UUID or a timestamp in the header to be able to track a request. Would be nice if we could do {{UUID}} or {{TIMESTAMP}} to automatically generate this and insert it like with env variables.

Import from cURL (feature)

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!

feat:Authorization is passed to collection not to individual request.

an option to add the authorization to collection config.
workflow:
if the Authorization params is not passed to request headers will verify if has in the collection config.

i think if has this feature will be good to users who have a big collection.
you can take some reference from httpie-desktop client.

Add option to read openapi schemas

Hi,

I was trying yours and openapi-tui and I was surprised that there is no option to read autogenerated or static openapi schema in your tool.

I'm using fastapi, which generates schema dynamically on API start and which is accessible on localhost:port/openapi.json. I would like to have option to read this schema and have it loaded under default collection name.

Later the collection can be renamed according the users needs. I think this saves user a lot of work from creating new collections.

Otherwise great tool. Thank you.

my response body not word wrap

i am hit this [https://dummyjson.com/products] but show result respond like this ?

{"products":[{"id":1,"title":"iPhone 9","description":"An apple mobile which is nothing like aโ–ˆ

image

Error in ReadMe Documentation for Fedora Installation

From the ReadMe.md:

Install from Fedora copr

Simply use:

dnf enable joxcat/atac
dnf install atac

This snippet contains a mistake. The correct command to enable the package repository is dnf copr enable joxcat/atac.

Install from Homebrew is not working

I am using an M1 based Macbook

  1. When installing from homebrew I had to manually add the execute bit.

     chmod +x  /opt/homebrew/Cellar/atac/0.11.3/bin/atac
  2. The binary is for X64 rather than ARM so I can't run it

(PS -- This looks like a cool tool so will install from binary for now)

Add headers highlighting

Response body has syntax highlighting. Can something similar be applied to the headers section? At least to differentiate a header from its content.

Homebrew integration/tap

Do you have any plan to support homebrew install?

It's a convenient way to make your tool available for everyone, and it helps to keep the tool up to date

Cannot install from AUR - "One or more files did not pass the validity check"

First of all, great project.

I encountered an issue when installing atac from AUR in arch linux.
Tried both yay and paru, I get an error:

==> Validating source files with sha512sums...
    atac-0.12.0.tar.gz ... FAILED
==> ERROR: One or more files did not pass the validity check!
 -> error making: atac-exit status 1

Seems like checksum validation fails.

Crash when sending a request (index out of bounds)

Steps:
Set ATAC_MAIN_DIR to empty folder ~/.atac
Ran atac, importing a JSON postman file
Issued a request from the config
Upon hitting space, the application crashes with the following message:

thread 'main' panicked at src/app/app_logic/environment:12:26
index out of bounds: the len is 0 but the index is 0

Feature Request: Cancel a pending request

Forgot to return a response in an endpoint and realized I couldn't cancel the request from ATAC; the only way I was able to was by closing the app and rerunning atac.

Feature Request: use default `directory` if not specified

Now ATAC (version 0.15.1) must be given a working directory on startup.
image

IMHO, a tui application can use the default directory specified by the OS, i.e:

OS config directory cache directory
Linux /home/alice/.config/barapp /home/alice/.cache/barapp
Windows C:\Users\Alice\AppData\Roaming\Foo Corp\Bar App\config C:\Users\Alice\AppData\Local\Foo Corp\Bar App\cache
MacOS /Users/Alice/Library/Application Support/com.Foo-Corp.Bar-App /Users/Alice/Library/Caches/com.Foo-Corp.Bar-App

(Suppose the user name is Alice, the organization name is Foo Corp and the application name is Bar App).

All this can be easily handled by the directory crate:

[dependencies]
directories = "5"
// these are just examples, there must be some other much more better options
// and if you want the `ORGANIZATION` be present on Linux, some thing like `#[cfg(target_os = "linux")]` can be used
pub const APP_NAME: &str = "ATAC";
pub const QUALIFIER: &str = "fr";
pub const ORGANIZATION: &str = "Julien";

let project_dir = directories::ProjectDirs::from(QUALIFIER, ORGANIZATION, APP_NAME).unwrap();
let config_dir = project_dir.config_dir();
let cache_dir = project_dir.cache_dir();
let mut log_dir = cache_dir.to_owned();
log_dir.push("logs");

How to send a request?

Looks good and runs in my terminal. I can configure requests, but how can I actually SEND a request?

non-exhaustive patterns: `Language::Javascript` not covered

after running:

cargo install atac

to install ATAC, I face this error:

in /postman.rs:278:50
    |
278 |                         let request_body = match language {
    |                                                  ^^^^^^^^ pattern `Language::Javascript` not covered
    |
note: `Language` defined here
/mod.rs:448:1
    |
448 | pub enum Language {
    | ^^^^^^^^^^^^^^^^^
...
462 |     Javascript,
    |     ---------- not covered
    = note: the matched value is of type `Language`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
282 ~                             Language::Xml => ContentType::Xml(body_as_raw),
283 +                             Language::Javascript => todo!()
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `atac` (bin "atac") due to 1 previous error
error: failed to compile `atac v0.13.0`, intermediate artifacts can be found at `/tmp/cargo-installL1VJs5`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

but the source code actually has this match value for Language enum covered as can be seen:
in /postman.rs

 return match body_mode {
                Mode::Raw => {
                    let body_as_raw = body.raw?;

                    if let Some(options) = body.options {
                        let language = options.raw?.language?;

                        let request_body = match language {
                            Language::Html => ContentType::Html(body_as_raw),
                            Language::Json => ContentType::Json(body_as_raw),
                            Language::Text => ContentType::Raw(body_as_raw),
                            Language::Xml => ContentType::Xml(body_as_raw),
                            Language::Javascript => ContentType::Javascript(body_as_raw),
                        };

                        Some(request_body)
                    } else {
                        Some(ContentType::Raw(body_as_raw))
                    }
                }

what seems to be the problem, can somebody explain this? Thanks

JSON parsing error when importing postman collection

Hello. I was looking for a TUI alternative for Postman and I'm glad I found this awesome project.

I'm having some issues though. I'd like to import my collections from Postman to ATAC, but while the feature matrix lists Collection v2.1.0 as supported, I get the following error whenever trying to import the .json file:

Error:
        Could not parse JSON collection
        missing field name at line 914 column 1

I attached the json file here:
SoundCloud Web API.postman_collection.json

I'm suspecting it may be that the variables aren't handled properly?

Vim Motions

Is it planned to have Vim motions in general navigation and editing?

index out of bounds: the len is 0 but the index is 0

Hey o/

I am trying to run this http request:
image

But I keep getting this error:

index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here is my PC neofetch

image

Feature Request: Support for different modes for vim bindings

Being a vim user I was using rest.nvim, it covers my day to day usage except for few cases like file upload. So was always looking for a lightweight alternative of Postman. Thank you so much for a lightweight client.

I tried using the vim bindings provided in the repo, it unfortunately didn't work as expected, it usually causes conflicts when editing values. For example the default binding used to display help is H, Now when editing the URL, if I were to type variable name HOST, I am not able to do so because the moment I type H it opens up the help menu.

Screen.Recording.2024-05-13.at.9.04.23.AM.mov

As a workaround I can remap the help binding but that would cause conflict with some other key which I will need to remap.

So I am suggesting to implement vim modes like NORMAL and INSERT, where in INSERT mode no keys will trigger the binding action and ESC key can change the mode back to NORMAL.
Similar implementation can be found in this terminal file manager yazi

Sample clip from their demo:

Screen.Recording.2024-05-12.at.5.52.52.PM.mp4

OR

We can add an option to open the content in preferred editor using $EDITOR where user can edit the content and edited content can be conveyed back to ATAC, this will provide more flexibility and user can utilise the syntax highlighting of the editor as well.

Weird behavior when pasting a large token

When pasting a large token (in macOS at least) you can see a weird behavior after a certain delay.
The issue with this is that it results in a bad pasting as the sample token ends with SWYY, yet the pasted one in the TUI ends with mlzd

proof.mp4

[bug] unexpected panic when specifying `--directory` of a tmpfs

Issue Description

When specifying a tmpfs location as an argument to --directory, the application panics unexpectedly.

$ atac -d /tmp
parsing: /tmp/mat-debug-91998.log
thread 'main' panicked at src/app/startup/startup.rs:55:17:
unhandled file type
stack backtrace:
   0:     0x55b7dbc36f86 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h410d4c66be4e37f9
   1:     0x55b7dbc64e40 - core::fmt::write::he40921d4802ce2ac
   2:     0x55b7dbc3355f - std::io::Write::write_fmt::h5de5a4e7037c9b20
   3:     0x55b7dbc36d64 - std::sys_common::backtrace::print::h11c067a88e3bdb22
   4:     0x55b7dbc38797 - std::panicking::default_hook::{{closure}}::h8c832ecb03fde8ea
   5:     0x55b7dbc384f9 - std::panicking::default_hook::h1633e272b4150cf3
   6:     0x55b7dbc38c28 - std::panicking::rust_panic_with_hook::hb164d19c0c1e71d4
   7:     0x55b7dbc38ac9 - std::panicking::begin_panic_handler::{{closure}}::h0369088c533c20e9
   8:     0x55b7dbc37486 - std::sys_common::backtrace::__rust_end_short_backtrace::hc11d910daf35ac2e
   9:     0x55b7dbc38854 - rust_begin_unwind
  10:     0x55b7db6a8d85 - core::panicking::panic_fmt::ha6effc2775a0749c
  11:     0x55b7db6d177c - atac::app::startup::startup::<impl atac::app::app::App>::startup::hb0dbb4ca5eb46b2f
  12:     0x55b7db7742b1 - tokio::runtime::park::CachedParkThread::block_on::he0f8c1c457bbf1b1
  13:     0x55b7db75039a - tokio::runtime::context::runtime::enter_runtime::hf17d553f5e0f270a
  14:     0x55b7db78297e - tokio::runtime::runtime::Runtime::block_on::h54ffd2db751dfad6
  15:     0x55b7db7570d9 - atac::main::h26d3a8c116b6fb46
  16:     0x55b7db73e903 - std::sys_common::backtrace::__rust_begin_short_backtrace::hea90534575b9fc13
  17:     0x55b7db79200d - std::rt::lang_start::{{closure}}::h5c94db54965fe6bb
  18:     0x55b7dbc2d491 - std::rt::lang_start_internal::h4d236095b69a230b
  19:     0x55b7db7571b5 - main
  20:     0x7f2819dce24a - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  21:     0x7f2819dce305 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  22:     0x55b7db6a95d5 - _start
  23:                0x0 - <unknown>

I haven't dug any deeper. It should be easily reproducible.

Looks like it should be a quick fix. Cool project! :-)

Merci!

[ux] selecting creating request without existing collection has no effect

Issue Description

If you try to create a new request without having created a collection already, nothing happens when you press enter. This is a bit confusing.

Possible Solutions

One possible solution would be to create a default collection if this occurs. Maybe a collection with the name other.

Another approach could be to show a warning message.

Scroll doesn't work on mac

Hello,

Scrolling through the response doesn't work on mac, probably due to ctrl + arrows already having OS wide bindings

Development workflow

@Julien-cpsn I see you are pushing commit into main without using PR.

I would like to suggest you to push your code changes in feature branch, then use PR when you want to merge a feature.

I think it would be better because you could get feed back from community, or people may add reference to PR to point bugs or ask question.

Just a suggestion.

https://cli.github.com/ can help you to achieve that.

issue install on windows using cargo install

When I am trying to upgrade from 0.12 to 0.13 using cargo install atac,
I get this error:

error[E0004]: non-exhaustive patterns: `Language::Javascript` not covered
   --> C:\Users\anton.sagel\.cargo\registry\src\index.crates.io-6f17d22bba15001f\atac-0.13.0\src\app\files\postman.rs:278:50
    |
278 |                         let request_body = match language {
    |                                                  ^^^^^^^^ pattern `Language::Javascript` not covered
    |
note: `Language` defined here
   --> C:\Users\anton.sagel\.cargo\registry\src\index.crates.io-6f17d22bba15001f\parse_postman_collection-0.2.3\src\v2_1_0\mod.rs:448:1
    |
448 | pub enum Language {
    | ^^^^^^^^^^^^^^^^^
...
462 |     Javascript,
    |     ---------- not covered
    = note: the matched value is of type `Language`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
282 ~                             Language::Xml => ContentType::Xml(body_as_raw),
283 +                             Language::Javascript => todo!()
    |

[BUG] Padding glitch

Cli tooling and help menu not displaying properly:

asciicast

Got the same result from cloning and running cargo run and downloading the binary executable and running it directly.

Using:

Hit me up for details ๐Ÿ‘

Unsure about the scripting feature

Hello,

firstly I wanna say that I really like how ATAC performs. After getting used to the keybindings it was super easy!

I'm now wondering how the scripting feature works (exposed variables, etc.).

It seems that part is missing in the docs or at least I couldn't find it.
I could only find the reference to the boa engine.

Greetings,

Chris

Crash try use scroll

thread 'main' panicked at C:\Users\jjara.cargo\registry\src\index.crates.io-6f17d22bba15001f\ratatui-0.26.2\src\widgets\scrollbar.rs:569:10:โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Scrollbar area is emptylt body (301.07ms) โ”‚ Cookies โ”‚ Headers
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Unable to see all collections when creating a new request and scrolling up

Steps to reproduce:

  1. Start atac in a new directory.
  2. Create three projects, one, two, and three.
  3. Hit n to bring up the create dialog and select request. The selected collection should be three
  4. Hit up repeatedly and the selected collection will alternate between two and three instead of cycling through one, two, and three. If you hit down it will cycle correctly between all three collections.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.