Skip to main content

nx-cloud-api

Query the read-only Nx Cloud Public API for workspace data with `npx nx-cloud api`. Use this skill when a user asks to inspect or retrieve CIPEs, pipelines, run groups, runs, tasks, workflows, agents, task statistics, flaky tasks, cache data, CI compute or credit estimates, or API endpoint details. Use this skill before any Nx Cloud API call. It covers endpoint discovery, link navigation, pagination, asset downloads, and error recovery. Do not use it for live CI monitoring.

v1.0.0New

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install nx-monorepo-nx-cloud-nx-cloud-api
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/nx-monorepo-nx-cloud-nx-cloud-api/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiCryptographically signed by the skills-hub.ai distributor key at publish time.
Signed
0Save

Instructions

Nx Cloud API

Answer a defined workspace-data question with npx nx-cloud api, the read-only
Nx Cloud Public API command. This is an API access skill, not a report generator
or configuration editor. Run every command from the workspace root so the
command finds nx.json, or pass --nxCloudId <id> to name the workspace
(see Authentication).

Run npx nx-cloud api --help (or npx nx-cloud api alone) once for syntax and
options. This skill covers the workflow around it.

All output is JSON. stdout carries only the response data. stderr carries one
JSON object per line: {"error": ...}, {"output": ...}, and, with -i or
NX_VERBOSE_LOGGING, {"response": ...} and {"log": ...}. The one exception
is an asset download, whose raw bytes go to the -o file.

Non-negotiable rules

  • Discover endpoints from the live spec. Use npx nx-cloud api --list-operations
    to find a route and npx nx-cloud api --describe <operationId | path | link>
    for its parameters, response fields, and error statuses. Both show what an
    operation returns: list (the wrapped list below), object (the response
    body), or file (an asset download). Do not use
    remembered routes, fields, filter names, or enum values.
  • Start at cipes and follow returned links values. Do not build child URLs by
    hand or use an internal workflow ID as a route parameter. When you must
    address an entity by ID, use the {placeholder} path from --describe and
    fill it with -p name=value. Never paste an ID into a path: IDs are raw and
    can contain / or : (task IDs like @scope/app:build).
  • Start with one filtered page. Ask for a workspace, scope, or time range when
    they are missing. Do not collect history by default.
  • Read the operation description from --describe. It states server limits that
    the command does not enforce.
  • Do not use this skill to poll or monitor live CI.
  • Only read. --list-operations also lists actions (method: POST, such as
    ci/{ciExecutionId}/rerun); take one only when the user asks for it.

Authentication

npx nx-cloud api authenticates for you; do not read credentials out of
nxcloud.ini or call the API with curl. It sends the first available of:

  1. A workspace token in NX_CLOUD_ACCESS_TOKEN (or NX_CLOUD_AUTH_TOKEN). When
    one is set, the command uses it alone and ignores any stored login.
  2. The user's OAuth login from npx nx login, refreshed as needed.
  3. A personal access token stored in nxcloud.ini by an older login.

A login or personal access token also needs the workspace's Nx Cloud ID, sent
as Nx-Cloud-Id. The command reads it from nxCloudId in nx.json;
--nxCloudId <id> overrides it, so you can query a workspace you are a member
of without its checkout. The command still reads an nx.json in the current
directory, so outside a checkout run it from a scratch directory holding an
nx.json of {}, with NX_CLOUD_API set to the workspace's Nx Cloud host
when it is not https://cloud.nx.app. A workspace token always reads its own
workspace and ignores the ID.

If you must call the API without the command, the headers differ per
credential, and an OAuth access token is not a bearer token:

CredentialHeaders
Workspace (CI) tokenAuthorization: Bearer <token>
OAuth access tokenNx-Cloud-OAuth-Access-Token: <token> and Nx-Cloud-Id: <id>
Personal access tokenNx-Cloud-Personal-Access-Token: <token> and Nx-Cloud-Id: <id>

Cache boundary

The API returns recorded task and run fields. It does not query the local Nx
target. cacheEnabled describes the recorded run. cacheable describes the
recorded task. Neither value identifies targetDefaults, an inferred target,
or Vite, ESLint, or another tool-native cache.

Do not infer cache: false from an absent project property. For cache causes,
target settings, inputs, outputs, or a configuration change, use
nx-cloud-cache-investigator. API data alone cannot justify a cache or inputs
pull request.

Quick workflow

npx nx-cloud api --describe cipes

# Save one bounded page to a scratch file, then project only what you need.
dir="$(mktemp -d)"
npx nx-cloud api cipes \
  -f createdAfter=2026-08-01T00:00:00Z \
  -f statuses=FAILED -f statuses=CANCELED \
  -o "$dir/cipes.json"
