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 +1 -1
- package/tools/mcp-register.mjs +96 -6
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.
|
|
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": {
|
package/tools/mcp-register.mjs
CHANGED
|
@@ -74,12 +74,102 @@ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b)
|
|
|
74
74
|
|
|
75
75
|
// โโ Claude Code โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
76
76
|
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
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))
|
|
82
|
-
|
|
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
|
}
|