turno-cli 0.5.0 → 0.5.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.
- package/CHANGELOG.md +38 -0
- package/README.md +41 -21
- package/dist/cli/commands/browser.js +1 -1
- package/dist/cli/commands/completion.js +3 -37
- package/dist/cli/commands/mcpd.js +8 -0
- package/dist/mcpd/daemon.js +13 -0
- package/npm-shrinkwrap.json +5 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# turno-cli
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0c723fc: `turno-browser init` sets turno-browser up step by step: it names and creates an identity (or
|
|
8
|
+
uses one that is there), opens Chrome to sign in by hand on a first site, finds the agents
|
|
9
|
+
installed here and runs the agent's `mcp add` command only on a yes. Without a terminal it needs
|
|
10
|
+
`--identity` and `--agent`, skips the sign-in and prints the command instead. `turno-browser`
|
|
11
|
+
with no command now points to it.
|
|
12
|
+
|
|
13
|
+
The first steps say more of what happened:
|
|
14
|
+
|
|
15
|
+
- `login` opens a page that says what to do instead of a blank tab, and on close names the sites
|
|
16
|
+
that were opened, or says that nothing new was signed in.
|
|
17
|
+
- `show` has a "last sign-in" line, local times and a hint to turn on the health check;
|
|
18
|
+
`doctor` says when an identity was never signed in by hand.
|
|
19
|
+
- `list`, `show` and `doctor` say "not in use" instead of "free".
|
|
20
|
+
- `do <id> end` says that Chrome stays open in the background server and how to close it now.
|
|
21
|
+
- `do` errors no longer start with "Error: Error:", and a stale ref or text where a ref goes gets
|
|
22
|
+
a hint (`snapshot`, `find`).
|
|
23
|
+
- `setup claude` suggests `claude-code`.
|
|
24
|
+
- `add` prints its next steps with each explanation on its own line, so the commands paste into
|
|
25
|
+
zsh as they are.
|
|
26
|
+
|
|
27
|
+
## 0.5.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- cd53ee9: - `turno --help | head` and `turno-browser --help | head` end quietly instead of printing an
|
|
32
|
+
EPIPE stack trace when the reader stops early.
|
|
33
|
+
- Bash completion works on the bash 3.2 macOS ships: each word reaches turno on its own, and
|
|
34
|
+
the script loads with `eval "$(turno completion bash)"`, since bash 3.2 cannot source `<(...)`.
|
|
35
|
+
- `turno mcp daemon run` stops by itself when its home folder is removed (a throwaway HOME
|
|
36
|
+
someone deleted), instead of running on with nothing left to serve.
|
|
37
|
+
- Updated dependencies [cd53ee9]
|
|
38
|
+
- Updated dependencies [cd53ee9]
|
|
39
|
+
- turno-core@0.3.0
|
|
40
|
+
|
|
3
41
|
## 0.5.0
|
|
4
42
|
|
|
5
43
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -49,7 +49,8 @@ whole story, with a small working picture of each part.
|
|
|
49
49
|
## Install
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
|
|
52
|
+
# try it first, in a throwaway HOME; your own setup is not touched
|
|
53
|
+
npx turno-cli demo
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
Then install it with the package manager you already use (macOS or Linux, Node 22.11+):
|
|
@@ -58,7 +59,8 @@ Then install it with the package manager you already use (macOS or Linux, Node 2
|
|
|
58
59
|
npm install --global turno-cli
|
|
59
60
|
pnpm add --global turno-cli
|
|
60
61
|
bun add --global turno-cli
|
|
61
|
-
|
|
62
|
+
# yarn 1 (classic); yarn 2 and later have no global installs
|
|
63
|
+
yarn global add turno-cli
|
|
62
64
|
brew tap wimo-dev/turno && brew trust wimo-dev/turno && brew install turno
|
|
63
65
|
```
|
|
64
66
|
|
|
@@ -122,11 +124,15 @@ Linux. Nothing leaves your machine: no account, no telemetry, no proxy for model
|
|
|
122
124
|
## Quick start
|
|
123
125
|
|
|
124
126
|
```sh
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
# finds your agents, profiles, folders and MCP servers, shows the diff,
|
|
128
|
+
# then starts the gateway and points every profile at it
|
|
129
|
+
turno init
|
|
130
|
+
# sign in once per profile (/login)
|
|
131
|
+
claude-work
|
|
132
|
+
# Claude Code, with this folder's account
|
|
133
|
+
cd ~/code/acme && turno auto
|
|
134
|
+
# where you stand: this folder, accounts, gateway, what to do next
|
|
135
|
+
turno
|
|
130
136
|
```
|
|
131
137
|
|
|
132
138
|
`turno init` asks before it adopts anything and writes everything as one change, so one
|
|
@@ -135,14 +141,21 @@ systemd --user on Linux); `turno init --no-start` leaves it for later (`turno mc
|
|
|
135
141
|
then `turno mcp sync`). Step by step instead:
|
|
136
142
|
|
|
137
143
|
```sh
|
|
138
|
-
|
|
144
|
+
# ~/.claude-work and the claude-work command
|
|
145
|
+
turno profile add work --color violet
|
|
139
146
|
turno profile add personal
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
turno
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
# sign in once per profile (/login)
|
|
148
|
+
claude-work
|
|
149
|
+
# this folder and everything under it
|
|
150
|
+
turno profile assign ~/code/acme work
|
|
151
|
+
# folders without a rule
|
|
152
|
+
turno config set default personal
|
|
153
|
+
# mcp.toml from the servers you already have
|
|
154
|
+
turno mcp import --move-secrets --write
|
|
155
|
+
# the gateway, and every profile pointed at it
|
|
156
|
+
turno mcp daemon start && turno mcp sync
|
|
157
|
+
# Claude Code, signed in as work
|
|
158
|
+
cd ~/code/acme && turno auto
|
|
146
159
|
```
|
|
147
160
|
|
|
148
161
|
Codex, Copilot and Cursor profiles are the same with `--agent codex|copilot|cursor`. Point your
|
|
@@ -344,9 +357,12 @@ then npx runs it, with a warning in the server's log. Details: [docs/mcp.md](htt
|
|
|
344
357
|
### Browser with real profiles
|
|
345
358
|
|
|
346
359
|
```sh
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
# separate package, not installed with turno
|
|
361
|
+
npm install --global turno-browser
|
|
362
|
+
# an identity and its mcp.toml entry
|
|
363
|
+
turno identity add browser:school
|
|
364
|
+
# sign in by hand once; cookies persist
|
|
365
|
+
turno identity login browser:school
|
|
350
366
|
```
|
|
351
367
|
|
|
352
368
|
`turno-browser` is its own MCP server. It drives the installed Google Chrome, headed, with a
|
|
@@ -394,8 +410,10 @@ go to a hash-chained audit log (`turno identity log`, `--verify` checks the chai
|
|
|
394
410
|

|
|
395
411
|
|
|
396
412
|
```sh
|
|
397
|
-
|
|
398
|
-
turno ui install
|
|
413
|
+
# font + statusLine in the shared settings.json
|
|
414
|
+
turno ui install
|
|
415
|
+
# also set the font in this terminal
|
|
416
|
+
turno ui install --terminal current
|
|
399
417
|
```
|
|
400
418
|
|
|
401
419
|
Row 1: profile and plan, 5 h and weekly usage of that account with time to reset, context, and
|
|
@@ -477,8 +495,10 @@ category). Security issues: [SECURITY.md](https://github.com/wimo-dev/turno/blob
|
|
|
477
495
|
|
|
478
496
|
```sh
|
|
479
497
|
pnpm install && pnpm build
|
|
480
|
-
|
|
481
|
-
pnpm
|
|
498
|
+
# typecheck, lint (Biome, knip), tests (sandboxed HOME), text rules, licenses
|
|
499
|
+
pnpm check
|
|
500
|
+
# also the end-to-end test that needs the network (Cursor)
|
|
501
|
+
pnpm test:e2e
|
|
482
502
|
```
|
|
483
503
|
|
|
484
504
|
## License
|
|
@@ -8,7 +8,7 @@ import { defaultDoDeps, mcpdTransport } from "./browser-do.js";
|
|
|
8
8
|
* The API version this turno was built against. Typed by the package's own constant, so a
|
|
9
9
|
* change of its API_VERSION in the workspace fails the typecheck until this line follows.
|
|
10
10
|
*/
|
|
11
|
-
export const BROWSER_API = { major: 1, minor:
|
|
11
|
+
export const BROWSER_API = { major: 1, minor: 13 };
|
|
12
12
|
export const INSTALL_HINT = OPTIONAL.browser.install;
|
|
13
13
|
export const NOT_INSTALLED = notInstalled(OPTIONAL.browser);
|
|
14
14
|
/** The summary in `turno help` (registry.ts HELP_SUMMARY). */
|
|
@@ -1,41 +1,7 @@
|
|
|
1
|
+
import { completionScripts } from "turno-core/cli";
|
|
1
2
|
import { parseFlags } from "../args.js";
|
|
2
3
|
import { fail } from "../io.js";
|
|
3
|
-
const
|
|
4
|
-
# turno completion for zsh. Load it with: source <(turno completion zsh)
|
|
5
|
-
_turno() {
|
|
6
|
-
local -a out
|
|
7
|
-
out=("\${(@f)$(turno __complete -- "\${(@)words[2,CURRENT]}" 2>/dev/null)}")
|
|
8
|
-
if [[ "\${out[1]}" == ":dir" ]]; then _files -/; return; fi
|
|
9
|
-
(( \${#out} )) && [[ -n "\${out[1]}" ]] && compadd -- "\${out[@]}"
|
|
10
|
-
}
|
|
11
|
-
compdef _turno turno
|
|
12
|
-
`;
|
|
13
|
-
const BASH = `# turno completion for bash. Load it with: source <(turno completion bash)
|
|
14
|
-
_turno() {
|
|
15
|
-
local IFS=$'\\n'
|
|
16
|
-
local out=($(turno __complete -- "\${COMP_WORDS[@]:1:COMP_CWORD}" 2>/dev/null))
|
|
17
|
-
if [[ "\${out[0]}" == ":dir" ]]; then
|
|
18
|
-
COMPREPLY=($(compgen -d -- "\${COMP_WORDS[COMP_CWORD]}"))
|
|
19
|
-
return
|
|
20
|
-
fi
|
|
21
|
-
COMPREPLY=("\${out[@]}")
|
|
22
|
-
}
|
|
23
|
-
complete -o default -F _turno turno
|
|
24
|
-
`;
|
|
25
|
-
const FISH = `# turno completion for fish. Load it with: turno completion fish | source
|
|
26
|
-
function __turno_complete
|
|
27
|
-
set -l words (commandline -opc) (commandline -ct)
|
|
28
|
-
set -e words[1]
|
|
29
|
-
set -l out (turno __complete -- $words 2>/dev/null)
|
|
30
|
-
if test "$out[1]" = ":dir"
|
|
31
|
-
__fish_complete_directories (commandline -ct)
|
|
32
|
-
return
|
|
33
|
-
end
|
|
34
|
-
printf '%s\\n' $out
|
|
35
|
-
end
|
|
36
|
-
complete -c turno -f -a '(__turno_complete)'
|
|
37
|
-
`;
|
|
38
|
-
export const SCRIPTS = { zsh: ZSH, bash: BASH, fish: FISH };
|
|
4
|
+
export const SCRIPTS = completionScripts("turno");
|
|
39
5
|
export const command = {
|
|
40
6
|
summary: "shell completion for commands, profiles, identities and config keys",
|
|
41
7
|
usage: [
|
|
@@ -43,7 +9,7 @@ export const command = {
|
|
|
43
9
|
"",
|
|
44
10
|
"Prints the completion script. To load it in every shell:",
|
|
45
11
|
" zsh echo 'source <(turno completion zsh)' >> ~/.zshrc",
|
|
46
|
-
" bash echo '
|
|
12
|
+
" bash echo 'eval \"$(turno completion bash)\"' >> ~/.bashrc",
|
|
47
13
|
" fish turno completion fish > ~/.config/fish/completions/turno.fish",
|
|
48
14
|
"",
|
|
49
15
|
"Examples:",
|
|
@@ -192,19 +192,27 @@ async function runDaemon(args, io) {
|
|
|
192
192
|
let waiting = false;
|
|
193
193
|
for (;;) {
|
|
194
194
|
try {
|
|
195
|
+
let homeGone;
|
|
195
196
|
const d = await startDaemon({
|
|
196
197
|
env: io.env,
|
|
197
198
|
logToStdout: Boolean(process.stdout.isTTY) && !service,
|
|
198
199
|
...(port !== undefined ? { port } : {}),
|
|
200
|
+
onHomeGone: () => homeGone?.(),
|
|
199
201
|
});
|
|
200
202
|
io.err(`mcpd listening on 127.0.0.1:${d.port}`);
|
|
201
203
|
const unguard = installCrashGuards(d.log, () => d.stop());
|
|
202
204
|
await new Promise((resolve) => {
|
|
203
205
|
const stop = () => {
|
|
206
|
+
process.off("SIGINT", stop);
|
|
207
|
+
process.off("SIGTERM", stop);
|
|
204
208
|
void d.stop().then(resolve, resolve);
|
|
205
209
|
};
|
|
206
210
|
process.once("SIGINT", stop);
|
|
207
211
|
process.once("SIGTERM", stop);
|
|
212
|
+
homeGone = () => {
|
|
213
|
+
io.err("turno: mcpd stopped: its home folder was removed");
|
|
214
|
+
stop();
|
|
215
|
+
};
|
|
208
216
|
});
|
|
209
217
|
unguard();
|
|
210
218
|
return 0;
|
package/dist/mcpd/daemon.js
CHANGED
|
@@ -479,6 +479,18 @@ export async function startDaemon(opts = {}) {
|
|
|
479
479
|
void sampler.sample(manager.list().map((i) => ({ descKey: i.descKey, pid: i.upstream.pid })));
|
|
480
480
|
}, 15_000);
|
|
481
481
|
timer.unref();
|
|
482
|
+
let homeTimer;
|
|
483
|
+
const onHomeGone = opts.onHomeGone;
|
|
484
|
+
if (onHomeGone) {
|
|
485
|
+
homeTimer = setInterval(() => {
|
|
486
|
+
if (existsSync(p.home))
|
|
487
|
+
return;
|
|
488
|
+
clearInterval(homeTimer);
|
|
489
|
+
log(`the home folder ${p.home} was removed; stopping`);
|
|
490
|
+
onHomeGone();
|
|
491
|
+
}, opts.homeCheckMs ?? 15_000);
|
|
492
|
+
homeTimer.unref();
|
|
493
|
+
}
|
|
482
494
|
// /status shows the pressure from the start instead of after the first reap.
|
|
483
495
|
void manager.readPressure().catch(() => { });
|
|
484
496
|
let stopped = false;
|
|
@@ -492,6 +504,7 @@ export async function startDaemon(opts = {}) {
|
|
|
492
504
|
return;
|
|
493
505
|
stopped = true;
|
|
494
506
|
clearInterval(timer);
|
|
507
|
+
clearInterval(homeTimer);
|
|
495
508
|
clearTimeout(debounce);
|
|
496
509
|
clearTimeout(configDebounce);
|
|
497
510
|
watcher?.close();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turno-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "turno-cli",
|
|
9
|
-
"version": "0.5.
|
|
9
|
+
"version": "0.5.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
13
13
|
"smol-toml": "1.9.1",
|
|
14
|
-
"turno-core": "0.
|
|
14
|
+
"turno-core": "0.3.0"
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
17
|
"turno": "dist/cli/main.js"
|
|
@@ -1014,8 +1014,8 @@
|
|
|
1014
1014
|
}
|
|
1015
1015
|
},
|
|
1016
1016
|
"node_modules/turno-core": {
|
|
1017
|
-
"version": "0.
|
|
1018
|
-
"resolved": "https://registry.npmjs.org/turno-core/-/turno-core-0.
|
|
1017
|
+
"version": "0.3.0",
|
|
1018
|
+
"resolved": "https://registry.npmjs.org/turno-core/-/turno-core-0.3.0.tgz",
|
|
1019
1019
|
"license": "Apache-2.0",
|
|
1020
1020
|
"engines": {
|
|
1021
1021
|
"node": ">=22.11"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turno-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Switch accounts in your coding agents and keep the conversation, the MCP sign-ins and the browser session.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
49
49
|
"smol-toml": "1.9.1",
|
|
50
|
-
"turno-core": "0.
|
|
50
|
+
"turno-core": "0.3.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^26.6.6",
|
|
54
|
-
"turno-browser": "0.
|
|
54
|
+
"turno-browser": "0.7.0",
|
|
55
55
|
"turno-fonts": "0.1.2",
|
|
56
56
|
"typescript": "^7.0.2",
|
|
57
57
|
"vitest": "^5.1.0"
|