Skip to content

Napful is a Rust-based CLI tool designed for developers to easily store, manage, and execute HTTP requests.

License

Notifications You must be signed in to change notification settings

thiagokoster/napful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Napful

Napful is a command-line tool designed to help developers interact with HTTP APIs by running predefined requests.

Current features

  • List Requests: Easily list all requests saved in the requests folder.
  • Execute Requests: Run a specific request by name.

Getting Started

To get started, you can clone the repository and compile the project using Cargo:

git clone https://github.com/thiagokoster/napful
cd napful
cargo build --release

Usage

Request File format

Requests are defined in .txt files within the requests folder. The file format follows:

# Request name
HTTP_METHOD(GET or POST) URL 
Header1: value
Header2: value

Body (if applicable)

Here is an example:

# Get posts
GET https://jsonplaceholder.typicode.com/posts

# Create post
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
Accept: application/json
   
{
  "title": "foo",
  "body": "bar"
}

Listing Requests

To list all the requests from the requests folder, use the following command:

napful list

Executing Requests

To execute a request, use:

napful run "Get posts"

Napful will omit response headers by default. They can be enabled --headers flag if necessary

napful run "Get posts" --headers

You can get the response body formatted by running the request with the --formated flag. This is especially useful for improving the readability of JSON responses.

napful run "Get posts" --formatted

License

Napful is released under the MIT License. See the LICENSE file for more details.

About

Napful is a Rust-based CLI tool designed for developers to easily store, manage, and execute HTTP requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published