yarkr-cli 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/dist/yarkr.js +17 -15
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -16,7 +16,8 @@ harness's own layout (`~/.claude/skills/…`, `~/.agents/…`, MCP configs and s
16
16
 
17
17
  ```sh
18
18
  yarkr arks # list public arks
19
- yarkr sync acme/starter # install one into your home directory
19
+ yarkr sync acme/starter # install one into this folder
20
+ yarkr sync acme/starter -g # …or into your home directory
20
21
  yarkr sync acme/starter --harness claude-code # only write Claude Code's files
21
22
  yarkr ark # what your arks give you, and which version
22
23
  ```
package/dist/yarkr.js CHANGED
@@ -41811,18 +41811,20 @@ async function context(flags = {}) {
41811
41811
  const cwd = process.cwd();
41812
41812
  const conn = await resolveConnection({ dir: cwd, registry: flags.registry });
41813
41813
  const api = new Api(conn);
41814
- const project = flags.user ? null : await loadProjectConfig(cwd, { required: false });
41815
- if (project) return { dir: cwd, config: project, conn, api, lock: await loadLock(cwd), userMode: false };
41816
- const dir = userStateDir();
41814
+ const userMode = !!(flags.global || flags.user);
41815
+ const dir = userMode ? userStateDir() : cwd;
41817
41816
  let config2 = await loadProjectConfig(dir, { required: false });
41818
41817
  if (!config2) {
41819
- const detected2 = detectHarnesses2(os5.homedir());
41820
- config2 = { channel: "stable", scope: "user", harnesses: detected2.length ? detected2 : ["claude-code"], packages: {}, arks: "auto" };
41821
- await mkdir3(dir, { recursive: true });
41822
- await saveProjectConfig(dir, config2);
41823
- ui.info(`No ${CONFIG_FILE} here, so yarkr installs your arks into your home directory (${config2.harnesses.join(", ")}). Settings: ${path5.join(dir, CONFIG_FILE)}.`);
41818
+ const detected2 = detectHarnesses2(userMode ? os5.homedir() : cwd);
41819
+ config2 = { channel: "stable", scope: userMode ? "user" : "project", harnesses: detected2.length ? detected2 : ["claude-code"], packages: {}, arks: "auto" };
41820
+ if (!flags.dryRun && !flags.check && !flags.readOnly) {
41821
+ await mkdir3(dir, { recursive: true });
41822
+ await saveProjectConfig(dir, config2);
41823
+ if (userMode) ui.info(`Installing your arks into your home directory (${config2.harnesses.join(", ")}). Settings: ${path5.join(dir, CONFIG_FILE)}.`);
41824
+ else ui.info(`Created ${CONFIG_FILE} here for ${config2.harnesses.join(", ")}. Use -g to install into your home directory instead.`);
41825
+ }
41824
41826
  }
41825
- return { dir, config: config2, conn, api, lock: await loadLock(dir), userMode: true };
41827
+ return { dir, config: config2, conn, api, lock: await loadLock(dir), userMode };
41826
41828
  }
