xclaude-cli 0.1.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/LICENSE +21 -0
- package/README.md +93 -0
- package/dist/xclaude.js +4293 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ArmCyber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# xclaude
|
|
2
|
+
|
|
3
|
+
Run [Claude Code](https://code.claude.com) under several claude.ai logins, such as a personal one and one per organization seat, even at the same time in different terminals. Conversations, prompt history, memory and personal content (skills, agents, commands, plugins…) are shared by every login, so you can continue a conversation under another account.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
xclaude add acme # new account, log in with /login
|
|
7
|
+
xclaude acme -c --chrome # Claude Code on acme, flags passed through
|
|
8
|
+
xclaude # pick an account, then Claude Code
|
|
9
|
+
xclaude acme auth status # any claude subcommand, run as acme
|
|
10
|
+
xclaude tmux new api acme -c # tmux session "api" running Claude on acme
|
|
11
|
+
xclaude tmux attach api # back to it later
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Needs macOS or Linux (WSL counts), Node 22.15 or later, and [Claude Code](https://code.claude.com/docs/en/setup). `xclaude tmux` needs tmux 3.0 or later.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm i -g xclaude-cli
|
|
20
|
+
xclaude add personal # then log in with /login
|
|
21
|
+
xclaude shell install # completion in ~/.zshrc and/or ~/.bashrc
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Update with `npm i -g xclaude-cli@latest`. Update Claude Code with `claude update` (or `xclaude <any> update`).
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
| Command | What it does |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `xclaude <account> [claude args…]` | Claude Code as that account; every argument goes to `claude` |
|
|
31
|
+
| `xclaude [claude flags…]` | the same, after picking the account (↑/↓, 1–9, Enter; Esc cancels) |
|
|
32
|
+
| `xclaude add <name> [--model M] [--effort E] [--args "…"]` | add an account, then log in with `/login` |
|
|
33
|
+
| `xclaude set <name> [--model M] [--effort E] [--args "…"] [--unset model\|effort\|args]` | change an account's defaults; with no options, show them |
|
|
34
|
+
| `xclaude set main --enable\|--disable` | use the login in `~/.claude` (plain `claude`'s) as the account `main` |
|
|
35
|
+
| `xclaude ls` | accounts with their login, defaults and config dir |
|
|
36
|
+
| `xclaude rm <name> [--keep-login] [-y]` | remove an account and log it out; its folder keeps only its links, so its old conversations still open their saved long outputs. Run it on the name again to delete that folder (only while it holds nothing but links) |
|
|
37
|
+
| `xclaude rm --leftovers [-y]` | delete the leftover folders of all removed accounts, after a confirmation |
|
|
38
|
+
| `xclaude tmux new\|attach\|ls\|kill` | Claude Code in tmux sessions, by label |
|
|
39
|
+
| `xclaude shell install\|uninstall [--bash] [--zsh]` | completion (and the guard) in your shell |
|
|
40
|
+
| `xclaude shell completion bash\|zsh` | print the completion script, to load it some other way |
|
|
41
|
+
| `xclaude guard on\|off\|status` | make bare `claude` refuse to run in your shells |
|
|
42
|
+
| `xclaude doctor [--fix]` | check links, logins and setup; `--fix` repairs |
|
|
43
|
+
| `xclaude help [command]`, `-h`, `-v` | help for a command; `-v` prints the version |
|
|
44
|
+
|
|
45
|
+
Defaults are added before your arguments, and what you type wins: `xclaude acme --model sonnet` uses sonnet even if acme defaults to opus. `--effort` takes `low`, `medium`, `high`, `xhigh`, `max` or `ultracode`. Log in again any time with `xclaude <account> auth login`, or `/login` inside a session.
|
|
46
|
+
|
|
47
|
+
## tmux
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
xclaude tmux new api acme -c # session "api": Claude on acme, attached
|
|
51
|
+
xclaude tmux new web --dir ~/code/web --detach beta
|
|
52
|
+
xclaude tmux new notes --empty # just a shell
|
|
53
|
+
xclaude tmux ls # LABEL ACCOUNT WORKDIR ATTACHED CREATED CLAUDE
|
|
54
|
+
xclaude tmux attach # pick a session
|
|
55
|
+
xclaude tmux kill api
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
xclaude's options (`--dir`, `--detach`, `--empty`) come right after the label, and Claude's go after the account. Quitting Claude leaves a shell in the session; up-arrow reruns it. The `CLAUDE` column shows whether Claude is working, idle or needs input. The session's status bar shows the account (turn that off with `"tmux": { "statusRight": false }` in the config).
|
|
59
|
+
|
|
60
|
+
## Shell setup and the guard
|
|
61
|
+
|
|
62
|
+
`xclaude shell install` adds a small block to `~/.zshrc` (under `$ZDOTDIR` when set) and/or `~/.bashrc`, and on macOS to a `~/.bash_profile` that doesn't load `~/.bashrc`. It loads completion for commands, accounts, Claude's flags and values (models, effort, `--resume` sessions, paths) and tmux labels. `xclaude shell uninstall` removes it.
|
|
63
|
+
|
|
64
|
+
`xclaude guard on` makes bare `claude` print a reminder instead of running, so you don't start a session under the wrong login by habit. It still works inside Claude Code sessions, in anything xclaude starts, and whenever xclaude isn't installed.
|
|
65
|
+
|
|
66
|
+
## What's shared
|
|
67
|
+
|
|
68
|
+
- **Shared by all accounts:** conversations and their checkpoints (`projects`, `file-history`), prompt history, task lists, plans, running-session info, personal skills, agents, commands, rules, output styles, hooks and plugins, and `~/.claude/CLAUDE.md`.
|
|
69
|
+
- **Per account:** the login, `.claude.json` (MCP servers, folder trust), `settings.json` (so plugins, hooks and the statusline are enabled per account), keybindings, background sessions and caches.
|
|
70
|
+
|
|
71
|
+
Sharing works by linking each account's directories into `~/.claude`, which plain `claude` keeps using as before. Don't open the same conversation in two terminals at once. Scripts can read `XCLAUDE_ACCOUNT` to show the account, for example in a statusline.
|
|
72
|
+
|
|
73
|
+
## Files
|
|
74
|
+
|
|
75
|
+
- `~/.xclaude/config.json` holds accounts, defaults and settings. Most of it is edited through the commands; by hand you can add `share.add` / `share.remove` (extra directories to share, or built-in ones to stop sharing), `claudePath` (a fixed `claude` binary) and `tmux.statusRight` ([docs/architecture.md](docs/architecture.md#2-layout) has the format). `~/.xclaude/accounts/<name>/` is each account's `CLAUDE_CONFIG_DIR` (`xclaude ls` prints it, e.g. for an editor's environment settings). `XCLAUDE_HOME` moves `~/.xclaude`; set it before adding accounts, since on macOS the login is tied to the exact directory path and moving it later means logging in again.
|
|
76
|
+
- `~/.claude` stays the shared store; nothing in it moves.
|
|
77
|
+
|
|
78
|
+
## Uninstall
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
xclaude rm <name> # for each account (logs it out)
|
|
82
|
+
xclaude shell uninstall
|
|
83
|
+
npm rm -g xclaude-cli
|
|
84
|
+
rm -rf ~/.xclaude
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Your conversations stay in `~/.claude`.
|
|
88
|
+
|
|
89
|
+
More detail: [docs/architecture.md](docs/architecture.md).
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|