axmap-cli 0.2.0 โ†’ 0.3.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//name": "๐Ÿ”ด npm ์˜ 'axmap' ์€ 2022๋…„๋ถ€ํ„ฐ ๋‚จ์ด ์“ฐ๊ณ  ์žˆ๋Š” ๋‹ค๋ฅธ ๊พธ๋Ÿฌ๋ฏธ๋‹ค(leozin_ ์˜ Map ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ, 1.1.2). ๊ทธ๋ž˜์„œ `npx axmap` ์€ ์šฐ๋ฆฌ ๊ฒƒ์ด ์•„๋‹ˆ๊ณ , ๋ˆ„๊ตฌ์—๊ฒŒ๋„ ๊ทธ๋ ‡๊ฒŒ ์•ˆ๋‚ดํ•˜๋ฉด ์•ˆ ๋œ๋‹ค. 2026-08-28 ์— axmap-cli ๋กœ ์ •ํ–ˆ๋‹ค โ€” ์Šค์ฝ”ํ”„(@์‚ฌ์šฉ์ž/์ด๋ฆ„)๋ฅผ ์“ฐ์ง€ ์•Š๋Š” ์ด์œ ๋Š” ์Šค์ฝ”ํ”„๊ฐ€ npm ๊ณ„์ • ์ด๋ฆ„์— ๋ฌถ์—ฌ์„œ ๋‚˜์ค‘์— ํŒ€์ด๋‚˜ ์กฐ์ง์œผ๋กœ ์˜ฎ๊ธธ ๋•Œ ์ด๋ฆ„์ด ํ†ต์งธ๋กœ ๋ฐ”๋€Œ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ์‚ฌ๋žŒ์ด ์น˜๋Š” **๋ช…๋ น** ์ด๋ฆ„์€ ๊ทธ๋Œ€๋กœ axmap ์ด๋‹ค (์•„๋ž˜ bin) โ€” ๊พธ๋Ÿฌ๋ฏธ ์ด๋ฆ„๊ณผ ๋ช…๋ น ์ด๋ฆ„์€ ๋‹ฌ๋ผ๋„ ๋œ๋‹ค.",
3
3
  "name": "axmap-cli",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "//private": "๐Ÿ”ด ์—ฌ๊ธฐ ์žˆ๋˜ \"private\": true ๋ฅผ 2026-08-28 ์— ์ง€์› ๋‹ค. ๊ทธ ์ค„์ด ์žˆ๋Š” ๋™์•ˆ npm publish ๋Š” ๊ฑฐ๋ถ€๋๋‹ค. ๋˜๋Œ๋ฆฌ๋ ค๋ฉด ๋‹ค์‹œ ๋„ฃ์œผ๋ฉด ๋˜์ง€๋งŒ, ์ด๋ฏธ ์˜ฌ๋ผ๊ฐ„ ๋ฒ„์ „์€ ๊ทธ๋ž˜๋„ ์•ˆ ์‚ฌ๋ผ์ง„๋‹ค โ€” npm ์€ ๊ฐ™์€ ๋ฒˆํ˜ธ๋ฅผ ๋ฎ์–ด์“ฐ์ง€ ๋ชปํ•˜๊ณ  ์‚ญ์ œ๋„ 72์‹œ๊ฐ„ ์•ˆ์—๋งŒ ๋œ๋‹ค. ์ฆ‰ ์ด ์ค„์„ ๋˜์‚ด๋ฆฌ๋Š” ๊ฒƒ์€ '์•ž์œผ๋กœ ์•ˆ ์˜ฌ๋ฆฐ๋‹ค' ๋Š” ๋œป์ด์ง€ '์˜ฌ๋ฆฐ ๊ฒƒ์„ ์—†์•ค๋‹ค' ๋Š” ๋œป์ด ์•„๋‹ˆ๋‹ค.",
6
6
  "//publishConfig": "axmap-cli ๋Š” ์Šค์ฝ”ํ”„๊ฐ€ ์—†์–ด์„œ ๊ธฐ๋ณธ์ด ์ด๋ฏธ ๊ณต๊ฐœ๋‹ค. ์ฆ‰ ์ง€๊ธˆ์€ ์—†์–ด๋„ ๋œ๋‹ค. ๊ทธ๋ž˜๋„ ๋‚จ๊ฒจ ๋‘๋Š” ์ด์œ : ๋‚˜์ค‘์— @์กฐ์ง/axmap ์ฒ˜๋Ÿผ ์Šค์ฝ”ํ”„๋ฅผ ๋ถ™์ด๋Š” ๋‚  ์ด ์ค„์ด ์—†์œผ๋ฉด publish ๊ฐ€ '์œ ๋ฃŒ ํ”Œ๋žœ์ด ํ•„์š”ํ•˜๋‹ค'๋Š” ์—‰๋šฑํ•œ ๋ง๋กœ ์‹คํŒจํ•œ๋‹ค.",
