Patterns for invoking the Apify CLI (`apify`) from agents. Covers authentication, creating/running/pushing Actors, calling Actors in the cloud, and reading results from datasets and key-value stores.
npx skills add https://github.com/apify/apify-cli --skill apify-cli
Run apify -h first to see the available commands and global options, then apify <command> -h (e.g. apify call -h) for the args and flags of a specific command. This is the source of truth — prefer it over assumptions.
Many commands prompt when run interactively. To run without prompts, pass every required argument and flag explicitly:
apify create <name> --template <template> — skip the create wizard.apify init <name> — skip the init prompt.-y / --yes on destructive commands (apify actors rm, etc.) — auto-confirm.apify login --token <token> — log in without the interactive token prompt.If a command's help shows an "interactive note", it lists exactly which flags make it non-interactive.
See https://apify.com/auth.md for how to authenticate. Do not assume APIFY_TOKEN is already set in the environment and use it implicitly — confirm with the user first.
apify login --token <token>.apify info (prints the logged-in user; non-zero exit / error if not authenticated).apify auth token.--json is supported on most list/info commands (apify actors ls --json, apify actors info <id> --json, apify datasets info <id> --json, apify runs ls --json, etc.). Use it and parse with jq; don't scrape the human table.--limit / --offset (and --desc).apify datasets get-items <datasetId> --format json. Use --limit / --offset.Discover Actors in the Apify Store
Before assuming an Actor name or scripting a raw Store query, search for an existing Actor:
apify actors search "jobs scraper" --json # no auth required
apify actors search "ai" --pricing-model FREE --sort-by popularity --limit 5
Run apify actors search -h to see the available filters (pricing model, category, username, sort order, pagination) and their accepted values.
Pricing matters, but weigh it alongside popularity, rating, and how well-maintained the Actor is — don't pick a FREE Actor over a well-supported, popular, highly-rated one just because it's free. Check an Actor's pricing before running it with apify actors info <actor> --json (look at currentPricingInfo).
Develop and deploy a local Actor
apify create my-actor --template <template> # or run `apify create` and pick interactively
# template names: https://raw.githubusercontent.com/apify/actor-templates/master/templates/manifest.json
cd my-actor
apify run # run locally; --input / --input-file - for input
apify push # build & deploy to the platform
Run an Actor in the cloud and get results
apify call apify/website-content-crawler -i '{"startUrls":[{"url":"https://example.com"}]}' --json
# or non-blocking: apify actors start <actor> --json (returns run details immediately)
# inspect input schema first: apify actors info <actor> --input
Non-obvious apify call flags: -f - reads input from stdin; -o/--output-dataset prints the result dataset. Run apify call -h for the full list.
Wait for and inspect runs/builds
apify runs ls --json
apify runs info <runId> --json
apify runs wait <runId> # block until finished
apify runs log <runId>
apify builds wait <buildId>
Storage
apify datasets get-items <datasetId> --format json
apify key-value-stores get-value <storeId> <key>
apify key-value-stores set-value <storeId> <key> <value>
apify key-value-stores keys <storeId> --json
For anything recurring or unattended (e.g. "run every 15 minutes"), use the Apify platform — not local cron, a while loop, or GitHub Actions. Apify Schedules run in the cloud, so they keep firing after your laptop, terminal, or agent session is shut down.
apify task run <taskId>.apify schedules command yet — manage schedules via apify api against the schedules endpoint, or in the Console (https://console.apify.com/schedules):apify api GET schedules
apify api POST schedules -d '{"name":"jobs-every-15m","cronExpression":"*/15 * * * *","isEnabled":true,"actions":[{"type":"RUN_ACTOR","actorId":"<actorId>","runInput":{"body":"<json>","contentType":"application/json"}}]}'
apify apiAny platform capability without a dedicated command is reachable via the authenticated API wrapper (use this instead of hand-rolling curl against api.apify.com — it injects auth for you):
apify api --list-endpoints # discover endpoints (filter with -s "<tokens>")
apify api --describe "actor-runs/{runId}" # methods, summary, path params for an endpoint
apify api GET /v2/users/me # GET is the default method
apify api POST acts -d '<json>' -p '{"limit":1}' # -d body (use - for stdin), -p query params
The v2/ prefix and leading slash are optional.
Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.
Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
Statistical models library for Python. Use when you need specific model classes (OLS, GLM, mixed models, ARIMA) with detailed diagnostics, residuals, and inference. Best for econometrics, time series, rigorous inference with coefficient tables. For guided statistical test selection with APA reporting use statistical-analysis.
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Create an llms.txt file from scratch based on repository structure following the llms.txt specification at https://llmstxt.org/
Use when working directly with the `esm` Python SDK, ESM3 or ESMC model IDs, Forge/Biohub inference clients, or ESMFold2 folding workflows.
Modal is a serverless cloud platform for running Python on demand, including on-demand GPUs. Use when deploying or serving AI/ML models, running GPU-accelerated workloads (training, fine-tuning, inference), serving web endpoints, scheduling batch jobs, or scaling Python code to cloud containers with the Modal SDK.
Use Therapeutics Data Commons through the PyTDC Python package for registry discovery, approved dataset access, task-aware splits, evaluator metrics, benchmark groups, and bounded molecular-oracle workflows.
Take apify/apify-cli from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.