Git Product home page Git Product logo

post-turtle's Introduction

build status License

post-turtle ๐Ÿข

post-turtle is a simple shell based Postman alternative written in TypeScript. It is designed to help developers make quick API requests on the fly without having to use something as heavy as Postman

Install

npm install -g post-turtle

Features

Interactive Mode

pt called without any arguments will trigger an interactive command line interface. You can use this interface to create, update or delete existing requests, as well as triggering ones that have been created.

Screen recording of a request being created and triggered interactively

Non-interactive Mode

Requests that have been created using interactive mode are stored in your home directory in a file called .post-turtle-request. Once you have created some requests, these requests will be available to call non-interactively using pt call <slug>

Screen recording of a request being created and triggered non-interactively

Parameters

All request fields can contain 'parameters' by using a simplified handlebars syntax. If a request contains parameters in the form {{ name : description }}, it will have the following effect

  • Triggering the request via interactive mode will produce an input field for each parameter
  • The command generated by pt call will also include a required --option for that parameter

Screen recording of a request with params being created and triggered in interactive mode

About This Package

This package is written in TypeScript using a combination of ink to allow me to write a great responsive CLI experience using my React skills and commander.js to provide a nice non-interactive CLI setup

post-turtle's People

Contributors

benwainwrightcinch avatar semantic-release-bot avatar benwainwright avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

post-turtle's Issues

Delete request on pressing 'd'

At the present time, the help text says that pressing 'd' deletes a request. It doesn't do that yet though.

  • This feature would require some kind of confirmation popup

Add request 'arguments'

pt has a simple mechanism to make predefined HTTP requests. What would be really powerful if there was a way of defining 'arguments' to be interpolated into those requests.

For example:

What if fields could contain handlerbar syntax ({{ fieldName }}), and if they did - when you trigger a request a box pops up asking you to fill in the values for those fields.

Could also use this to generate --options on the command line

End to end testing

I'd quite like to set up some actual end to end tests that actually sets up some infrastructure, build the package, runs the actual command from a real shell, and calls real infrastructure to properly test it.

Polish the 'request line'

At present, when the 'request line' component receives a response, it puts the response body at the bottom of the card, fed through a syntax highlighting package. Still need to really think about the presentation of that component, because its a little rough and ready at the present time

Flaky tests

Unfortunately, things like "waitFor" do not work with ink-testing-library so I have to rely on simple time delays. This is obviously a bit of an anti-pattern and has meant the tests are a bit flaky

Unit test coverage

When I started writing this package I was still exploring how 'ink' worked so wasn't really writing tests. I've retrospectively written a bunch of tests now I'm up to speed, but I'd like to get things to a place where its got 90% or more test coverage

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.