echo "exit $?"
jq '{pageLimitReached, nextCursor, items: [.items[] | {id, status, createdAt, links}]}' "$dir/cipes.json"

# Follow a link from a previous response as-is.
npx nx-cloud api "<link from a previous response>" -o "$dir/next.json"

# Address an entity by ID only through a path parameter.
npx nx-cloud api 'runs/{runId}/tasks' -p runId="$run_id" -o "$dir/tasks.json"

Pass a links.* value exactly as returned; it may already carry query
parameters, and -f adds more. Full URLs are accepted only on the configured
Nx Cloud host. That includes app links such as https://cloud.nx.app/cipes/<id>,
which resolve like the bare path cipes/<id>.

Keep API output compact

To preserve context, write every live data response to a file with -o (files are created
owner-only) in a scratch directory outside the workspace. Give the file an
extension. A name without one gets .json, .ndjson, or the download's own
(such as .tar.gz), and the command reports the final path on stderr as
{"output": {"file": "..."}}. Create the scratch directory with mktemp -d,
and read a question-specific jq projection. Do not let
a raw collection print into the conversation unless the user asks for it.
Choose projected fields from --describe. For one row, select it first, then
project only the needed fields. Delete saved data when the task is done unless
the user asks to keep it.

--describe output is usually small. Pipe it through jq only when you need
part of a large operation.

Exit codes and errors

Always check the exit code. Every failure prints one record on stderr, and the
command adds no recovery hints; do not hide stderr with 2>/dev/null:

{"error":{"type":"http","message":"HTTP 409 Conflict","status":409,"url":"...","body":{"code":"not_terminal","message":"..."}}}

type is usage, http, network, response (an answer the command cannot
use), or output (an unwritable -o file). For http, body is the server's
error body, parsed when it is JSON and absent when it is empty. Exit 4 and 5
bodies carry a stable code (except 401 and an empty-body 429); branch on
.error.body.code, not on the prose message.

ExitHTTPcodeNext action
1——Usage, network, response, or output error; read .error.type and .error.message on stderr. Fix the flags, path, or -p values, or check the host (NX_CLOUD_API or nxCloudUrl), proxy, and VPN.
4400invalid_parameterRun npx nx-cloud api --describe <same path> and fix the named parameter. Unknown query parameters are always rejected.
4400invalid_limit, invalid_timestamp, invalid_date_range, invalid_filterFix the value or filter combination named in message, using --describe for formats and limits.
4400invalid_cursorA cursor is valid only for the list that minted it. Resume with the same path and filters, or restart without cursor.
4401none (body is plain text)When NX_CLOUD_ACCESS_TOKEN is set, nx-cloud api sends that token alone, so the 401 means the token is invalid or has no access to this workspace; tell the user. Otherwise nx-cloud api sends the user's Nx Cloud login for this host with nxCloudId from nx.json: run npx nx-cloud login --status from the workspace root, and when it does not report the user as logged in, ask them to run npx nx login, which signs in by approving a code in the browser, and to follow what it prints.
4403plan_not_allowedThe organization's plan does not include the Nx Cloud Public API. Tell the user; do not retry or use another person's token.
4404not_foundThe ID in the path or in a parent-ID filter (cipeId, runGroup, stepId, agentName) is wrong. An unknown parent is never an empty result. Recheck the ID, or follow a link instead.
4404none (no body)The path matched no route, usually because a raw ID containing / (such as @scope/app:build) was pasted into it. Use the {placeholder} path with -p, or follow links, and check the path with --describe. For a batch read or view, the cluster may not have it yet; see Bulk reads.
4409not_terminalThe entity is still running. This is not a failure; its data is not final yet. See same-session retry below.
4429rate_limit_exceeded or no bodyThe organization-wide quota is exhausted. The command already retried 3 times honoring Retry-After. Back off, narrow filters, and make fewer requests.
5503data_api_at_capacity, query_deadline_exceeded, audit_log_unavailable, rate_limit_unavailableNo data was returned. The command already retried 3 times. Back off before one more attempt; for query_deadline_exceeded, narrow the time range or filters.
55xxotherRetry once after a short wait. Keep the endpoint, filters, time range, and traceId from the body for support.

--list-operations, --describe, and --print-api-spec do not need
credentials, so they succeed even when data requests fail with 401.

Do not alter workspace configuration or credentials without the user's explicit
request.

Same-session retry

For a 409 not_terminal on a known request, arrange at most one same-session
wake after the entity is expected to finish. Preserve the link and filters.
Stop at a terminal response.

