1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# Quest Configuration Examples
# This file demonstrates all the features and capabilities of Quest
# ============================================================================
# Reusable Defaults with YAML Anchors
# ============================================================================
# JSONPlaceholder API defaults (free fake API for testing)
x-jsonplaceholder:
base_url: https://jsonplaceholder.typicode.com
accept: application/json
timeout: 30s
user_agent: quest-cli/0.1.0
# HTTPBin defaults (request inspection service)
x-httpbin:
base_url: https://httpbin.org
accept: application/json
timeout: 20s
user_agent: quest-cli/0.1.0
# Production API defaults (example with auth)
x-production:
base_url: ${API_URL:-https://api.example.com}
bearer: "${API_TOKEN}"
accept: application/json
timeout: 30s
header:
- "X-API-Version: v1"
# ============================================================================
# Quest Definitions
# ============================================================================
quests:
# ==========================================================================
# JSONPlaceholder Examples - Simple GET Requests
# ==========================================================================
get-users:
<<: *jsonplaceholder
method: get
path: /users
# Returns list of all users
get-user:
<<: *jsonplaceholder
method: get
path: /users/1
# Returns single user with id=1
get-posts:
<<: *jsonplaceholder
method: get
path: /posts
# Returns all posts
get-user-posts:
<<: *jsonplaceholder
method: get
path: /posts
params:
- userId=1
# Returns posts by user with id=1
# ==========================================================================
# Query Parameters Examples
# ==========================================================================
search-posts:
<<: *jsonplaceholder
method: get
path: /posts
params:
- userId=1
- _limit=5
# Limit results to 5 posts from user 1
filter-comments:
<<: *jsonplaceholder
method: get
path: /comments
param: # 'param' and 'params' are interchangeable
- postId=1
- _limit=3
# Get first 3 comments for post 1
# ==========================================================================
# POST Requests with JSON Body
# ==========================================================================
create-post:
<<: *jsonplaceholder
method: post
path: /posts
json: |
{
"title": "My New Post",
"body": "This is the content of my post.",
"userId": 1
}
# Creates a new post (simulated)
create-user:
<<: *jsonplaceholder
method: post
path: /users
json: '{"name": "John Doe", "email": "john@example.com", "username": "johndoe"}'
# Creates a new user with inline JSON
create-comment:
<<: *jsonplaceholder
method: post
path: /comments
json: |
{
"postId": 1,
"name": "Great post!",
"email": "commenter@example.com",
"body": "This is a very insightful post. Thanks for sharing!"
}
# ==========================================================================
# PUT/PATCH Requests - Updates
# ==========================================================================
update-post:
<<: *jsonplaceholder
method: put
path: /posts/1
json: |
{
"id": 1,
"title": "Updated Title",
"body": "Updated content",
"userId": 1
}
# Full update of post 1
patch-post:
<<: *jsonplaceholder
method: patch
path: /posts/1
json: '{"title": "Partially Updated Title"}'
# Partial update of post 1
# ==========================================================================
# DELETE Requests
# ==========================================================================
delete-post:
<<: *jsonplaceholder
method: delete
path: /posts/1
# Deletes post with id=1 (simulated)
# ==========================================================================
# HTTPBin Examples - Request Inspection & Testing
# ==========================================================================
httpbin-get:
<<: *httpbin
method: get
path: /get
params:
- foo=bar
- baz=qux
# Returns the GET request details including query params
httpbin-post:
<<: *httpbin
method: post
path: /post
json: '{"test": "data", "number": 42}'
# Returns the POST request details including body
httpbin-headers:
<<: *httpbin
method: get
path: /headers
header:
- "X-Custom-Header: custom-value"
- "X-Request-ID: 12345"
# Returns all headers sent in the request
httpbin-auth:
method: get
url: https://httpbin.org/basic-auth/user/passwd
basic: user:passwd
# Tests basic authentication
httpbin-bearer:
method: get
url: https://httpbin.org/bearer
bearer: "my-secret-token"
# Tests bearer token authentication
httpbin-delay:
<<: *httpbin
method: get
path: /delay/2
timeout: 5s
# Returns after 2 second delay (tests timeout handling)
httpbin-status:
<<: *httpbin
method: get
path: /status/404
# Returns specified HTTP status code
httpbin-redirect:
<<: *httpbin
method: get
path: /redirect/3
location: true
max_redirects: 5
# Tests redirect following (3 redirects)
httpbin-cookies:
<<: *httpbin
method: get
path: /cookies/set
params:
- sessionid=abc123
- userid=42
location: true
# Sets cookies and returns them
httpbin-image:
<<: *httpbin
method: get
path: /image/png
output: test-image.png
# Downloads a PNG image
httpbin-json:
<<: *httpbin
method: get
path: /json
# Returns sample JSON data
httpbin-user-agent:
<<: *httpbin
method: get
path: /user-agent
user_agent: "MyCustomAgent/1.0"
# Returns the User-Agent string
# ==========================================================================
# Environment Variables Examples
# ==========================================================================
env-example:
method: get
url: ${BASE_URL:-https://jsonplaceholder.typicode.com}/users
bearer: "${API_TOKEN}"
timeout: ${TIMEOUT:-30s}
# Uses environment variables with default values
# Set in .env file or environment:
# BASE_URL=https://api.example.com
# API_TOKEN=your-secret-token
# TIMEOUT=60s
# ==========================================================================
# Production API Examples (with authentication)
# ==========================================================================
prod-get-data:
<<: *production
method: get
path: /data
params:
- limit=100
- offset=0
# Authenticated GET request to production API
prod-create-resource:
<<: *production
method: post
path: /resources
json: |
{
"name": "New Resource",
"type": "document",
"metadata": {
"created_by": "quest-cli",
"tags": ["important", "review"]
}
}
# Authenticated POST request with complex JSON
# ==========================================================================
# Advanced Examples
# ==========================================================================
# Multiple headers and query params
complex-request:
<<: *httpbin
method: post
path: /post
header:
- "X-Request-ID: ${REQUEST_ID:-default-id}"
- "X-Client-Version: 1.0.0"
- "X-Environment: development"
params:
- debug=true
- verbose=true
json: |
{
"action": "process",
"data": {
"items": [1, 2, 3, 4, 5],
"options": {
"parallel": true,
"timeout": 30
}
}
}
# Download file with custom output
download-example:
<<: *httpbin
method: get
path: /json
output: downloaded-data.json
compressed: true
# Downloads and saves response to file
# Verbose debugging request
debug-request:
<<: *httpbin
method: post
path: /post
json: '{"debug": true}'
verbose: true
# Shows detailed request/response info with headers
# Request with timeout and retry settings
slow-request:
<<: *httpbin
method: get
path: /delay/1
timeout: 5s
connect_timeout: 2s
# Tests connection and request timeouts
# Insecure HTTPS request (skip TLS verification)
insecure-request:
method: get
url: https://self-signed.badssl.com/
insecure: true
timeout: 10s
# Only use insecure flag for testing/development!
# ============================================================================
# Usage Examples
# ============================================================================
#
# Run any quest by name:
# quest go get-users
# quest go create-post
# quest go httpbin-headers
#
# Override quest file settings from CLI:
# quest go get-users --param _limit=5
# quest go create-post --bearer MY_TOKEN
# quest go httpbin-post --json '{"override": "data"}'
#
# Use environment variables:
# quest -e .env go env-example
# quest -e .env.production go prod-get-data
#
# Combine quest with CLI options:
# quest go get-users -p _limit=10 -p _page=2
# quest go httpbin-headers -H "X-Extra: value" -v
#
# Direct requests (without quest file):
# quest get https://jsonplaceholder.typicode.com/users
# quest post https://httpbin.org/post --json '{"test": "data"}'
# quest get https://api.example.com/data --bearer TOKEN -p limit=100