CLI tools for API development
Squawk provides a simple CLI tool for running predefined API requests in your application and seeing the output directly in the command line.
Download the latest squawk binary and place it in your
project root.
Define your API requests in an api.squawk file:
endpoint {
url = "https://example.com"
}Run your endpoint with:
./squawk
Name multiple endpoints:
endpoint {
name = "get-widgets"
description = "List all widgets"
url = "https://example.com/widgets"
}
endpoint {
name = "create-widget"
description = "Create a new widget"
url = "https://example.com/widgets"
method = POST
body = """
{
"name": "Example"
}
"""
}Run a specific endpoint:
./squawk get-widgets
List all endpoints:
./squawk --list
Include additional configurations:
include("samples/example.squawk")Namespace your files:
namespace = "samples"
endpoint {
name = "get"
url = "https://example.com"
}Run with:
./squawk samples:get
Property files can be included from a script:
loadProperties("environment.properties")
or overridden with the command line:
./squawk --properties environment.properties
Once loaded, they can be used in any script:
endpoint {
url = "${property("baseurl")}/widgets"
}