Pagination

Every list response is wrapped, even a single page:
{source, pagesFetched, fetchedItemCount, pageLimitReached, nextCursor, items}.
source records the origin, endpoint, and original query. Read rows with
jq '.items[]'. Non-list responses are returned as-is.

The list is complete only when the exit code is 0 and nextCursor is null.
pageLimitReached: true means --pages stopped the run while more results
exist. To continue, rerun the same path and filters with
--cursor <nextCursor>, or state that the data is incomplete. The output's
source.query records the cursor it started from.

The command fetches one page by default. Raise --pages deliberately and keep
it small; prefer narrower filters over more pages. Do not fetch many
flaky-tasks or task-stats pages without a narrow filter. Leave the page size
alone unless needed: every page costs one unit of the organization's rate
limit, and --page-size (which sets limit, max 500) only helps when raised.

If a later page fails, the command still prints what it fetched, with
nextCursor at the failed page, and exits 4 or 5. Handle the error, then
resume from that cursor.

--format ndjson prints only the rows, one per line, with no metadata. Nothing
in its output says whether more pages exist, and it records no resume cursor. It prints each page as it is retrieved which can matter for responsiveness or very large responses.
Use it only when completeness does not matter; otherwise use the default JSON
output.

For multi-range extraction, task or log assets, or a calculation, read
references/extraction-and-calculation.md
first.

Bulk reads

A batch read or a view answers in one request what otherwise takes one request
per run or task, and costs one unit of the rate limit whatever it returns. Use
one whenever you would otherwise loop over runs or tasks:

  • Why a pipeline failed, or where it stands: the view
    views/v0/pipeline-status/{cipeId} returns the CIPE, its run groups and runs,
    and the failed and timed-out tasks of up to 25 failed or canceled runs, under
    resources. complete: false means it left something out; continue a list
    at its resource with its nextCursor, and read the failed tasks of the runs
    missing from failedTasks at their links.tasks.
  • The tasks of many runs: batch/v0/run-tasks, with -f run=<id> repeated
    for up to 25 runs. Each item holds one run's first page in tasks.items, or
    its error; the task list's filters apply to every run. Continue a run at its
    links.tasks with the same filters.
  • The logs of many tasks: batch/v0/task-logs, with
    -f task=<runId>:<taskId> repeated for up to 25 tasks from any runs. Each
    item holds a signed url of the log asset, or its error. nx-cloud api
    does not fetch that URL; download it as it is (curl -sfL "$url" -o <file>)
    and decode it as an asset (see the reference below). It takes no batchId or
    attempt; read another batch's or attempt's log at the task's own asset link.
  • batch/v0/task-dependencies and batch/v0/task-dependents do the same for
    the task graph edges of up to 25 tasks.

An item's error fails only that run or task, with the status and code its
single-resource route would answer. Check each with --describe for its limits.

npx nx-cloud api 'views/v0/pipeline-status/{cipeId}' -p cipeId="$cipe_id" -o "$dir/status.json"
jq '{complete, cipeStatus,
     runGroups: [.resources.runGroups.items[] | {status, criticalErrorMessage}],
     failedTasks: [.resources.failedTasks[] | .runId as $r | .tasks.items[] | "\($r):\(.id)"]}' \
  "$dir/status.json"

# The logs of those failed tasks (at most 25) in one request.
args=()
while read -r t; do args+=(-f "task=$t"); done < <(
  jq -r '.resources.failedTasks[] | .runId as $r | .tasks.items[] | "\($r):\(.id)"' \
    "$dir/status.json" | head -n 25)
npx nx-cloud api batch/v0/task-logs "${args[@]}" -o "$dir/logs.json"
jq '.items[] | {runId, taskId, batchId, hasUrl: (.url != null), error}' "$dir/logs.json"

Enterprise (single-tenant) clusters do not have these routes yet. There a batch
read or view answers 404 with no body, and --describe does not know it. Fall
back to the single-resource routes: cipes/{cipeId} and its linked run groups
and runs, runs/{runId}/tasks per run, and each task's logs asset link. A 404
whose body has code: not_found is a wrong ID, not a missing route.

Interpret responses

Collection responses have top-level items and nextCursor. Single resources
are returned as-is. Do not infer a field meaning from its name; check
--describe and a live record first.

Label cache statements by evidence source:

  • API response field: a recorded cacheEnabled, cacheable, cache-status,
    or hash value.
  • Nx target query: a value from nx show project ... --json in a matching
    checkout.
  • Tool-native cache: Unknown until its executor options are inspected.

