@alessandroraffa/tangyr 0.10.0 → 0.11.0

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 +13 -2
  2. package/dist/index.js +17 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -107,13 +107,24 @@ claudeCodeGlobalPaths:
107
107
  - ~/.claude-work
108
108
  ```
109
109
 
110
- **Via CLI flag** (repeatable, overrides the config field):
110
+ **Via environment variable** (`TANGYR_CLAUDE_CONFIG_DIRS`):
111
+
112
+ A colon-separated list of Claude Code global root directories. Entries support `~/` expansion. This layer is designed for machine-specific configuration that must not be committed to a shared kit config.
113
+
114
+ ```sh
115
+ export TANGYR_CLAUDE_CONFIG_DIRS="~/.claude:~/.claude-work"
116
+ tangyr sync
117
+ ```
118
+
119
+ Auto-sync use case: if a kit-change hook or automation runs `tangyr sync`, exporting `TANGYR_CLAUDE_CONFIG_DIRS` in the shell environment keeps multiple Claude configs in sync automatically — without putting machine-specific paths in a shared `tangyr.config.yaml`.
120
+
121
+ **Via CLI flag** (repeatable):
111
122
 
112
123
  ```sh
113
124
  tangyr sync --claude-config-dir ~/.claude --claude-config-dir ~/.claude-work
114
125
  ```
115
126
 
116
- Precedence: `--claude-config-dir` flag > `claudeCodeGlobalPaths` in config > default `~/.claude`.
127
+ Precedence: `--claude-config-dir` flag > `TANGYR_CLAUDE_CONFIG_DIRS` env > `claudeCodeGlobalPaths` in config > default `~/.claude`.
117
128
 
118
129
  Per-root artifacts (instructions, agents, skills, commands, rules, output-styles, hooks settings) are written under each root. Shared artifacts (`~/.claude.json` for MCP, `~/.agents/hooks` for hooks) are resolved from the platform default and written once regardless of how many roots are configured.
119
130
 
package/dist/index.js CHANGED
@@ -15644,8 +15644,12 @@ function resolveClineProfile(scope, projectRoot, mappings) {
15644
15644
  };
15645
15645
  }
15646
15646
  var DEFAULT_CLAUDE_ROOT_RAW = "~/.claude";
15647
+ function parseEnvDirs(raw) {
15648
+ return raw.split(":").map((s) => s.trim()).filter((s) => s.length > 0);
15649
+ }
15647
15650
  function resolveClaudeGlobalRoots(input) {
15648
- const rawRoots = (input.flag?.length ?? 0) > 0 ? input.flag : (input.config?.length ?? 0) > 0 ? input.config : [DEFAULT_CLAUDE_ROOT_RAW];
15651
+ const envEntries = input.env !== void 0 ? parseEnvDirs(input.env) : void 0;
15652
+ const rawRoots = (input.flag?.length ?? 0) > 0 ? input.flag : envEntries !== void 0 && envEntries.length > 0 ? envEntries : (input.config?.length ?? 0) > 0 ? input.config : [DEFAULT_CLAUDE_ROOT_RAW];
15649
15653
  const seen = /* @__PURE__ */ new Set();
15650
15654
  const roots = [];
15651
15655
  for (const raw of rawRoots) {
@@ -26497,6 +26501,7 @@ function installForTool(tool, config, kitInfo, manifest, options, mappings, logg
26497
26501
  );
26498
26502
  const claudeRoots = scope === "global" && mappings ? resolveClaudeGlobalRoots({
26499
26503
  flag: options.claudeConfigDir,
26504
+ env: process.env.TANGYR_CLAUDE_CONFIG_DIRS,
26500
26505
  config: config.claudeCodeGlobalPaths
26501
26506
  }) : void 0;
26502
26507
  let count = 0;
@@ -28867,12 +28872,13 @@ function runSyncCommand(options, logger) {
28867
28872
  printManifestDiff(logger, kitInfo.name, kitSync.diff);
28868
28873
  }
28869
28874
  const allMappings = mappings ?? (targets.includes("claude-code") ? loadMappings(sourceRoot, config, configDir) : void 0);
28875
+ const claudeRoots = targets.includes("claude-code") && syncOptions.scope === "global" && allMappings ? resolveClaudeGlobalRoots({
28876
+ flag: options.claudeConfigDir,
28877
+ env: process.env.TANGYR_CLAUDE_CONFIG_DIRS,
28878
+ config: config.claudeCodeGlobalPaths
28879
+ }) : void 0;
28870
28880
  for (const target of targets) {
28871
28881
  if (target === "claude-code") {
28872
- const claudeRoots = syncOptions.scope === "global" && allMappings ? resolveClaudeGlobalRoots({
28873
- flag: options.claudeConfigDir,
28874
- config: config.claudeCodeGlobalPaths
28875
- }) : void 0;
28876
28882
  if (claudeRoots && claudeRoots.length > 1) {
28877
28883
  for (const claudeRoot of claudeRoots) {
28878
28884
  logger.info(` claude-code: syncing root ${claudeRoot}`);
@@ -28990,9 +28996,6 @@ function runSyncCommand(options, logger) {
28990
28996
  }
28991
28997
  writeLossReport(options.lossReport, lossReport);
28992
28998
  printOutcomeTable(results);
28993
- exitOnErrorSeverityLoss(lossReport, logger, {
28994
- ignoreErrors: options.ignoreErrors ?? false
28995
- });
28996
28999
  if (kitInfo && kitSync && !options.dryRun) {
28997
29000
  cleanupRemovedManagedArtifacts(
28998
29001
  config,
@@ -29002,11 +29005,17 @@ function runSyncCommand(options, logger) {
29002
29005
  kitSync.diff.removed,
29003
29006
  logger
29004
29007
  );
29008
+ if (claudeRoots && claudeRoots.length > 0) {
29009
+ kitSync.manifest.claudeCodeGlobalRoots = claudeRoots;
29010
+ }
29005
29011
  updateManifest(kitInfo, kitSync);
29006
29012
  logger.info(
29007
29013
  `Sync complete for kit '${kitInfo.name}': ${kitSync.diff.added.length} added, ${kitSync.diff.modified.length} modified, ${kitSync.diff.removed.length} removed, ${kitSync.diff.unchanged.length} unchanged.`
29008
29014
  );
29009
29015
  }
29016
+ exitOnErrorSeverityLoss(lossReport, logger, {
29017
+ ignoreErrors: options.ignoreErrors ?? false
29018
+ });
29010
29019
  }
29011
29020
  function toSyncOptions(options, config) {
29012
29021
  const component = options.component ? validateComponent(options.component) : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alessandroraffa/tangyr",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "CLI for the Tangyr discipline — install and manage operating kits for AI coding tools",
5
5
  "license": "MIT",
6
6
  "type": "module",