The examples below assume you have logged in and selected an Organization. Replace IDs with values from your actual results.
List and search#
stly apis list --fields id,name,summary
stly apis list --q Orders --page 1 --per-page 50List commands that support --q search fields such as the name, summary, and description by case-sensitive partial match. The searched fields differ by command, so check them with stly schema <resource> list.
When you specify --page and --per-page, the response includes pagination (page, per_page, has_more).
To search several Catalogs at once, use the Catalog-wide search.
stly catalog search --q ordersCreate#
If you do not know the command, go through search → schema → dry-run → run.
stly cli search "API create"
stly schema apis create
stly apis create --input api.json --dry-run
stly apis create --input api.jsonEdit#
An edit sends the full input. Look up the detail to check the current values and the etag, then create an input file with your changes applied.
stly apis get 4pkKFh2ojXs
stly apis update 4pkKFh2ojXs --input api-update.json --if-match '"api-json3-4pkKFh2ojXs-r1"'Example api-update.json:
{"name": "Orders API", "summary": "Create, look up, and cancel orders", "description": "Public API provided by the orders Service."}If you get a 412 error, follow the steps in Concurrent edit conflicts.
Delete#
A delete also needs the etag from the detail lookup. On success, status is 204 and data is null.
stly apis delete 4pkKFh2ojXs --if-match '"api-json3-4pkKFh2ojXs-r2"'Call the API directly#
For requests without a dedicated command, use stly api to call a public API path directly. It authenticates the same way as other commands.
stly api /api/me --method GET
stly api /api/apis --method GETYou can send a request body with --input and an ETag with --if-match. The output format is the same as other commands.
Use from an AI Coding Agent#
Give your AI Coding Agent the following rules so it can use stly safely.
- Find commands with
stly cli searchand check input withstly schema. - Check commands that change records with
--dry-runfirst. - Before editing or deleting, look up the detail and pass its
etagwith--if-match. - Check the exit code and the
outcomein stderr, and if it isunknown, look the entry up before sending again.