inscope 0.8.5 ā 0.8.6
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/README.md +25 -15
- package/dist/bin/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Nothing sensitive is written to disk: GitHub tokens come from the `gh` keyring a
|
|
|
27
27
|
|
|
28
28
|
### Table of Contents
|
|
29
29
|
|
|
30
|
-
- [
|
|
30
|
+
- [Quick Usage](#-quick-usage)
|
|
31
31
|
- [Requirements](#-requirements)
|
|
32
32
|
- [Commands](#-commands)
|
|
33
33
|
- [`inscope init`](#inscope-init)
|
|
@@ -41,41 +41,40 @@ Nothing sensitive is written to disk: GitHub tokens come from the `gh` keyring a
|
|
|
41
41
|
- [What It Manages](#-what-it-manages)
|
|
42
42
|
- [MCP Servers](#-mcp-servers)
|
|
43
43
|
- [Config File](#-config-file)
|
|
44
|
+
- [Install Globally (Optional)](#-install-globally-optional)
|
|
44
45
|
- [Contributing](#-contributing)
|
|
45
46
|
|
|
46
47
|
---
|
|
47
48
|
|
|
48
|
-
## š
|
|
49
|
+
## š Quick Usage
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
npm i -g inscope
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Scoping GitHub accounts? Sign each one into `gh` once with `gh auth login` (that is gh's own command, not inscope); inscope reads tokens from the accounts you have signed in. Then:
|
|
51
|
+
No install required, just prefix any command with `npx`:
|
|
57
52
|
|
|
58
53
|
```sh
|
|
59
54
|
# set up the config + hook, and source it from ~/.zshrc
|
|
60
|
-
inscope init
|
|
55
|
+
npx inscope init
|
|
61
56
|
|
|
62
57
|
# map a workspace - inscope walks you through gh account, git identity, and servers
|
|
63
|
-
inscope add ~/acme
|
|
64
|
-
inscope add ~/personal
|
|
58
|
+
npx inscope add ~/acme
|
|
59
|
+
npx inscope add ~/personal
|
|
65
60
|
|
|
66
61
|
# reload your shell, then verify
|
|
67
62
|
source ~/.zshrc
|
|
68
|
-
inscope doctor
|
|
63
|
+
npx inscope doctor
|
|
69
64
|
```
|
|
70
65
|
|
|
66
|
+
Scoping GitHub accounts? Sign each one into `gh` once with `gh auth login` (that is gh's own command, not inscope); inscope reads tokens from the accounts you have signed in.
|
|
67
|
+
|
|
71
68
|
`cd ~/acme/api` and you are the work account, with work MCP servers and your work commit email. `cd ~/personal/blog` and you are you. Launch `claude` from inside a mapped directory (or relaunch) to pick up the identity.
|
|
72
69
|
|
|
73
70
|
Prefer flags or CI? Every prompt has a flag, and `-y` takes the defaults non-interactively:
|
|
74
71
|
|
|
75
72
|
```sh
|
|
76
|
-
inscope add ~/acme --gh <account> --email you@work.com --servers github,linear -y
|
|
73
|
+
npx inscope add ~/acme --gh <account> --email you@work.com --servers github,linear -y
|
|
77
74
|
```
|
|
78
75
|
|
|
76
|
+
Running these a lot? Drop the `npx` with a [global install](#-install-globally-optional).
|
|
77
|
+
|
|
79
78
|
---
|
|
80
79
|
|
|
81
80
|
## š§° Requirements
|
|
@@ -224,7 +223,7 @@ Each enabled server is written into the workspace `.mcp.json` with a name suffix
|
|
|
224
223
|
Slack is opt-in. Enable it during `add` (shown above), or with flags, then store the token once:
|
|
225
224
|
|
|
226
225
|
```sh
|
|
227
|
-
inscope add ~/acme --gh neeraj-acme-org --servers github,slack --seed-slack
|
|
226
|
+
npx inscope add ~/acme --gh neeraj-acme-org --servers github,slack --seed-slack
|
|
228
227
|
```
|
|
229
228
|
|
|
230
229
|
`--seed-slack` prompts for the `xoxp` token and writes it to the Keychain. Pass `--slack-message` to allow the Slack MCP server to post messages.
|
|
@@ -264,6 +263,17 @@ Edit it directly, then run `inscope apply` to regenerate the hook, git includes,
|
|
|
264
263
|
|
|
265
264
|
---
|
|
266
265
|
|
|
266
|
+
## š¦ Install Globally (Optional)
|
|
267
|
+
|
|
268
|
+
Reaching for inscope often? Install it once and drop the `npx`:
|
|
269
|
+
|
|
270
|
+
```sh
|
|
271
|
+
npm i -g inscope
|
|
272
|
+
inscope <command> [options]
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
267
277
|
## š¤ Contributing
|
|
268
278
|
|
|
269
279
|
Issues and pull requests are welcome. Run the tests with `bun test` and the type checks with `bun run typecheck` before opening a PR. See [CONTRIBUTING.md](./CONTRIBUTING.md) for the toolchain and architecture.
|
package/dist/bin/index.mjs
CHANGED
|
@@ -61,7 +61,7 @@ add-zsh-hook chpwd __inscope_resolve_identity
|
|
|
61
61
|
__inscope_ws="__init__" # force the first resolve, clearing any inherited token
|
|
62
62
|
__inscope_resolve_identity
|
|
63
63
|
`},Je=e=>{let t=o();return e===t?`$HOME`:e.startsWith(t+n.sep)?`$HOME/${e.slice(t.length+1)}`:e},Ye=()=>{let e=Je(p());return`[ -r "${e}" ] && source "${e}"`},Xe=e=>{let t=Ye();if(e.includes(t))return e;let n=e.replace(/\n*$/,``),r=`# inscope: load each workspace's tokens (GitHub, Slack) from \$PWD on every cd\n${t}`;return n.length?`${n}\n\n${r}\n`:`${r}\n`},Ze=()=>{let e=g(),t=v(e),n=Xe(t);n!==t&&y(e,n)},Qe=()=>v(g()).includes(Ye()),Q=e=>{ge(e.workspaces);let t=p();y(t,qe(e)),Ue(e),Ze();let n=[];for(let t of e.workspaces)_e(t),n.push(A(t));return{hook:t,gitconfig:e.workspaces.some(e=>e.git?.email||e.git?.name),mcp:n}},$e=O,et=e=>`SLACK_MCP_XOXP_TOKEN_${e.toUpperCase().replace(/[^A-Z0-9]+/g,`_`)}`,tt=e=>O.filter(t=>!!e[t]),nt=(e,t)=>{let n={};for(let r of O)n[r]=r===`slack`?t?{keychain:t.keychain,addMessageTool:t.addMessageTool}:!1:e.includes(r);return n},rt=e=>e?`global: ${e}`:`no global set`,it=e=>{let t=x()?S():b(),n=t.workspaces.find(t=>t.name===e.name),r=le(t,e);C(r),Q(r),n&&u(n.path)!==u(e.path)&&ve(n)},at=async(e,t)=>{if(!e.servers.slack)return;let n=e.servers.slack.keychain;if(t){let e=await je(`Paste the Slack xoxp token for ${n}: `);e?(we(n,e),console.log(`\nā stored ${n} in the macOS keychain`)):console.error(`
|
|
64
|
-
No token entered; skipped keychain write.`)}else F(n)||console.log(`\nSlack token not in the keychain yet. Store it once with:\n${R(Te(n))}\n\nSetup guide: ${R(De(`https://github.com/korotovsky/slack-mcp-server/blob/HEAD/docs/01-authentication-setup.md#option-2-using-slack_mcp_xoxp_token-user-oauth`))}`)};var $=`inscope`,ot=`0.8.
|
|
64
|
+
No token entered; skipped keychain write.`)}else F(n)||console.log(`\nSlack token not in the keychain yet. Store it once with:\n${R(Te(n))}\n\nSetup guide: ${R(De(`https://github.com/korotovsky/slack-mcp-server/blob/HEAD/docs/01-authentication-setup.md#option-2-using-slack_mcp_xoxp_token-user-oauth`))}`)};var $=`inscope`,ot=`0.8.6`,st={name:`Neeraj Dalal`,email:`admin@nrjdalal.com`,url:`https://nrjdalal.com`};const ct=`Map a directory to a GitHub account, git email, and MCP servers.
|
|
65
65
|
Runs interactively in a terminal; pass flags or -y to skip the prompts. Re-running
|
|
66
66
|
with the same label updates that workspace; each directory maps to one workspace.
|
|
67
67
|
|