7
7
  "publishConfig": {
@@ -74,12 +74,102 @@ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b)
74
74
 
75
75
  // โ”€โ”€ Claude Code โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
76
76
  //
77
- // ํ•  ์ผ์ด ์—†๋‹ค. ์ €์žฅ์†Œ์˜ `.mcp.json` ์„ ์Šค์Šค๋กœ ๋ฐœ๊ฒฌํ•˜๊ณ  ์Šน์ธ๋งŒ ๋ฌป๋Š”๋‹ค.
78
- // ๊ทธ๋ž˜๋„ ํ•œ ์ค„ ์ฐ๋Š”๋‹ค โ€” "๋‚ด CLI ๋Š” ์™œ ์•„๋ฌด ๋ง์ด ์—†์ง€" ๋ฅผ ์—†์• ๊ธฐ ์œ„ํ•ด์„œ๋‹ค.
79
- function doClaude(repo) {
77
+ // ๐Ÿ”ด **2026-08-31 โ€” ์—ฌ๊ธฐ์„œ ์ „์—ญ ๋“ฑ๋ก์„ ํ•˜๋„๋ก ๋ฐ”๊ฟจ๋‹ค.** ๊ทธ์ „์—๋Š” ์ €์žฅ์†Œ์˜
78
+ // `.mcp.json` ์ด ์žˆ๋Š”์ง€ ํ™•์ธ๋งŒ ํ•˜๊ณ  ์•„๋ฌด๊ฒƒ๋„ ํ•˜์ง€ ์•Š์•˜๋‹ค.
79
+ //
80
+ // ๊ทธ๋ž˜์„œ Claude ๋งŒ **์ €์žฅ์†Œ์— ํŒŒ์ผ์„ ์ปค๋ฐ‹ํ•ด์•ผ** ๋ถ™๋Š” ์œ ์ผํ•œ CLI ์˜€๋‹ค. npm ์œผ๋กœ
81
+ // ์„ค์น˜ํ•ด ๋‚จ์˜ ์ €์žฅ์†Œ์—์„œ ์“ฐ๋Š” ์‚ฌ๋žŒ์€ ๊ทธ ํŒŒ์ผ์„ ๋„ฃ์„ ๊ถŒํ•œ์ด ์—†์„ ์ˆ˜๋„ ์žˆ๊ณ ,
82
+ // ๋„ฃ๋”๋ผ๋„ "๋„๊ตฌ๋Š” ๋‚˜๊ฐ€๊ณ  ๋ฐ์ดํ„ฐ๋งŒ ๋‚จ๋Š”๋‹ค" ๋Š” ์ด ์ €์žฅ์†Œ์˜ ๋ฐฉ์นจ์— ์–ด๊ธ‹๋‚œ๋‹ค.
83
+ // `mcp/install.ps1` ์€ ์ด๋ฏธ ์ „์—ญ ๋“ฑ๋ก์„ ํ•˜๊ณ  ์žˆ์—ˆ๋‹ค โ€” ์„ค์น˜ ๊ฒฝ๋กœ ๋‘˜์ด ์„œ๋กœ ๋‹ค๋ฅด๊ฒŒ
84
+ // ๊ตด์–ด์„œ, ๋‘˜ ๋‹ค ๋Œ๋ฆฐ PC ์—๋Š” **๋ฒ”์œ„๊ฐ€ ์ถฉ๋Œํ•˜๋Š” ํ•ญ๋ชฉ**์ด ๋‚จ์•˜๋‹ค(claude mcp list ๊ฐ€
85
+ // "Conflicting scopes" ๋กœ ์•Œ๋ ค ์ค€๋‹ค). ๋‘ ๊ฒฝ๋กœ๋ฅผ ๊ฐ™์€ ๋™์ž‘์œผ๋กœ ๋งž์ถ˜๋‹ค.
86
+ //
87
+ // ์„ค์ •: `~/.claude.json` ์˜ ์ตœ์ƒ์œ„ `mcpServers` (user ๋ฒ”์œ„)
88
+ // ํ˜•์‹: `claude mcp add <์ด๋ฆ„> -s user [-e K=V] -- <๋ช…๋ น> <์ธ์ˆ˜...>`
89
+ //
90
+ // ๐Ÿ”ด `~/.claude.json` ์„ **์šฐ๋ฆฌ๊ฐ€ ์“ฐ์ง€ ์•Š๋Š”๋‹ค.** ๊ทธ ํŒŒ์ผ์—๋Š” Claude Code ์˜ ์„ธ์…˜
91
+ // ์ƒํƒœ๊นŒ์ง€ ๋“ค์–ด ์žˆ์–ด ์ฝ๊ณ  ๋‹ค์‹œ ์“ฐ๋Š” ์ˆœ๊ฐ„ ๋‚จ์˜ ๊ฒƒ์„ ๊นจ๋œจ๋ฆด ์œ„ํ—˜์ด ์ƒ๊ธด๋‹ค.
92
+ // ์žˆ๋Š”์ง€ **์ฝ๋Š” ๊ฒƒ๋งŒ** ์šฐ๋ฆฌ๊ฐ€ ํ•˜๊ณ , ์“ฐ๋Š” ์ผ์€ claude ์ž์‹ ์—๊ฒŒ ๋งก๊ธด๋‹ค โ€”
93
+ // doCodex ์™€ ๊ฐ™์€ ํƒœ๋„๋‹ค.
94
+
95
+ /** `~/.claude.json` ์˜ user ๋ฒ”์œ„ axmap ํ•ญ๋ชฉ. ์—†์œผ๋ฉด null, **๋ชป ์ฝ์œผ๋ฉด undefined**. */
96
+ function claudeUserEntry() {
97
+ try {
98
+ const cfg = JSON.parse(fs.readFileSync(path.join(os.homedir(), '.claude.json'), 'utf8'))
99
+ return (cfg && cfg.mcpServers && cfg.mcpServers.axmap) || null
100
+ } catch (e) {
101
+ // ํŒŒ์ผ์ด ์•„์˜ˆ ์—†๋Š” ๊ฒƒ์€ "๋“ฑ๋ก ์•ˆ ๋จ"(null)์ด๊ณ , ์žˆ๋Š”๋ฐ ๋ชป ์ฝ๋Š” ๊ฒƒ์€ ์‚ฌ๊ณ (undefined)๋‹ค.
102
+ return e && e.code === 'ENOENT' ? null : undefined
103
+ }
104
+ }
105
+
106
+ /**
107
+ * ์ด๋ฏธ ์“ธ ๋งŒํ•œ ํ•ญ๋ชฉ์ธ๊ฐ€.
108
+ *
109
+ * env ๋Š” **์šฐ๋ฆฌ๊ฐ€ ๋„ฃ๋Š” ํ‚ค๋งŒ** ๋ณธ๋‹ค. ๋‚จ์ด `AXMAP_AGENT` ๋ฅผ ์†์œผ๋กœ ๋„ฃ์–ด ๋’€์„ ์ˆ˜ ์žˆ๊ณ ,
110
+ * ๊ทธ๊ฑด ๊ทธ ์‚ฌ๋žŒ์˜ ์ด๋ฆ„์ด๋ผ ์ง€์šฐ๋ฉด ์•ˆ ๋œ๋‹ค (install.ps1 ์ด ์‹ค์ œ๋กœ ๋„ฃ๋Š”๋‹ค).
111
+ */
112
+ const sameEntry = (cur, want) =>
113
+ !!cur && cur.command === want.command &&
114
+ JSON.stringify(cur.args || []) === JSON.stringify(want.args) &&
115
+ Object.entries(want.env).every(([k, v]) => ((cur.env || {})[k] === v))
116
+
117
+ function doClaude(bin, repo) {
118
+ const run = (args) => spawnSync(bin, args, { encoding: 'utf8', windowsHide: true })
119
+ const want = entry()
120
+
121
+ const cur = claudeUserEntry()
122
+ if (cur === undefined) {
123
+ no('claude', '~/.claude.json ์„ ์ฝ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค โ€” ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค')
124
+ snippetClaude()
125
+ return
126
+ }
127
+ if (sameEntry(cur, want)) { ok('claude', '์ด๋ฏธ ๋“ฑ๋ก๋ผ ์žˆ์Šต๋‹ˆ๋‹ค (user ๋ฒ”์œ„)'); return }
128
+
129
+ // ๋ฌธ์„œ์— ์žˆ๋‹ค๊ณ  ๋ฏฟ๊ณ  ๋ถ€๋ฅด์ง€ ์•Š๋Š”๋‹ค โ€” ๋จผ์ € ๋ฌผ์–ด๋ณธ๋‹ค. doCodex ์™€ ๊ฐ™๋‹ค.
130
+ const help = run(['mcp', 'add', '--help'])
131
+ if (help.status !== 0 || !/--scope/.test(`${help.stdout}${help.stderr}`)) {
132
+ hm('claude', "'claude mcp add -s user' ๋ฅผ ํ™•์ธํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค โ€” ์†์œผ๋กœ ๋„ฃ์œผ์„ธ์š”")
133
+ snippetClaude()
134
+ return
135
+ }
136
+
137
+ const add = ['mcp', 'add', 'axmap', '-s', 'user',
138
+ ...Object.entries(want.env).flatMap(([k, v]) => ['-e', `${k}=${v}`]),
139
+ '--', want.command, ...want.args]
140
+
141
+ if (DRY) {
142
+ hm('claude', `(dry-run) ${cur ? 'claude mcp remove axmap -s user ๋’ค ' : ''}claude ${add.join(' ')}`)
143
+ return
144
+ }
145
+
146
+ // ์ž๋ฆฌ๋ฅผ ๋น„์›Œ์•ผ add ๊ฐ€ ๋ฎ์–ด์“ด๋‹ค. ์ง€์šฐ๋Š” ๊ฒƒ์€ **์šฐ๋ฆฌ ์ด๋ฆ„(`axmap`)์˜ ํ•ญ๋ชฉ๋ฟ**์ด๋‹ค.
147
+ if (cur) run(['mcp', 'remove', 'axmap', '-s', 'user'])
148
+
149
+ const r = run(add)
150
+ if (r.status === 0 && sameEntry(claudeUserEntry(), want)) {
151
+ ok('claude', 'user ๋ฒ”์œ„์— ๋“ฑ๋กํ–ˆ์Šต๋‹ˆ๋‹ค โ€” ์–ด๋А ํด๋”์—์„œ ์—ด์–ด๋„ ๋ถ™์Šต๋‹ˆ๋‹ค')
152
+ } else {
153
+ no('claude', `claude mcp add ๊ฐ€ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค (${(r.stderr || r.stdout || '').trim().split('\n')[0] || `exit ${r.status}`})`)
154
+ snippetClaude()
155
+ }
156
+
157
+ // ์ €์žฅ์†Œ์— `.mcp.json` ์ด ๋‚จ์•„ ์žˆ์œผ๋ฉด **๊ทธ์ชฝ์ด ์ด๊ธด๋‹ค.** ์กฐ์šฉํžˆ ๋‘๋ฉด ๋ฐฉ๊ธˆ ๋“ฑ๋กํ•œ
158
+ // ๊ฒƒ์ด ์™œ ์•ˆ ์“ฐ์ด๋Š”์ง€ ์•„๋ฌด๋„ ๋ชป ์ฐพ๋Š”๋‹ค.
80
159
  const f = path.join(repo, '.mcp.json')
81
- if (fs.existsSync(f)) ok('claude', '.mcp.json โ€” ์ด ํด๋”๋ฅผ ์—ด๋ฉด ์Šค์Šค๋กœ ๋ฐœ๊ฒฌํ•ฉ๋‹ˆ๋‹ค (์Šน์ธ๋งŒ ๋ˆ„๋ฅด๋ฉด ๋ฉ๋‹ˆ๋‹ค)')
82
- else no('claude', `.mcp.json ์ด ์—†์Šต๋‹ˆ๋‹ค: ${f}`)
160
+ if (fs.existsSync(f)) hm('claude', `์ €์žฅ์†Œ์˜ .mcp.json ์ด ๋จผ์ € ์“ฐ์ž…๋‹ˆ๋‹ค (๊ฐ™์€ ์„œ๋ฒ„๋ผ๋ฉด ๋ฌธ์ œ ์—†์Šต๋‹ˆ๋‹ค): ${f}`)
161
+ }
162
+
163
+ /** ์†์œผ๋กœ ๋„ฃ์„ ํ•œ ์ค„. ๊ฒฝ๋กœ์— ๊ณต๋ฐฑ์ด ์žˆ์„ ์ˆ˜ ์žˆ์–ด ๊ฒน๋”ฐ์˜ดํ‘œ๋กœ ๊ฐ์‹ผ๋‹ค. */
164
+ function snippetClaude() {
165
+ console.log('')
166
+ console.log(' ์•„๋ž˜ ํ•œ ์ค„์„ ์น˜์„ธ์š”:')
167
+ console.log('')
168
+ console.log(` claude mcp add axmap -s user -e AXMAP_ACTOR=agent -e AXMAP_TTL=45m -- node "${SERVER}"`)
169
+ console.log('')
170
+ console.log(' AXMAP_AGENT ๋Š” ์ ์ง€ ๋งˆ์„ธ์š” โ€” ์—ฌ๋Ÿฌ ์‚ฌ๋žŒ์ด ๊ฐ™์€ ์ด๋ฆ„์ด ๋˜๋ฉด')
171
+ console.log(' ์„œ๋กœ์˜ ์„ ์ ์„ ๊ฒน์นจ์œผ๋กœ ๋ณด์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.')
172
+ console.log('')
83
173
  }
84
174
 
85
175
  // โ”€โ”€ Antigravity CLI (agy) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@@ -253,7 +343,7 @@ function main() {
253
343
  const bin = resolveBin(a.bin)
254
344
  if (!bin) continue
255
345
  any = true
256
- if (a.id === 'claude') doClaude(root)
346
+ if (a.id === 'claude') doClaude(bin, root)
257
347
  else if (a.id === 'agy') doAgy()
258
348
  else if (a.id === 'codex') doCodex(bin)
259
349
  }