Skip to content

Define HTTP/gRPC requests in JSON configs once – run them anytime. Chaining, auth handling (like JWT auto-substitution), and response validation – without terminal fuckery

License

Notifications You must be signed in to change notification settings

Votline/Gurl-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gurl-cli 🚀

Go Version License: MIT HTTP Ready gRPC Ready Protobuf Support JSON Configs Response Chaining Config Reuse

Supercharged curl/grpcurl with config chaining and response templating.
Stop memorizing complex flags — save them as reusable JSON configs and hit run.


Why this exists

Typing long curl/grpcurl incantations sucks. Gurl turns them into tiny, reusable configs you can chain:

  • HTTP → HTTP, gRPC → gRPC, or mix them.
  • Responses from earlier steps can feed later steps via simple placeholders.
  • No curl/grpcurl required — native Go implementation using:
    • net/http for HTTP requests
    • google.golang.org/grpc for gRPC calls
    • github.com/jhump/protoreflect for protobuf introspection

AND

  • 🔁 Response Placeholders Everywhere - Use {RESPONSE} in URLs, headers, and bodies
  • 🔄 Repeated Configs - Duplicate and modify existing configs with replace fields
  • ♻️ Loop Processing - All placeholders in a request are now properly processed
  • 🆔 Automatic ID Management - IDs are now enforced to prevent conflicts

Quick Start

# 1) Generate a starter config
gurl-cli --config-create --config=my_config

# 2) Edit it with your endpoints
vim my_config.json

# 3) Run it
go run main.go --config=my_config.json

Example: Chaining Requests

[
  {
    "id": "1",
    "type": "http",
    "url": "http://localhost:8080/api/auth",
    "method": "POST",
    "body": {"user": "test", "pass": "test"},
    "response": "-"
  },
  {
    "id": "2", 
    "type": "http",
    "url": "http://localhost:8080/api/data/{RESPONSE id=1 json:user_id}",
    "method": "GET",
    "headers": {
      "Authorization": "Bearer {RESPONSE id=1 json:token}"
    },
    "response": "-"
  }
]

Example: Repeated Configs

{
  "type": "repeated",
  "repeated_id": "1",
  "replace": {
    "user": "different_user"
  }
}

📚 Documentation

  • Full Guide: See GUIDE.md for detailed examples and advanced features
  • License: This project is licensed under MIT
  • Third-party Licenses: The full license texts are available in the licenses/

About

Define HTTP/gRPC requests in JSON configs once – run them anytime. Chaining, auth handling (like JWT auto-substitution), and response validation – without terminal fuckery

Topics

Resources

License

Stars

Watchers

Forks

Languages