41827
41829
  async function sync(flags, update2, arkRefs = []) {
41828
41830
  const { dir, config: config2, conn, api, lock, userMode } = await context(flags);
@@ -42499,7 +42501,7 @@ async function mcpRemove(scopes, flags) {
42499
42501
  if (!flags.noSync) await sync(flags);
42500
42502
  }
42501
42503
  async function mcpList(flags) {
42502
- const { config: config2, conn } = await context(flags);
42504
+ const { config: config2, conn } = await context({ ...flags, readOnly: true });
42503
42505
  const rows = (config2.mcp ?? []).map((m) => connectionFor(conn.server, m));
42504
42506
  if (flags.json) return console.log(JSON.stringify(rows, null, 2));
42505
42507
  if (!rows.length) {
@@ -45039,11 +45041,11 @@ async function repoLint(dir, opts) {
45039
45041
  }
45040
45042
 
45041
45043
  // src/index.ts
45042
- var VERSION = true ? "1.0.1" : "0.0.0-dev";
45044
+ var VERSION = true ? "1.0.2" : "0.0.0-dev";
45043
45045
  var act = (fn) => async (...a) => {
45044
45046
  await fn(...a);
45045
45047
  };
45046
- var syncFlags = (c) => c.option("--harness <ids...>", `limit to some harnesses (${HARNESS_IDS.join(", ")})`).option("--dry-run", "show what would change; write nothing").option("--check", "exit 1 if anything is out of date (for CI)").option("--force", "overwrite files edited locally").option("--require-signatures", "refuse unsigned releases").option("--user", "use your arks and home directory even inside a project").option("--registry <url>", "registry to use (default: from .yarkrrc)");
45048
+ var syncFlags = (c) => c.option("--harness <ids...>", `limit to some harnesses (${HARNESS_IDS.join(", ")})`).option("--dry-run", "show what would change; write nothing").option("--check", "exit 1 if anything is out of date (for CI)").option("--force", "overwrite files edited locally").option("--require-signatures", "refuse unsigned releases").option("-g, --global", "install into your home directory instead of this folder").addOption(new Option("--user").hideHelp()).option("--registry <url>", "registry to use (default: from .yarkrrc)");
45047
45049
  function buildProgram() {
45048
45050
  const program2 = new Command().name("yarkr").description("Yarkr: install your org's skills, agents and MCP configs into every harness.").version(VERSION).option("-q, --quiet", "only print warnings and errors").hook("preAction", (cmd) => {
45049
45051
  ui.quiet = !!cmd.opts().quiet;
@@ -45059,11 +45061,11 @@ function buildProgram() {
45059
45061
  program2.command("arks").description("list public arks: curated sets anyone can sync or connect over MCP").option("--json").action(act(publicArks));
45060
45062
  program2.command("lint").argument("[dir]", "a repo checkout", ".").description("check a repo is set up as a Yarkr source: what it publishes, problems the hub would refuse, and index typos or weak descriptions").option("--namespace <ns>", "namespace to show names in (default: the git owner)").option("--strict", "exit 1 on warnings too").option("--json").action(act(repoLint));
45061
45063
  program2.command("guide").argument("[name]", "a guide, e.g. create-ark; omit to list them").description("print instructions for your agent, e.g. how to build an ark for a topic").option("-o, --out <path>", "write to a file, or <dir>/SKILL.md for a directory (e.g. ~/.claude/skills/create-ark/)").option("--topic <topic>", "create-ark: what the ark is about").addOption(new Option("--type <type>", "create-ark: the kind of package it holds").choices(["skill", "agent", "mcp"])).action(act(guide));
45062
- syncFlags(program2.command("add").argument("<packages...>", "namespace/name[@range]").description("add packages to yarkr.json (outside a project: to your personal ark, or your user config when signed out) and sync").option("--no-sync", "only edit yarkr.json")).action(act((pkgs, o) => add(pkgs, { ...o, noSync: o.sync === false })));
45064
+ syncFlags(program2.command("add").argument("<packages...>", "namespace/name[@range]").description("add packages to yarkr.json (with -g: to your personal ark, or your user config when signed out) and sync").option("--no-sync", "only edit yarkr.json")).action(act((pkgs, o) => add(pkgs, { ...o, noSync: o.sync === false })));
45063
45065
  syncFlags(program2.command("remove").argument("<packages...>", "packages, or arks listed in yarkr.json").description("remove packages or arks (or opt out of optional ark items) and delete their files").option("--no-sync", "only edit yarkr.json")).action(act((pkgs, o) => remove(pkgs, { ...o, noSync: o.sync === false })));
45064
45066
  syncFlags(program2.command("update").argument("[packages...]").description("move packages to the newest release their range allows")).action(act((pkgs, o) => update(pkgs, o)));
45065
45067
  syncFlags(
45066
- program2.command("sync").argument("[arks...]", "arks to add first: <org>/<ark>, yours or another org's public ark (which needs no sign-in)").description("install locked releases into each harness's native layout (outside a project: your arks, into your home directory)")
45068
+ program2.command("sync").argument("[arks...]", "arks to add first: <org>/<ark>, yours or another org's public ark (which needs no sign-in)").description("install locked releases into each harness's native layout in this folder (with -g: your home directory)")
45067
45069
  ).action(act((refs, o) => sync(o, void 0, refs)));
45068
45070
  program2.command("yank").argument("<release>", "namespace/name@version").description("yank a release (org admins): ranges and stable skip it, exact pins still install it").option("--reason <text>", "why, shown to everyone who installed it").option("--undo", "un-yank it").action(act(yank));
45069
45071
  program2.command("diff").argument("[package]").description("show local edits to synced files").option("--name-only").action(act(diff));
@@ -45086,7 +45088,7 @@ function buildProgram() {
45086
45088
  act((scopes, o) => mcpAdd(scopes, { ...o, noSync: o.sync === false }))
45087
45089
  );
45088
45090
  mcpFlags(mcp.command("remove").argument("<scopes...>").description("remove MCP connections from every harness")).action(act((scopes, o) => mcpRemove(scopes, { ...o, noSync: o.sync === false })));
45089
- mcp.command("list").description("show configured MCP connections").option("--user", "your user config even inside a project").option("--json").action(act((o) => mcpList(o)));
45091
+ mcp.command("list").description("show configured MCP connections").option("-g, --global", "your user config instead of this folder's").addOption(new Option("--user").hideHelp()).option("--json").action(act((o) => mcpList(o)));
45090
45092
  program2.command("mcp-config").argument("<harness>", HARNESS_IDS.join(" | ")).description("print the config that connects a harness to Yarkr's MCP server").option("--token-env <name>", "environment variable holding the token", "YARKR_TOKEN").option("--registry <url>").action(act(mcpConfig));
45091
45093
  return program2;
45092
45094
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yarkr-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Install skills, agents and MCP toolsets from Yarkr into Claude Code, Codex, opencode, Cursor and more",
5
5
  "license": "MIT",
6
6
  "homepage": "https://yarkr.com",
@@ -47,8 +47,8 @@
47
47
  "typescript": "~5.9.3",
48
48
  "vitest": "^3.2.4",
49
49
  "yaml": "^2.8.1",
50
- "@yarkr/core": "0.1.0",
51
50
  "@yarkr/evals": "0.1.0",
51
+ "@yarkr/core": "0.1.0",
52
52
  "@yarkr/schema": "0.1.0"
53
53
  },
54
54
  "scripts": {