Compute and credits

For how much compute CI used, start with cipe-stats (VM minutes and CPU and
memory utilization over a window) and each CIPE's compute field. The API has
no billing record. A run group's credits are the sum of estimatedTotalCredits
over its workflows[] (the deprecated workflow is only the first one). That
sum is an estimate of compute credits by launch template, not execution
credits or the invoice, and it is absent for run groups without a workflow
(such as on the customer's own runners). Call it an estimate, and say how many
run groups had none.

Empty task assets

A valid task asset can have zero-byte terminal output and no output files;
nx:noop commonly does. Check the matching workspace task before reporting a
log-capture or archive defect.

Report

State the operations queried, filters, item counts, and whether the data is
complete. State whether a result is recorded API data, a local target query, or
a hypothesis. Never claim that an API-only read proved configuration provenance
or tool-native cache state.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
monitor-ciMonitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access.0 installspolygraphGuidance for coordinating changes across multiple repositories using Polygraph. When the request implies that some information from another repo has to be read, another repo has to be updated, or the user asks about what other repos are doing with shared code/APIs/endpoints, use this skill.0 installsnx-cloud-apiQuery the read-only Nx Cloud Public API for workspace data with `npx nx-cloud api`. Use this skill when a user asks to inspect or retrieve CIPEs, pipelines, run groups, runs, tasks, workflows, agents, task statistics, flaky tasks, cache data, or API endpoint details. Use this skill before any Nx Cloud API call. It covers endpoint discovery, link navigation, pagination, asset downloads, and error recovery. Do not use it for live CI monitoring.0 installsget-latest-ciFetch the latest CI pipeline execution for the current branch. Returns the most recent CIPE which may be completed, in progress, or null. Use when you need to review CI status, check failures, or inspect CI state.0 installsawait-polygraph-ciWait for CI to settle across all repos in a Polygraph session, then report results and investigate failures. USE WHEN user says "await polygraph", "wait for polygraph ci", "polygraph ci status", "check polygraph ci", "watch polygraph session", "monitor polygraph".0 installsnx-cloud-cache-investigatorInvestigate a specific Nx cache miss, artifact download or extraction failure, same-hash non-replay, or suspected unsafe cache replay. Use this skill whenever a user asks why an Nx task did not use the cache, why cache artifact restoration failed, why a cache hit restored stale or wrong output, or to compare two cached task executions. Use the nx-cloud-api skill for every Nx Cloud read. This skill supports API-only investigations, preserves strict hash-evidence limits, and requests local configuration only when the question requires it.0 installs

More from Nx AI Agents Config

View source →
nx-run-tasksHelps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.2 installsnx-pluginsFind and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the workspace.1 installslink-workspace-packagesLink workspace packages in monorepos (npm, yarn, pnpm, bun). USE WHEN: (1) you just created or generated new packages and need to wire up their dependencies, (2) user imports from a sibling package and needs to add it as a dependency, (3) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve". DO NOT patch around with tsconfig paths or manual package.json edits - use the package manager's workspace commands to fix actual linking.1 installsnx-generateGenerate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps/libs, or setting up project structure. Trigger words - scaffold, setup, create a new app, create a new lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.1 installsnx-importImport, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code/history from another repository.1 installsnx-workspaceExplore and understand Nx workspaces. USE WHEN answering questions about the workspace, projects, or tasks. ALSO USE WHEN an nx command fails or you need to check available targets/configuration before running a task. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What depends on library Y?', 'What targets can I run?', 'Cannot find configuration for task', 'debug nx task failure'.1 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.635 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.535 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.346 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.246 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.173 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions145 installs

Frequently asked questions about nx-cloud-api

What does the nx-cloud-api skill do?

Query the read-only Nx Cloud Public API for workspace data with `npx nx-cloud api`. Use this skill when a user asks to inspect or retrieve CIPEs, pipelines, run groups, runs, tasks, workflows, agents, task statistics, flaky tasks, cache data, CI compute or credit estimates, or API endpoint details. Use this skill before any Nx Cloud API call. It covers endpoint discovery, link navigation, pagination, asset downloads, and error recovery. Do not use it for live CI monitoring. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the nx-cloud-api skill?

Run `npx @skills-hub-ai/cli install nx-monorepo-nx-cloud-nx-cloud-api` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/nx-monorepo-nx-cloud-nx-cloud-api/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does nx-cloud-api work with?

nx-cloud-api runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the nx-cloud-api skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use nx-cloud-api after installing it?

In Claude Code, type `/nx-monorepo-nx-cloud-nx-cloud-api` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the nx-cloud-api skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.