JFrog — Setup Package Managers for Artifactory
In examples below, <skill_path> is this skill's directory (parent of
scripts/ / references/).
Apply the session hook's repo pick via jf setup,
then record it in .jfrog/local/package-resolution.json
via scripts/merge-workspace-binding.sh.
jf setup writes package-manager-native config (.npmrc, pip.conf, uv.toml, …); the binding
lets the hook re-apply on later sessions.
At a glance (always-read core)
Every jf setup this session:
- Cover base
../jfrog/SKILL.md At-a-glance / Tier A
(Step 0.1) → <UA>, --server-id placement, single-server, stop-don't-switch.
Prefer full base SKILL.md when you can; Tier B (cli-gotchas / jf-api / …)
only if the next action needs jf api / advanced CLI
- Always
--repo + --server-id. <repoKey> ← Step 2
(table / binding / global-cache) or user override / unresolved AskQuestion;
never self-discover. <SID> ← resolver only (never user-selected)
- Confirm before first
jf setup unless user asked silent / non-interactive
- Exit 0 → merge binding; non-zero → stop, surface CLI verbatim, offer
alternate repo or
abort (2-answer cap)
- Binding = decisions, not creds — never write tokens into
.jfrog/local/package-resolution.json
- Unresolved / failed: ask with failure verbatim — never switch servers
- Never skip Gotchas + base Tier A hard
rules (
../jfrog/SKILL.md Cautious execution / Server selection / Tier A
gotcha floor). Full cli-gotchas.md is Tier B — not required for jf setup
Steps: 0 →
1 →
2 →
3 →
4
Scope (this skill vs session hook)
Session-start hook: resolves repo keys per package type, injects the
"Resolved URLs for this session" table, refreshes the global cache. The same
renderer is available on demand via modules/package-resolution/scripts/print-policy.mjs (the enforce
notice embeds the exact command), so the policy can be loaded after setup.
This skill: reads that output, runs jf setup, and persists the workspace
binding at .jfrog/local/package-resolution.json (via
scripts/merge-workspace-binding.sh) when package-manager config is still missing.
Honor the injected policy's governed scope. The session policy lists the
package managers it governs. Do not proactively onboard a package manager the policy
doesn't govern (e.g. a stray Dockerfile when only pypi/npm are governed) —
those are intentionally out of scope. An explicit user request to set up any
package manager still works (Step 1's user-mention signal and Step 2's AskQuestion for an
unlisted package manager apply as usual).
Prerequisites
jf setup mutates user state (~/.npmrc, ~/.docker/config.json, …).
Confirm before the first jf setup in a session unless the user explicitly
requests silent/non-interactive setup.
- Covering base At-a-glance / Tier A is required — done as Step 0.1 below.
Out of scope: CLI install/login (../jfrog/references/…).
Gotchas — hard rules (never skip)
Not tips. Do/don'ts and known traps for jf setup — follow every bullet
before binding. Also honor base Tier A hard rules from
../jfrog/SKILL.md (Cautious execution, Server selection,
Tier A gotcha floor). Full cli-gotchas.md is Tier B — load only if this
session also needs jf api / advanced CLI.
- Always pass
--repo and --server-id — omitting --repo fails when
multiple repos match. See jf-setup-command.md.
jf setup overwrites package-manager config without backup — skip package managers whose binding
already matches (Step 1, signal 2).
- Docker / Podman — prefix or stop.
jf setup docker writes creds only;
bare docker pull <img> hits Docker Hub. Complete setup, then pull via
<host>/<repoKey>/<img>.
- Binding holds decisions, not credentials — never write tokens into
.jfrog/local/package-resolution.json.
- Persist binding with the merge script — after each successful
jf setup,
run scripts/merge-workspace-binding.sh (Step 6). Do not hand-edit the JSON.
gradle ≠ maven. Bind under repositories.gradle, never repositories.maven.
- Yarn / Poetry — not APR zero-touch; bind only on explicit user ask (Step 1).
References
| File |
When to read |
references/jf-setup-command.md |
CLI flags, supported package managers, exit-code contract, jf setup --help |
references/global-cache-file.md |
Global cache shape, resolution classes, jq one-liners |
references/workspace-binding.md |
Workspace binding schema, package-manager → type map, merge script |
scripts/merge-workspace-binding.sh |
After each successful jf setup — deterministic binding merge (jq required) |
Step 0 — Read the base skill, then ensure jf is ready
- Cover base skill At-a-glance / Tier A before the first non-exempt
jf
(even when jf is already configured). Prefer reading
../jfrog/SKILL.md in full when you can; the At-a-glance
Tier A floor is enough for jf setup / package-manager binding. Load Tier B
(cli-gotchas.md, jf-api.md, …) only if the next action needs jf api /
advanced CLI. Then run that skill's Environment check (and export
JFROG_CLI_USER_AGENT) before the first jf call.
- Ensure
jf + a configured server (<SID>). If jf config show already
succeeds, skip to Step 1; otherwise:
- Do not run
jf setup until both succeed. Confirm before install/login.
Step 1 — Identify package managers to bind
Combine four signals, in order; intersect with jf setup --help supported list:
Explicit user mention. Map aliases: python → pip/uv/pipenv (and
poetry only if the user named Poetry); java → maven/gradle; node →
npm/pnpm by lockfile (yarn only if the user named Yarn).
Workspace binding — read .jfrog/local/package-resolution.json. Drop
package managers already bound to the same key unless recovering from 401/403
(re-run same key). Package-manager → type table:
workspace-binding.md.
Workspace manifests when still ambiguous (several package managers of one
type may apply — e.g. requirements.txt and uv.lock):
| Manifest / signal |
Package manager |
package.json, pnpm-lock.yaml |
npm (+ pnpm if pnpm-lock.yaml present) |
yarn.lock (alone) |
npm — do not auto-select yarn |
requirements.txt |
pip |
Pipfile |
pipenv |
uv.lock |
uv — suppresses bare pyproject.toml → pip; keep requirements.txt + uv.lock as multi-PM |
pyproject.toml |
[tool.uv] → uv; [tool.poetry] → poetry only on explicit user ask, else not applicable (do not select pip); bare PEP 621 with no uv.lock → pip |
pom.xml |
maven |
build.gradle, build.gradle.kts |
gradle (bind under type gradle) |
go.mod |
go |
Dockerfile, compose.yaml, docker-compose.yml |
docker / podman |
*.csproj, NuGet.Config |
nuget / dotnet |
Chart.yaml |
helm |
Binary gate (client tools only): missing client on PATH → skip as not
applicable; do not substitute another package manager or report setup
success. Exempt maven / gradle (config-only). Details:
jf-setup-command.md.
jf setup --help — filter candidates; never hardcode the list. See
jf-setup-command.md. Unsupported → report
gap, skip.
Step 2 — Get the resolved repo
For each <package-manager>, recover <repoKey> and <serverId> from the first source
available:
- "Resolved URLs for this session" table (default). Parse
<repoKey>
from URL; <serverId> from host.
- Workspace binding — if table was trimmed.
repositories.<type>
(gradle → repositories.gradle, not maven).
- Global cache — last resort only; never overrides (1) or (2). See
global-cache-file.md.
Cache disagreeing with (1)/(2) is not a reason to change the repo.
Don't choose a repo yourself: no listing, enumerating, probing, or iterating
--server-id to pick one, and don't second-guess the resolver — use resolver
output only. If the user explicitly asks to browse repos, list them via
jf api "/artifactory/api/repositories?type=virtual&packageType=<pkgType>"
(Artifactory package type from the binding map — gradle not maven;
uv / pip / pipenv / poetry → pypi), then let the user choose; the
agent still never makes the choice on its own.
Unresolved repo key
Ask via AskQuestion (include the resolver/setup failure text verbatim):
No default repo for <package-manager> on <SID>.
Failure: <verbatim failure>
Which Artifactory repository should I use? (repo key, or abort.)
Cap at 2 answers per package manager, then abort. User may override repo only, never server.
Step 3 — Confirm, run jf setup, persist binding
Present the plan, one row per package manager:
<package-manager> → <repoKey> on <SID> (source: resolver)
<package-manager> → <repoKey> on <SID> (source: user-supplied)
Show binding diffs when the repo key changes.
Confirm via AskQuestion (apply / change repos / abort) unless the
user explicitly requested silent/non-interactive setup — then run directly.
Sequentially, one package manager at a time:
jf setup <package-manager> --server-id <SID> --repo <repoKey> [--project <key>]
Exit code 0 = success — merge binding (step 6). On non-zero, stop,
surface CLI output verbatim, offer alternate repo or abort (2-answer cap).
On success, run the merge script (do not hand-edit JSON). Pass the
IDE workspace root when the shell cwd is not that root:
bash <skill_path>/scripts/merge-workspace-binding.sh \
--package-manager <package-manager> \
--repo <repoKey> \
[--workspace-root <workspace-root>]
Requires jq (same prerequisite as the base jfrog skill). Exit 0 prints
merged <type> → <repo> into <path>. On non-zero, stop, surface stderr
verbatim — do not claim the binding was recorded. Schema and PM → type map:
workspace-binding.md.
Step 4 — Load the routing policy
If this session started with the "routing NOT READY" (enforce) notice, that
notice includes a refresh command (node <plugin>/modules/package-resolution/scripts/print-policy.mjs).
After Step 3 succeeds, run that exact command and treat its stdout as the
authoritative, now-current policy — it prints the resolved Artifactory URLs and
hard rules. Continue the original request using those URLs.
If the command prints nothing, routing is off by config
(packageResolution.enabled is not true) — an admin opt-in. Report that to
the user and let them decide whether to enable it.
Before you run jf setup — checklist
At a glance invariants:
1---2name: jfrog-setup-package-managers3description: Use this skill when the user asks to set up, configure, bind, or connect a package manager (npm, pip, uv, pipenv, maven, gradle, go, docker, helm, ...) to JFrog Artifactory via `jf setup` and `.jfrog/local/package-resolution.json`; when a workspace manifest exists with no matching binding entry; or when a session hook reports package-manager config missing. Skip when the binding already has the same repo key. Never pick a repo by discovery; use resolver output only (unless the user names or asks to browse repos). On unresolved or failed setup, ask with the failure verbatim — never switch servers. NOT for installing packages, general Artifactory repo operations (use the base jfrog skill), or MCP server setup (use jfrog-mcp-management).4---56# JFrog — Setup Package Managers for Artifactory78In examples below, `<skill_path>` is this skill's directory (parent of9`scripts/` / `references/`).1011Apply the session hook's repo pick via [`jf setup`](references/jf-setup-command.md),12then record it in [`.jfrog/local/package-resolution.json`](references/workspace-binding.md)13via [`scripts/merge-workspace-binding.sh`](scripts/merge-workspace-binding.sh).14`jf setup` writes package-manager-native config (`.npmrc`, `pip.conf`, `uv.toml`, …); the binding15lets the hook re-apply on later sessions.1617## At a glance (always-read core)1819Every `jf setup` this session:2021- **Cover base [`../jfrog/SKILL.md`](../jfrog/SKILL.md) At-a-glance / Tier A**22 (Step 0.1) → `<UA>`, `--server-id` placement, single-server, stop-don't-switch.23 Prefer full base SKILL.md when you can; Tier B (`cli-gotchas` / `jf-api` / …)24 only if the next action needs `jf api` / advanced CLI25- **Always `--repo` + `--server-id`.** `<repoKey>` ← [Step 2](#step-2--get-the-resolved-repo)26 (table / binding / global-cache) or user override / unresolved AskQuestion;27 never self-discover. `<SID>` ← resolver only (never user-selected)28- **Confirm** before first `jf setup` unless user asked silent / non-interactive29- **Exit 0 → merge binding**; non-zero → stop, surface CLI verbatim, offer30 alternate repo or `abort` (2-answer cap)31- **Binding = decisions, not creds** — never write tokens into32 `.jfrog/local/package-resolution.json`33- **Unresolved / failed:** ask with failure verbatim — never switch servers34- **Never skip** [Gotchas](#gotchas--hard-rules-never-skip) + base Tier A hard35 rules (`../jfrog/SKILL.md` Cautious execution / Server selection / Tier A36 gotcha floor). Full `cli-gotchas.md` is Tier B — not required for `jf setup`3738Steps: [0](#step-0--read-the-base-skill-then-ensure-jf-is-ready) →39[1](#step-1--identify-package-managers-to-bind) →40[2](#step-2--get-the-resolved-repo) →41[3](#step-3--confirm-run-jf-setup-persist-binding) →42[4](#step-4--load-the-routing-policy)4344## Scope (this skill vs session hook)4546**Session-start hook:** resolves repo keys per package type, injects the47"Resolved URLs for this session" table, refreshes the global cache. The same48renderer is available on demand via `modules/package-resolution/scripts/print-policy.mjs` (the enforce49notice embeds the exact command), so the policy can be loaded after setup.5051**This skill:** reads that output, runs `jf setup`, and persists the workspace52binding at `.jfrog/local/package-resolution.json` (via53`scripts/merge-workspace-binding.sh`) when package-manager config is still missing.5455**Honor the injected policy's governed scope.** The session policy lists the56package managers it governs. Do **not** *proactively* onboard a package manager the policy57doesn't govern (e.g. a stray `Dockerfile` when only `pypi`/`npm` are governed) —58those are intentionally out of scope. An **explicit user request** to set up any59package manager still works (Step 1's user-mention signal and Step 2's AskQuestion for an60unlisted package manager apply as usual).6162## Prerequisites6364- `jf setup` **mutates user state** (`~/.npmrc`, `~/.docker/config.json`, …).65 Confirm before the first `jf setup` in a session unless the user explicitly66 requests silent/non-interactive setup.67- Covering base At-a-glance / Tier A is required — done as Step 0.1 below.6869**Out of scope:** CLI install/login (`../jfrog/references/…`).7071## Gotchas — hard rules (never skip)7273**Not tips.** Do/don'ts and known traps for `jf setup` — follow every bullet74before binding. Also honor base **Tier A** hard rules from75[`../jfrog/SKILL.md`](../jfrog/SKILL.md) (Cautious execution, Server selection,76Tier A gotcha floor). Full `cli-gotchas.md` is Tier B — load only if this77session also needs `jf api` / advanced CLI.7879- **Always pass `--repo` and `--server-id`** — omitting `--repo` fails when80 multiple repos match. See [`jf-setup-command.md`](references/jf-setup-command.md).81- **`jf setup` overwrites package-manager config** without backup — skip package managers whose binding82 already matches (Step 1, signal 2).83- **Docker / Podman — prefix or stop.** `jf setup docker` writes creds only;84 bare `docker pull <img>` hits Docker Hub. Complete setup, then pull via85 `<host>/<repoKey>/<img>`.86- **Binding holds decisions, not credentials** — never write tokens into87 `.jfrog/local/package-resolution.json`.88- **Persist binding with the merge script** — after each successful `jf setup`,89 run `scripts/merge-workspace-binding.sh` (Step 6). Do **not** hand-edit the JSON.90- **`gradle` ≠ `maven`.** Bind under `repositories.gradle`, never `repositories.maven`.91- **Yarn / Poetry** — not APR zero-touch; bind only on explicit user ask (Step 1).9293## References9495| File | When to read |96|------|--------------|97| [`references/jf-setup-command.md`](references/jf-setup-command.md) | CLI flags, supported package managers, exit-code contract, `jf setup --help` |98| [`references/global-cache-file.md`](references/global-cache-file.md) | Global cache shape, resolution classes, jq one-liners |99| [`references/workspace-binding.md`](references/workspace-binding.md) | Workspace binding schema, package-manager → type map, merge script |100| [`scripts/merge-workspace-binding.sh`](scripts/merge-workspace-binding.sh) | After each successful `jf setup` — deterministic binding merge (`jq` required) |101102## Step 0 — Read the base skill, then ensure `jf` is ready1031041. **Cover base skill At-a-glance / Tier A before the first non-exempt `jf`105 (even when `jf` is already configured).** Prefer reading106 [`../jfrog/SKILL.md`](../jfrog/SKILL.md) in full when you can; the At-a-glance107 Tier A floor is enough for `jf setup` / package-manager binding. Load Tier B108 (`cli-gotchas.md`, `jf-api.md`, …) only if the next action needs `jf api` /109 advanced CLI. Then run that skill's *Environment check* (and export110 `JFROG_CLI_USER_AGENT`) before the first `jf` call.1112. Ensure `jf` + a configured server (`<SID>`). If `jf config show` already112 succeeds, skip to Step 1; otherwise:113 - **`jf --version`** missing → install per114 [`../jfrog/references/jfrog-cli-install-upgrade.md`](../jfrog/references/jfrog-cli-install-upgrade.md).115 - **`jf config show`** empty → login per116 [`../jfrog/references/jfrog-login-flow.md`](../jfrog/references/jfrog-login-flow.md)117 or `jf config add` with access-token (Bearer-only).1183. Do not run `jf setup` until both succeed. Confirm before install/login.119120## Step 1 — Identify package managers to bind121122Combine four signals, in order; intersect with `jf setup --help` supported list:1231241. **Explicit user mention.** Map aliases: python → `pip`/`uv`/`pipenv` (and125 `poetry` only if the user named Poetry); java → `maven`/`gradle`; node →126 `npm`/`pnpm` by lockfile (`yarn` only if the user named Yarn).1272. **Workspace binding** — read `.jfrog/local/package-resolution.json`. Drop128 package managers already bound to the same key unless recovering from 401/403129 (re-run same key). Package-manager → type table:130 [`workspace-binding.md`](references/workspace-binding.md).1313. **Workspace manifests** when still ambiguous (several package managers of one132 type may apply — e.g. `requirements.txt` **and** `uv.lock`):133134 | Manifest / signal | Package manager |135 |---|---|136 | `package.json`, `pnpm-lock.yaml` | `npm` (+ `pnpm` if `pnpm-lock.yaml` present) |137 | `yarn.lock` (alone) | `npm` — do **not** auto-select `yarn` |138 | `requirements.txt` | `pip` |139 | `Pipfile` | `pipenv` |140 | `uv.lock` | `uv` — suppresses bare `pyproject.toml` → `pip`; keep `requirements.txt` + `uv.lock` as multi-PM |141 | `pyproject.toml` | `[tool.uv]` → `uv`; `[tool.poetry]` → `poetry` only on explicit user ask, else **not applicable** (do not select `pip`); bare PEP 621 with **no** `uv.lock` → `pip` |142 | `pom.xml` | `maven` |143 | `build.gradle`, `build.gradle.kts` | `gradle` (bind under type **`gradle`**) |144 | `go.mod` | `go` |145 | `Dockerfile`, `compose.yaml`, `docker-compose.yml` | `docker` / `podman` |146 | `*.csproj`, `NuGet.Config` | `nuget` / `dotnet` |147 | `Chart.yaml` | `helm` |148149 **Binary gate (client tools only):** missing client on `PATH` → skip as not150 applicable; do **not** substitute another package manager or report setup151 success. **Exempt `maven` / `gradle`** (config-only). Details:152 [`jf-setup-command.md`](references/jf-setup-command.md).1531544. **`jf setup --help`** — filter candidates; never hardcode the list. See155 [`jf-setup-command.md`](references/jf-setup-command.md). Unsupported → report156 gap, skip.157158## Step 2 — Get the resolved repo159160For each `<package-manager>`, recover `<repoKey>` and `<serverId>` from the first source161available:1621631. **"Resolved URLs for this session"** table (default). Parse `<repoKey>`164 from URL; `<serverId>` from host.1652. **Workspace binding** — if table was trimmed. `repositories.<type>`166 (`gradle` → `repositories.gradle`, not `maven`).1673. **Global cache** — last resort only; never overrides (1) or (2). See168 [`global-cache-file.md`](references/global-cache-file.md).169170Cache disagreeing with (1)/(2) is not a reason to change the repo.171172**Don't choose a repo yourself:** no listing, enumerating, probing, or iterating173`--server-id` to pick one, and don't second-guess the resolver — use resolver174output only. If the user explicitly asks to browse repos, list them via175`jf api "/artifactory/api/repositories?type=virtual&packageType=<pkgType>"`176(Artifactory **package type** from the binding map — `gradle` not `maven`;177`uv` / `pip` / `pipenv` / `poetry` → `pypi`), then let the user choose; the178agent still never makes the choice on its own.179180### Unresolved repo key181182Ask via AskQuestion (include the resolver/setup failure text verbatim):183184> No default repo for `<package-manager>` on `<SID>`.185> Failure: `<verbatim failure>`186> Which Artifactory repository should I use? (repo key, or `abort`.)187188Cap at **2 answers per package manager**, then abort. User may override repo only, never server.189190## Step 3 — Confirm, run `jf setup`, persist binding1911921. Present the plan, one row per package manager:193194 ```text195 <package-manager> → <repoKey> on <SID> (source: resolver)196 <package-manager> → <repoKey> on <SID> (source: user-supplied)197 ```1981992. Show binding diffs when the repo key changes.2002013. **Confirm** via AskQuestion (`apply` / `change repos` / `abort`) unless the202 user explicitly requested silent/non-interactive setup — then run directly.2032044. Sequentially, one package manager at a time:205206 ```bash207 jf setup <package-manager> --server-id <SID> --repo <repoKey> [--project <key>]208 ```2092105. **Exit code `0` = success** — merge binding (step 6). On non-zero, **stop**,211 surface CLI output verbatim, offer alternate repo or `abort` (2-answer cap).2122136. On success, **run the merge script** (do **not** hand-edit JSON). Pass the214 IDE workspace root when the shell cwd is not that root:215216 ```bash217 bash <skill_path>/scripts/merge-workspace-binding.sh \218 --package-manager <package-manager> \219 --repo <repoKey> \220 [--workspace-root <workspace-root>]221 ```222223 Requires `jq` (same prerequisite as the base `jfrog` skill). Exit `0` prints224 `merged <type> → <repo> into <path>`. On non-zero, **stop**, surface stderr225 verbatim — do not claim the binding was recorded. Schema and PM → type map:226 [`workspace-binding.md`](references/workspace-binding.md).227228## Step 4 — Load the routing policy229230If this session started with the "routing NOT READY" (enforce) notice, that231notice includes a refresh command (`node <plugin>/modules/package-resolution/scripts/print-policy.mjs`).232After Step 3 succeeds, run that exact command and treat its stdout as the233authoritative, now-current policy — it prints the resolved Artifactory URLs and234hard rules. Continue the original request using those URLs.235236If the command prints nothing, routing is off by config237(`packageResolution.enabled` is not `true`) — an admin opt-in. Report that to238the user and let them decide whether to enable it.239240## Before you run `jf setup` — checklist241242[At a glance](#at-a-glance-always-read-core) invariants:243244- [ ] base At-a-glance / Tier A covered; `<UA>` exported245- [ ] `<repoKey>` ← Step 2 or user override; `<SID>` ← resolver only246- [ ] confirmed (or explicit silent-setup)247- [ ] `jf setup <pm> --server-id <SID> --repo <repoKey>`248- [ ] exit 0 → merge binding (no creds); non-zero → stop + report verbatim;249 never switch servers250- [ ] **never skip** Gotchas (this skill) + base Tier A hard rules (full251 `cli-gotchas.md` only if Tier B path)