بنقرة واحدة
recipe-test-crud
Test full CRUD cycle (Create, Read, Update, Delete) on any API resource
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Test full CRUD cycle (Create, Read, Update, Delete) on any API resource
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Step-by-step workflow to explore and test an unfamiliar API
Configure authentication: inline flags, env vars, persistent profiles
Core spec2cli usage: load specs, run commands, format output
Use built-in API templates, search, and manage custom APIs
| name | recipe-test-crud |
| version | 1.0.0 |
| description | Test full CRUD cycle (Create, Read, Update, Delete) on any API resource |
| metadata | {"openclaw":{"category":"recipe","domain":"api","requires":{"bins":["spec2cli"],"skills":["spec2cli-basics","spec2cli-auth"]}}} |
Use this workflow to verify that Create, Read, Update, and Delete operations work correctly for an API resource.
--agent-help first)spec2cli --spec <spec> --output table <group> list
Note the current count and existing IDs.
spec2cli --spec <spec> --token <TOKEN> --output json <group> create --<required-fields>
Save the returned ID. Verify with:
spec2cli --spec <spec> --output json <group> get --id <NEW_ID>
Check: Does the response match what you sent?
spec2cli --spec <spec> --token <TOKEN> --output json <group> update --id <NEW_ID> --<field> <new-value>
Verify the update:
spec2cli --spec <spec> --output json <group> get --id <NEW_ID>
Check: Is the field updated? Are other fields preserved?
spec2cli --spec <spec> --output table <group> list
Check: Does the new resource appear? Is the count incremented?
spec2cli --spec <spec> --token <TOKEN> --quiet <group> delete --id <NEW_ID>
echo "Exit code: $?"
Check: Exit code 0 = success.
spec2cli --spec <spec> --output json <group> get --id <NEW_ID>
Check: Should return 404.
SPEC="./examples/todo-api/openapi.yaml"
BASE="http://localhost:4000"
TOKEN="test-token-123"
# List
spec2cli --spec $SPEC --base-url $BASE --output table todos list
# Create
spec2cli --spec $SPEC --base-url $BASE --token $TOKEN --output json todos create --title "Test CRUD" --priority high
# Read (use the returned ID)
spec2cli --spec $SPEC --base-url $BASE --output json todos get --id 8
# Update
spec2cli --spec $SPEC --base-url $BASE --token $TOKEN --output json todos update --id 8 --status done
# Delete
spec2cli --spec $SPEC --base-url $BASE --token $TOKEN --quiet todos delete --id 8
# Verify 404
spec2cli --spec $SPEC --base-url $BASE --output json todos get --id 8
--verbose on any step to see the raw HTTP request/response--output json | jq .id to extract the ID after create