شعار Iri Api

Iri Api

مؤسسة
AI-ModCon
iri-api

Use this skill to work with IRI API deployments at NERSC (https://api.iri.nersc.gov) and ALCF (https://api.alcf.anl.gov) via reproducible scripts, including Globus token lifecycle management (status, refresh, interactive login) and OpenAPI-driven endpoint execution for facility/status/account/compute/filesystem/task workflows. Trigger this skill when the task mentions IRI API, openapi.json-driven calls, authenticated endpoint access, job submission/status/cancel, file operations, task polling/cleanup, or running jobs on Perlmutter or Polaris.

نظرة عامة

الناشرAI-ModCon
المستودعgenesis-skills
اسم المهارةiri-api
النجوم
37
التفريعات
16
الملفات المرفقة
18
الترخيصBSD-2-Clause
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 18

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها AI-ModCon على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Iri Api في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/AI-ModCon/genesis-skills/tree/main/skills/amsc-skills/iri-api
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AI-ModCon/genesis-skills.git /tmp/genesis-skills
mkdir -p .claude/skills
cp -r /tmp/genesis-skills/skills/amsc-skills/iri-api .claude/skills/iri-api
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Iri Api في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Iri Api تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Iri Api بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

IRI API

Use scripted workflows. Prefer the bundled scripts over hand-written curl commands.

Deployments

SiteBase URLAuth scriptReference
NERSC (Perlmutter)https://api.iri.nersc.gov (default)scripts/token_manager.py ensure --facilities nerscreferences/NERSC.md
ALCF (Polaris)https://api.alcf.anl.govscripts/token_manager.py ensure --facilities alcfreferences/ALCF.md

Before doing any work, read the reference file for the relevant site. Do not proceed from memory.

Use the unified token manager for both sites. By default it can manage both NERSC and ALCF tokens together, but when the user is focused on one site, scope it with --facilities nersc or --facilities alcf.

--facility is a global flag on iri_api_call.py and must come before the subcommand:

bash
# Correct
python3 scripts/iri_api_call.py --facility nersc call --operation-id getProjects --ensure-token
python3 scripts/iri_api_call.py --facility alcf call --operation-id launchJob ...

# Wrong
python3 scripts/iri_api_call.py call --facility nersc --operation-id getProjects

--base-url and --openapi-url follow the same rule: they are global flags and must also come before the subcommand.

Quick Start

  1. Check token state:
bash
python3 scripts/token_manager.py status --json
  1. Ensure a usable token for authenticated endpoints:
bash
python3 scripts/token_manager.py ensure --min-ttl 300

If the IRI API still returns 401, force a fresh identity-provider login:

bash
python3 scripts/token_manager.py ensure --force-login --prompt-login --validate-iri
  1. List available operations from OpenAPI:
bash
python3 scripts/iri_api_call.py --facility nersc list-operations
python3 scripts/iri_api_call.py --facility alcf list-operations
  1. Call an endpoint by operationId:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getResources
python3 scripts/iri_api_call.py --facility alcf call --operation-id getResources

Token Management

Use scripts/token_manager.py for all token lifecycle actions.

  • Check token state:
bash
python3 scripts/token_manager.py status --json
python3 scripts/token_manager.py status --facilities nersc --json
python3 scripts/token_manager.py status --facilities alcf --json
  • Ensure usable tokens:
bash
python3 scripts/token_manager.py ensure --min-ttl 300
python3 scripts/token_manager.py ensure --facilities nersc --min-ttl 300
python3 scripts/token_manager.py ensure --facilities alcf --min-ttl 300
  • Refresh or login for selected facilities only:
bash
python3 scripts/token_manager.py ensure --facilities nersc --refresh-only
python3 scripts/token_manager.py ensure --facilities alcf --refresh-only
  • Validate the facility token against the matching API:
bash
python3 scripts/token_manager.py ensure --facilities nersc --validate-iri --validate-facility nersc
python3 scripts/token_manager.py ensure --facilities alcf --validate-iri --validate-facility alcf
  • Print selected facility access tokens:
bash
python3 scripts/token_manager.py ensure --print-token
python3 scripts/token_manager.py ensure --facilities alcf --print-token

Notes:

  • Default token file: ~/.globus/auth_tokens.json
  • The saved file preserves the full Globus token response, including other_tokens.
  • The usable IRI API bearer token is extracted from other_tokens, not the top-level Globus Auth token.
  • Required scopes are enforced by script validation.
  • globus-sdk is required for refresh/login operations.
  • If validation reports empty session_info.authentications, re-run with --force-login --prompt-login and complete the flow in a Chrome incognito window.

Endpoint Execution

Use scripts/iri_api_call.py for all API calls.

Operation Discovery

  • List all operations:
bash
python3 scripts/iri_api_call.py --facility nersc list-operations
python3 scripts/iri_api_call.py --facility alcf list-operations
  • See generated static reference: references/operations.md

Public Endpoints (No Token Required)

Examples:

bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getFacility
python3 scripts/iri_api_call.py --facility nersc call --operation-id getIncidents
python3 scripts/iri_api_call.py --facility nersc call --operation-id getResource --path-param resource_id=perlmutter

Authenticated Endpoints (Token Required)

Use --ensure-token so calls auto-refresh/login if needed.

  • Account / project context:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getProjects --ensure-token
python3 scripts/iri_api_call.py --facility alcf call --operation-id getProjects --ensure-token
  • Submit compute job (request body from file):
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id launchJob \
  --path-param resource_id=perlmutter \
  --json-file /path/to/job.json \
  --ensure-token
  • Query one job:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id getJob \
  --path-param resource_id=perlmutter \
  --path-param job_id=12345 \
  --ensure-token
  • Cancel job:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id cancelJob \
  --path-param resource_id=perlmutter \
  --path-param job_id=12345 \
  --ensure-token
  • Filesystem list/view:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id ls \
  --path-param resource_id=perlmutter \
  --query path=/global/cfs/cdirs \
  --ensure-token

python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id view \
  --path-param resource_id=perlmutter \
  --query path=/path/to/file.txt \
  --ensure-token
  • Upload file:
bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id upload \
  --path-param resource_id=perlmutter \
  --query path=/path/on/resource/target.dat \
  --upload-file /local/path/source.dat \
  --ensure-token
  • Poll task state:
bash
python3 scripts/iri_api_call.py --facility nersc call --operation-id getTasks --ensure-token
python3 scripts/iri_api_call.py --facility nersc call --operation-id getTask --path-param task_id=<task_id> --ensure-token

Shared Parameter Rules

  • Prefer --operation-id over manual --method/--path.
  • Provide required path params via repeated --path-param key=value.
  • Provide query params via repeated --query key=value.
  • Use one of:
    • --json-file /path/to/body.json
    • --json-body '{"key":"value"}'
    • --upload-file /path/to/local.file for multipart endpoints
  • For binary or large outputs, use --output-file /path/to/out.bin.
  • Use --facility nersc or --facility alcf on scripts/iri_api_call.py so the API server and bearer token selection stay aligned.

Job Construction Guidance

Before generating a compute job request, check whether the user wants any of the following:

  • A multistep job with multiple srun or mpiexec lines.
  • Additional job-control behavior that is not covered by the API attributes fields.
  • Explicit affinity or binding control beyond the basic resource request.

If any of those are needed, use a pre_launch or post_launch script to carry that logic instead of trying to force it into a single launch line or into unsupported attributes.

Rules for these scripts:

  • Do not include #SBATCH or #PBS directives in pre_launch or post_launch.
  • The scheduler directives belong in the batch script generated by the API server, not inside the pre/post scripts.
  • Put extra srun or mpiexec lines, affinity settings, environment setup, and teardown logic in those scripts as plain shell commands.
  • For NERSC-oriented launch structure and Slurm examples, use https://docs.nersc.gov/jobs/examples/.
  • For ALCF-oriented launch structure and PBS examples, use https://docs.alcf.anl.gov/running-jobs/example-job-scripts/#cpu-mpi-openmp-examples.

Reproducibility and Reference Refresh

Regenerate endpoint reference after OpenAPI updates:

bash
python3 scripts/generate_operation_reference.py \
  --openapi references/openapi.json \
  --output references/operations.md

Regenerate request payload templates:

bash
python3 scripts/generate_examples.py

Use templates from references/examples/:

  • compute-launch-job.json
  • compute-status-filters.json
  • filesystem-mkdir.json
  • filesystem-mv.json
  • filesystem-cp.json
  • filesystem-compress.json
  • filesystem-extract.json
  • filesystem-chmod.json
  • filesystem-chown.json

Example calls using generated templates:

bash
python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id launchJob \
  --path-param resource_id=perlmutter \
  --json-file references/examples/compute-launch-job.json \
  --ensure-token

python3 scripts/iri_api_call.py --facility nersc call \
  --operation-id mkdir \
  --path-param resource_id=perlmutter \
  --json-file references/examples/filesystem-mkdir.json \
  --ensure-token

Useful Endpoint Groups

  • Facility + status (public): infrastructure metadata and incident visibility.
  • Account (auth): user projects and allocation hierarchy.
  • Compute (auth): submit/update/status/cancel jobs.
  • Filesystem (auth): list/read/write/upload/download and file operations.
  • Task (auth): check asynchronous task progress and cleanup.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Iri Api؟

Use this skill to work with IRI API deployments at NERSC (https://api.iri.nersc.gov) and ALCF (https://api.alcf.anl.gov) via reproducible scripts, including Globus token lifecycle management (status, refresh, interactive login) and OpenAPI-driven endpoint execution for facility/status/account/compute/filesystem/task workflows. Trigger this skill when the task mentions IRI API, openapi.json-driven calls, authenticated endpoint access, job submission/status/cancel, file operations, task polling/cleanup, or running jobs on Perlmutter or Polaris.

لماذا تستخدم Iri Api على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Iri Api عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Iri Api في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/AI-ModCon/genesis-skills/tree/main/skills/amsc-skills/iri-api. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Iri Api؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Iri Api؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Iri Api معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Iri Api مجانية؟

نعم. نشرها AI-ModCon على GitHub بموجب ترخيص BSD-2-Clause. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