turno-cli 0.0.0-stage → 0.1.1

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 (83) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +18 -0
  4. package/README.md +335 -2
  5. package/dist/accounts/audit.js +54 -0
  6. package/dist/accounts/builtin.js +214 -0
  7. package/dist/accounts/delegate.js +185 -0
  8. package/dist/accounts/registry.js +190 -0
  9. package/dist/agents/index.js +101 -0
  10. package/dist/agents/snippets.js +64 -0
  11. package/dist/cli/args.js +47 -0
  12. package/dist/cli/commands/accounts.js +216 -0
  13. package/dist/cli/commands/auto.js +44 -0
  14. package/dist/cli/commands/available.js +18 -0
  15. package/dist/cli/commands/browser.js +175 -0
  16. package/dist/cli/commands/complete.js +112 -0
  17. package/dist/cli/commands/completion.js +57 -0
  18. package/dist/cli/commands/config.js +168 -0
  19. package/dist/cli/commands/doctor.js +324 -0
  20. package/dist/cli/commands/exhausted.js +40 -0
  21. package/dist/cli/commands/handoff.js +118 -0
  22. package/dist/cli/commands/hook.js +63 -0
  23. package/dist/cli/commands/identity.js +114 -0
  24. package/dist/cli/commands/limit.js +102 -0
  25. package/dist/cli/commands/mcp.js +350 -0
  26. package/dist/cli/commands/mcpd.js +161 -0
  27. package/dist/cli/commands/migrate.js +176 -0
  28. package/dist/cli/commands/open.js +60 -0
  29. package/dist/cli/commands/profile.js +259 -0
  30. package/dist/cli/commands/resolve.js +23 -0
  31. package/dist/cli/commands/run.js +15 -0
  32. package/dist/cli/commands/secret.js +123 -0
  33. package/dist/cli/commands/session.js +36 -0
  34. package/dist/cli/commands/sessions.js +27 -0
  35. package/dist/cli/commands/setup.js +224 -0
  36. package/dist/cli/commands/status.js +101 -0
  37. package/dist/cli/commands/statusline.js +275 -0
  38. package/dist/cli/commands/ui.js +276 -0
  39. package/dist/cli/commands/undo.js +67 -0
  40. package/dist/cli/commands/update-check.js +22 -0
  41. package/dist/cli/commands/upgrade.js +162 -0
  42. package/dist/cli/commands/usage.js +167 -0
  43. package/dist/cli/commands/version.js +27 -0
  44. package/dist/cli/commands/which.js +28 -0
  45. package/dist/cli/group.js +50 -0
  46. package/dist/cli/io.js +22 -0
  47. package/dist/cli/launch.js +98 -0
  48. package/dist/cli/launchers.js +200 -0
  49. package/dist/cli/main.js +94 -0
  50. package/dist/cli/registry.js +77 -0
  51. package/dist/core/config-edit.js +42 -0
  52. package/dist/core/config.js +137 -0
  53. package/dist/core/exhausted.js +30 -0
  54. package/dist/core/journal.js +185 -0
  55. package/dist/core/manifest.js +177 -0
  56. package/dist/core/paths.js +54 -0
  57. package/dist/core/profiles.js +61 -0
  58. package/dist/core/ratelimit.js +39 -0
  59. package/dist/core/resolve.js +78 -0
  60. package/dist/core/secrets.js +44 -0
  61. package/dist/core/sessions.js +173 -0
  62. package/dist/core/toml-edit.js +152 -0
  63. package/dist/core/update.js +102 -0
  64. package/dist/core/version.js +109 -0
  65. package/dist/mcpd/cache.js +41 -0
  66. package/dist/mcpd/connectors.js +63 -0
  67. package/dist/mcpd/daemon.js +163 -0
  68. package/dist/mcpd/gateway.js +308 -0
  69. package/dist/mcpd/importer.js +160 -0
  70. package/dist/mcpd/instances.js +303 -0
  71. package/dist/mcpd/jsonrpc.js +19 -0
  72. package/dist/mcpd/launchd.js +86 -0
  73. package/dist/mcpd/peerpid.js +25 -0
  74. package/dist/mcpd/sync.js +208 -0
  75. package/dist/mcpd/upstream.js +232 -0
  76. package/dist/statusline/cost.js +135 -0
  77. package/dist/statusline/render.js +246 -0
  78. package/dist/ui/cmap.js +57 -0
  79. package/dist/ui/fonts.js +107 -0
  80. package/dist/ui/settings.js +69 -0
  81. package/dist/ui/terminal-id.js +30 -0
  82. package/dist/ui/terminals.js +163 -0
  83. package/package.json +69 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # turno-cli
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d28b959: `turno upgrade` recognizes a Homebrew install and runs `brew update` and `brew upgrade turno`
8
+ instead of `npm install --global`.
9
+ - ce52d03: The repository moved to `github.com/wimo-dev/turno`. turno-browser is listed in the MCP
10
+ Registry as `io.github.wimo-dev/turno-browser`.
11
+
12
+ ## 0.1.0
13
+
14
+ First public release.
15
+
16
+ - One MCP gateway (`mcpd`) for every agent session: tool lists from a cache, servers started on
17
+ first use, shared between sessions where it is safe, stopped when idle, secrets in the macOS
18
+ Keychain. `turno mcp import`, `install`, `sync`, `config` and `doctor` move existing servers
19
+ behind it.
20
+ - Profiles for Claude Code, Codex CLI, GitHub Copilot CLI and Cursor CLI, each with its own
21
+ login folder and launcher, and folder rules (`turno profile assign`, `turno auto
22
+ [--agent]`). Claude Code profiles share conversations, skills and settings.
23
+ - Gateway entries for opencode, Gemini CLI, Goose, Crush, Droid and Kiro
24
+ (`turno mcp config --agent <name>`).
25
+ - The Claude Code status line with usage per account, its font and terminal setup
26
+ (`turno ui install`).
27
+ - The accounts bridge, a builtin MCP server that delegates a task to a service account another
28
+ profile is signed into, with confirmation for writes and an audit log.
29
+ - `turno status`, `doctor --fix`, `--json` on reads, `--dry-run` and `turno undo` on writes,
30
+ shell completion, `turno upgrade`, and a daily update check that honors `DO_NOT_TRACK`.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,18 @@
1
+ turno
2
+ Copyright 2026 William Frank Monroy Mamani
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ The turno-fonts package redistributes MesloLGS Nerd Font 3.4.0: Meslo LG,
7
+ Copyright 2009, 2010, 2013 Andre Berg, under the Apache License 2.0, patched with
8
+ the Nerd Fonts icon sets, which carry their own licenses (SIL OFL 1.1, MIT,
9
+ CC BY 4.0, Apache 2.0). The full texts and attributions are in
10
+ packages/fonts/LICENSE.txt.
11
+
12
+ Third-party npm dependencies are installed from the registry with their own
13
+ licenses; THIRD_PARTY_NOTICES.md lists them.
14
+
15
+ turno is an independent project. It is not affiliated with, endorsed by or
16
+ sponsored by Anthropic, OpenAI, GitHub, Google, Anysphere or any other vendor
17
+ whose tools it can launch. Product names are used only to say what turno works
18
+ with.
package/README.md CHANGED
@@ -1,3 +1,336 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wimo-dev/turno/main/docs/assets/logo-dark.svg">
4
+ <img src="https://raw.githubusercontent.com/wimo-dev/turno/main/docs/assets/logo-light.svg" alt="turno" width="168" height="56">
5
+ </picture>
6
+ </p>
2
7
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
8
+ <p align="center">
9
+ <b>One MCP gateway and per-folder accounts for Claude Code, Codex, Copilot CLI and Cursor CLI.</b>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/turno-cli"><img alt="npm" src="https://img.shields.io/npm/v/turno-cli?color=2457F5"></a>
14
+ <a href="https://github.com/wimo-dev/turno/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/wimo-dev/turno/actions/workflows/ci.yml/badge.svg"></a>
15
+ <a href="https://github.com/wimo-dev/turno/blob/main/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue"></a>
16
+ <a href="https://scorecard.dev/viewer/?uri=github.com/wimo-dev/turno"><img alt="OpenSSF Scorecard" src="https://api.scorecard.dev/projects/github.com/wimo-dev/turno/badge"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ English · <a href="https://github.com/wimo-dev/turno/blob/main/README.es.md">Español</a>
21
+ </p>
22
+
23
+ Every coding-agent session starts its own copy of every MCP server. Eight sessions with six
24
+ common servers is **3,163 MiB in 56 processes**. turno starts each server once,
25
+ only when a tool is called, behind one local gateway that every session of every agent shares:
26
+ **847 MiB while all six run, 103 MiB while they sit idle**
27
+ ([benchmark](https://github.com/wimo-dev/turno/blob/main/BENCHMARKS.md)). It also gives each folder its own account, so work repositories
28
+ open with your work login and everything else with your personal one.
29
+
30
+ ![turno: profiles for two agents, one gateway, the status line](https://raw.githubusercontent.com/wimo-dev/turno/main/docs/assets/demo.gif)
31
+
32
+ ## Install
33
+
34
+ ```sh
35
+ npx turno-cli@latest doctor # try it without installing: checks your agents and config
36
+ npm install --global turno-cli # macOS or Linux, Node 22.11+
37
+ brew tap wimo-dev/turno && brew trust wimo-dev/turno && brew install turno # or Homebrew
38
+ ```
39
+
40
+ The npm package is `turno-cli`; the command it installs is `turno`.
41
+
42
+ Then move your MCP servers behind the gateway:
43
+
44
+ ```sh
45
+ turno mcp import --move-secrets --write # mcp.toml from the servers you already have
46
+ turno mcp daemon start # the gateway, kept alive by launchd
47
+ turno mcp sync # point every agent profile at it
48
+ ```
49
+
50
+ Nothing leaves your machine: no account, no telemetry, no proxy for model traffic.
51
+
52
+ ## What it does
53
+
54
+ - **One MCP gateway for every session.** `mcpd` listens on `127.0.0.1`, answers `initialize` and
55
+ the tool lists from a cache, starts a server the first time one of its tools is called, shares
56
+ that process between sessions where it is safe (`shared`, `project` or `session` scope) and
57
+ stops it when idle. Secrets live in the macOS Keychain, not in agent configs.
58
+ - **An account per folder.** `turno profile assign ~/code/acme work` and every agent you open in
59
+ that repository uses your work login; `turno auto` picks it, and `turno status` shows who is
60
+ logged in where. Conversations, skills and settings stay shared between your Claude Code
61
+ profiles, so `turno work --resume <id>` continues a session started with another account.
62
+ - **Four agents, one setup.** The same profiles, folder rules and gateway for:
63
+
64
+ | Agent | Profile | Gateway entries | Example |
65
+ |---|---|---|---|
66
+ | Claude Code | `~/.claude-<p>`, `claude-<p>` | `.claude.json` | `turno work` |
67
+ | Codex CLI | `~/.codex-<p>`, `codex-<p>` | `config.toml`, token from the environment | `turno auto --agent codex` |
68
+ | GitHub Copilot CLI | `~/.copilot-<p>`, `copilot-<p>` | `mcp-config.json` | `copilot-work` |
69
+ | Cursor CLI | `~/.cursor-<p>`, `cursor-agent-<p>` | `~/.cursor/mcp.json`, routed by environment | `cursor-agent-work` |
70
+
71
+ opencode, Gemini CLI, Goose, Crush, Droid and Kiro can use the gateway too:
72
+ `turno mcp config --agent <name>` prints their entries. See [docs/agents.md](https://github.com/wimo-dev/turno/blob/main/docs/agents.md).
73
+ - **A status line** for Claude Code with the account, its 5 h and weekly usage, context, branch
74
+ and cost, with Nerd Font icons it installs for you (or Unicode where there is none).
75
+ - **A browser with real profiles** (optional `turno-browser`): an MCP server that drives your
76
+ installed Chrome with one persistent profile per identity, so an agent works in the sessions
77
+ you signed into by hand.
78
+
79
+ ## Quick start
80
+
81
+ ```sh
82
+ turno profile add work --color violet # ~/.claude-work and the claude-work command
83
+ turno profile add personal
84
+ claude-work # sign in once per profile (/login)
85
+ turno profile assign ~/code/acme work # this folder and everything under it
86
+ turno config set default personal # folders without a rule
87
+ cd ~/code/acme && turno auto # Claude Code, signed in as work
88
+ ```
89
+
90
+ Codex, Copilot and Cursor profiles are the same with `--agent codex|copilot|cursor`. Point your
91
+ terminal or editor at `turno auto` (or the `turno-auto` launcher) and every folder opens with
92
+ its account.
93
+
94
+ ## Benchmark
95
+
96
+ Six popular local MCP servers (Playwright, Chrome DevTools, filesystem, memory, sequential
97
+ thinking, Context7), each session running `initialize` and `tools/list` on all of them. Resident
98
+ memory of every process involved, Apple M3 with 16 GB, Node 26, 2026-11-16:
99
+
100
+ | Sessions | Each session starts its own servers | turno, all six servers running | turno, idle (tool lists cached) |
101
+ |---|---|---|---|
102
+ | 4 | 1,410 MiB, 28 processes | 692 MiB, 8 processes | 101 MiB, 1 process |
103
+ | 8 | 3,163 MiB, 56 processes | 847 MiB, 8 processes | 103 MiB, 1 process |
104
+
105
+ Started the way most server READMEs suggest (`npx -y <package>`), 4 sessions take
106
+ 3,123 MiB in 52 processes. Reproduce it with `node bench/mcp-ram.mjs --sessions 8`;
107
+ method and caveats in [BENCHMARKS.md](https://github.com/wimo-dev/turno/blob/main/BENCHMARKS.md).
108
+
109
+ ## How it compares
110
+
111
+ | | Accounts per folder | Several agents | Shared MCP processes | Status line | Notes |
112
+ |---|---|---|---|---|---|
113
+ | **turno** | yes | Claude Code, Codex, Copilot CLI, Cursor CLI | yes, lazy | yes | CLI, local only |
114
+ | [claude-swap](https://github.com/realiti4/claude-swap) | switch, not per folder | Claude Code | no | no | usage dashboard, parallel sessions |
115
+ | [clauth](https://github.com/uwuclxdy/clauth) | switch | Claude Code | no | no | TUI, cross-account delegation |
116
+ | [cc-switch](https://github.com/farion1231/cc-switch) | no | many | no (manages MCP config) | no | desktop app, provider switching |
117
+ | [ccstatusline](https://github.com/sirmalloc/ccstatusline) | no | Claude Code | no | yes | the most customizable status line |
118
+ | [MetaMCP](https://github.com/metatool-ai/metamcp), [mcp-proxy](https://github.com/sparfenyuk/mcp-proxy) | no | any MCP client | aggregates or bridges | no | Docker / transport bridge |
119
+ | Plain `CLAUDE_CONFIG_DIR` | by hand | one | no | no | what turno automates |
120
+
121
+ If you only need one of these pieces, those tools are good at it. turno is for the case where
122
+ you run many sessions of several agents with more than one account.
123
+
124
+ ## FAQ
125
+
126
+ **Is using several accounts allowed?** That depends on your plan, not on turno. turno runs each
127
+ vendor's own, unmodified CLI, and each account signs in with the vendor's own login in its own
128
+ folder. The intended use is separate work and personal accounts. Do not use it to get around
129
+ usage limits or safeguards; see [Vendor terms](#vendor-terms).
130
+
131
+ **Where are my credentials?** Where each agent keeps them, inside that profile's folder (or the
132
+ Keychain where the agent uses it). turno never reads, copies or forwards login tokens. MCP
133
+ secrets you move with `--move-secrets` go to the macOS Keychain.
134
+
135
+ **Does turno see my prompts or model traffic?** No. It launches the agent and gets out of the
136
+ way. Only MCP tool calls go through `mcpd`, on `127.0.0.1`, with a bearer token, and requests
137
+ with an `Origin` header are rejected so web pages cannot reach it.
138
+
139
+ **Linux? Windows?** Linux works for everything except the Keychain and the LaunchAgent (both
140
+ have open issues). Windows is not supported.
141
+
142
+ **How do I undo it?** Every command that writes keeps a copy of each file it changes:
143
+ `turno undo --list` shows them and `turno undo <stamp>` puts them back. To remove turno,
144
+ `turno mcp daemon stop`, undo the `mcp sync`, delete the `claude-<p>`-style launchers in
145
+ `~/.local/bin` and `npm uninstall --global turno-cli`. Profile folders stay until you delete them.
146
+
147
+ ## Reference
148
+
149
+ `turno --help` groups the commands and `turno <command> --help` explains each. Commands that
150
+ only read take `--json`; commands that write take `--dry-run`, keep a copy of each file they
151
+ change, and print the `turno undo <stamp>` that puts them back.
152
+
153
+ | Command | What it does |
154
+ |---|---|
155
+ | `turno <profile> [args]`, `turno run <profile\|auto> [args]` | the profile's agent with that account (args pass through) |
156
+ | `turno auto [--agent codex\|copilot\|cursor]` | the profile assigned to the current folder |
157
+ | `turno profile list\|add\|repair\|remove\|which\|assign\|unassign` | the profiles, and which folders use each |
158
+ | `turno mcp list\|sync\|config\|import\|install\|refresh\|doctor\|daemon ...` | the MCP gateway, and entries for other agents |
159
+ | `turno status` | one screen: this folder, profiles and usage, sessions, mcpd |
160
+ | `turno limit show [--watch]\|set\|clear` | usage windows per account, and exhausted marks |
161
+ | `turno session list\|handoff <p> [--fork]` | open sessions, and the command to continue this one under another profile |
162
+ | `turno open [profile] <url>` | open a link; claude.ai links use that profile's Chrome profile |
163
+ | `turno identity list\|add\|remove\|login\|prefer\|log` | service accounts for the bridge, browser identities |
164
+ | `turno secret set\|has\|rm\|list` | MCP secrets in the macOS Keychain |
165
+ | `turno browser bench` | how automation-fingerprint test pages see each browser engine |
166
+ | `turno ui status\|install` | the status line, its font and icons in every terminal |
167
+ | `turno doctor [--fix]` | check everything and repair what is safe to repair |
168
+ | `turno config path\|get\|set\|unset\|edit\|check` | config.toml without losing its comments |
169
+ | `turno undo [--list] [<stamp>\|last]` | put back the files a command changed |
170
+ | `turno upgrade [--check]`, `turno version` | update turno the way it was installed |
171
+ | `turno completion zsh\|bash\|fish` | shell completion, including profiles and config keys |
172
+
173
+ ### Config
174
+
175
+ `~/.config/turno/config.toml`:
176
+
177
+ ```toml
178
+ system = "personal" # account the plain `claude` command uses
179
+ default = "personal" # profile for folders without a rule
180
+ # fallback = "work" # optional, off unless set; read "Vendor terms" first
181
+
182
+ [profiles.work]
183
+ color = "violet" # status line pill
184
+ [profiles.personal]
185
+ browser = "default" # claude.ai links open in the default browser
186
+ [profiles.cx]
187
+ agent = "codex"
188
+
189
+ [[projects]]
190
+ path = "~/code/acme"
191
+ profile = "work"
192
+ ```
193
+
194
+ ### MCP gateway
195
+
196
+ `~/.config/turno/mcp.toml`:
197
+
198
+ ```toml
199
+ [server.calendar]
200
+ command = "cal-mcp"
201
+ package = "@calcom/cal-mcp@1.4.0" # `turno mcp install` pins it instead of npx per start
202
+ env = { CAL_API_KEY = "keychain:turno/calendar/api-key" }
203
+ scope = "shared" # one process for every session
204
+
205
+ [server.devtools]
206
+ command = "chrome-devtools-mcp"
207
+ scope = "session" # one per agent session, stopped when it ends
208
+ idle = "15m"
209
+
210
+ [server.issues]
211
+ command = "issues-mcp"
212
+ [server.issues.variant.work] # the work profile reaches a different account
213
+ env = { ISSUES_TOKEN = "keychain:turno/issues/work" }
214
+
215
+ [server.docs]
216
+ url = "https://docs.example.com/mcp" # remote, written straight into each profile
217
+ ```
218
+
219
+ Each variant per profile runs separately, so two profiles can reach two accounts of the same
220
+ service. Details: [docs/mcp.md](https://github.com/wimo-dev/turno/blob/main/docs/mcp.md).
221
+
222
+ ### Browser with real profiles
223
+
224
+ ```sh
225
+ npm install --global turno-browser # optional
226
+ turno identity add browser:school # an identity and its mcp.toml entry
227
+ turno identity login browser:school # sign in by hand once; cookies persist
228
+ ```
229
+
230
+ It drives the installed Google Chrome, headed, with a persistent profile per identity and no
231
+ injected scripts ([ADR 0005](https://github.com/wimo-dev/turno/blob/main/docs/decisions/0005-stealth-browser-defaults.md)).
232
+
233
+ **Acceptable use.** Use it with your own accounts, on sites whose terms allow automated access
234
+ by you, and at a human pace. Do not use it to get around access controls, paywalls, CAPTCHAs or
235
+ rate limits, to scrape at scale, or to access accounts that are not yours.
236
+
237
+ ### Accounts bridge
238
+
239
+ A builtin MCP server (`builtin = "accounts"` in `mcp.toml`) lets a session in one profile
240
+ delegate a task to a service account (a Linear workspace, a mail connector) that only another
241
+ profile is signed into. Write tasks need your confirmation, and every call goes to an audit log
242
+ (`turno identity log`).
243
+
244
+ ### Status line
245
+
246
+ ![The turno status line with Nerd Font icons and with Unicode icons](https://raw.githubusercontent.com/wimo-dev/turno/main/docs/assets/statusline.png)
247
+
248
+ ```sh
249
+ turno ui install # font + statusLine in the shared settings.json
250
+ turno ui install --terminal current # also set the font in this terminal
251
+ ```
252
+
253
+ Row 1: profile and plan, 5 h and weekly usage of that account with time to reset, context, and
254
+ a warning when the folder belongs to another profile. Row 2: project and worktree, branch, lines
255
+ changed, model and effort, and the API-equivalent cost of the conversation including subagents.
256
+ Details: [docs/ui.md](https://github.com/wimo-dev/turno/blob/main/docs/ui.md).
257
+
258
+ ### Claude Code plugin
259
+
260
+ `plugins/turno` adds session handoff and fork skills and a hook that records when a profile
261
+ reaches its usage limit, so `turno status` can show it:
262
+
263
+ ```
264
+ /plugin marketplace add wimo-dev/turno
265
+ /plugin install turno@turno
266
+ ```
267
+
268
+ ### Files
269
+
270
+ | Path | What |
271
+ |---|---|
272
+ | `~/.config/turno/config.toml` | profiles and folder rules |
273
+ | `~/.config/turno/mcp.toml` | MCP servers behind the gateway |
274
+ | `~/.config/turno/accounts.toml` | service accounts for the bridge |
275
+ | `~/.local/state/turno/` | usage, run records, logs, backups, the mcpd token |
276
+ | `~/.local/share/turno/` | installed servers, tool cache, browser identities |
277
+
278
+ All three honor `XDG_CONFIG_HOME`, `XDG_STATE_HOME` and `XDG_DATA_HOME`.
279
+
280
+ ## Disclaimers
281
+
282
+ ### Not affiliated
283
+
284
+ turno is an independent open-source project. It is not affiliated with, endorsed by or
285
+ sponsored by Anthropic, OpenAI, GitHub, Google, Anysphere or any other vendor. Claude, Claude
286
+ Code, Codex, Copilot, Cursor and Gemini are trademarks of their owners; turno uses the names
287
+ only to say which tools it works with. turno runs the vendors' own, unmodified command-line
288
+ tools.
289
+
290
+ ### Vendor terms
291
+
292
+ Each account you add is yours and stays bound by its vendor's terms; turno does not change
293
+ them. turno never reads, stores or forwards your login tokens, and it does not proxy model
294
+ traffic: every agent logs in by itself, in its own directory. Before you use several accounts:
295
+
296
+ - Check that your plan allows it, and use each account for what its terms allow (for example,
297
+ a work account for work).
298
+ - The `fallback` setting is off by default. It chooses which of your own accounts opens a
299
+ folder while another is marked exhausted. Vendors' usage policies forbid creating or using
300
+ accounts to get around usage limits or safeguards, so read your plan's terms before you set
301
+ it, and do not use it for that.
302
+
303
+ ### No warranty
304
+
305
+ turno is provided "as is", without warranty of any kind (Apache License 2.0, sections 7 and 8).
306
+ It edits agent config files and launches programs as your user; every write keeps a backup
307
+ that `turno undo` restores.
308
+
309
+ ### Update check
310
+
311
+ Interactive commands ask the npm registry for a newer version at most once a day, sending only
312
+ the package name. Turn it off with `update_check = false` in config.toml, `DO_NOT_TRACK=1`,
313
+ `NO_UPDATE_NOTIFIER=1` or `TURNO_NO_UPDATE_CHECK=1`; it is also off in CI and outside a
314
+ terminal. turno sends no other data anywhere.
315
+
316
+ ## Contributing
317
+
318
+ Issues labeled [good first issue](https://github.com/wimo-dev/turno/labels/good%20first%20issue)
319
+ are a good start. Read [CONTRIBUTING.md](https://github.com/wimo-dev/turno/blob/main/CONTRIBUTING.md), the
320
+ [Code of Conduct](https://github.com/wimo-dev/turno/blob/main/CODE_OF_CONDUCT.md) and the [AI policy](https://github.com/wimo-dev/turno/blob/main/AI_POLICY.md). Questions and ideas go
321
+ to [Discussions](https://github.com/wimo-dev/turno/discussions) (there is an Español
322
+ category). Security issues: [SECURITY.md](https://github.com/wimo-dev/turno/blob/main/SECURITY.md).
323
+
324
+ ```sh
325
+ pnpm install && pnpm build
326
+ pnpm check # typecheck, tests (sandboxed HOME), repository text rules, licenses
327
+ ```
328
+
329
+ Design: [docs/design](https://github.com/wimo-dev/turno/blob/main/docs/design/2026-11-12-claudio-ecosystem-design.md). Decisions:
330
+ [docs/decisions](https://github.com/wimo-dev/turno/blob/main/docs/decisions/). Progress: [docs/STATUS.md](https://github.com/wimo-dev/turno/blob/main/docs/STATUS.md).
331
+
332
+ ## License
333
+
334
+ Apache License 2.0 ([LICENSE](https://github.com/wimo-dev/turno/blob/main/LICENSE), [NOTICE](https://github.com/wimo-dev/turno/blob/main/NOTICE)). The bundled fonts keep their own
335
+ licenses ([packages/fonts/LICENSE.txt](https://github.com/wimo-dev/turno/blob/main/packages/fonts/LICENSE.txt)); dependencies are listed in
336
+ [THIRD_PARTY_NOTICES.md](https://github.com/wimo-dev/turno/blob/main/THIRD_PARTY_NOTICES.md). Made in Monterrey, Mexico.
@@ -0,0 +1,54 @@
1
+ import { appendFileSync, chmodSync, mkdirSync, readFileSync } from "node:fs";
2
+ import { dirname } from "node:path";
3
+ import { paths } from "../core/paths.js";
4
+ export const TASK_LIMIT = 500;
5
+ /** Append one entry (file mode 600). Never throws: auditing must not break a delegation. */
6
+ export function appendAudit(entry, env = process.env) {
7
+ const full = {
8
+ ts: entry.ts ?? new Date().toISOString(),
9
+ caller: entry.caller,
10
+ account: entry.account,
11
+ owner: entry.owner,
12
+ write: entry.write,
13
+ task: entry.task.slice(0, TASK_LIMIT),
14
+ outcome: entry.outcome,
15
+ detail: entry.detail,
16
+ durationMs: entry.durationMs,
17
+ costUsd: entry.costUsd,
18
+ };
19
+ const file = paths(env).auditLog;
20
+ try {
21
+ mkdirSync(dirname(file), { recursive: true });
22
+ appendFileSync(file, `${JSON.stringify(full)}\n`, { mode: 0o600 });
23
+ chmodSync(file, 0o600);
24
+ }
25
+ catch {
26
+ /* best effort */
27
+ }
28
+ return full;
29
+ }
30
+ /** The last `limit` entries, oldest first. Malformed lines are skipped. */
31
+ export function readAudit(limit = 20, env = process.env) {
32
+ let text = "";
33
+ try {
34
+ text = readFileSync(paths(env).auditLog, "utf8");
35
+ }
36
+ catch (err) {
37
+ if (err.code === "ENOENT")
38
+ return [];
39
+ throw err;
40
+ }
41
+ const out = [];
42
+ for (const line of text.split("\n")) {
43
+ if (!line.trim())
44
+ continue;
45
+ try {
46
+ out.push(JSON.parse(line));
47
+ }
48
+ catch {
49
+ /* skip */
50
+ }
51
+ }
52
+ return limit > 0 ? out.slice(-limit) : out;
53
+ }
54
+ //# sourceMappingURL=audit.js.map