claude-use 2.9.0 → 4.0.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.
Files changed (3) hide show
  1. package/README.md +51 -33
  2. package/dist/cli.cjs +10914 -9614
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -57,49 +57,66 @@ Sharing composes through a cascade (shipped defaults, then a user-global overrid
57
57
 
58
58
  `claude` refuses to launch while `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN` or a `CLAUDE_CODE_USE_BEDROCK`/`VERTEX`/`FOUNDRY` variable is set in the environment, because those outrank every identity's stored credential and would make all identities authenticate as the same account. Opt in deliberately with `CLAUDE_USE_ALLOW_AMBIENT_CREDENTIAL=1` for one launch or `claude-use identity set <name> --allow-ambient-credential`.
59
59
 
60
- The full mechanics, including the merge algorithm, conditional sharing rules (age, size, git branch, environment), the ambient-credential launch guard, and how `~/.claude/projects/` history is pattern-matched, are in [docs/configuration-model.md](docs/configuration-model.md). Worked examples are in [docs/examples.md](docs/examples.md).
60
+ Providers and identities take their token from one `credential` block: an ordered list of sources (`env`, `file`, `command`, and the `op` and `keychain` presets, plus a `literal` placeholder for a local proxy), tried in turn, and a target (`bearer`, `apiKey`, or `oauthToken` for an identity). The token reaches the child's environment only; `check`, `doctor` and `--json` report the source kind and target, never the value.
61
+
62
+ The full mechanics, including the credential block, the merge algorithm, conditional sharing rules (age, size, git branch, environment), the ambient-credential launch guard, and how `~/.claude/projects/` history is pattern-matched, are in [docs/configuration-model.md](docs/configuration-model.md). Worked examples are in [docs/examples.md](docs/examples.md).
61
63
 
62
64
  ## CLI reference
63
65
 
64
66
  ```
67
+ claude-use <noun> <verb> [name] [options] # nouns: identity, profile, provider, rule
68
+
65
69
  claude-use identity add <name>
70
+ claude-use identity list [--json]
71
+ claude-use identity show <name> [--json]
72
+ claude-use identity set <name> [--default-profile <profile> | --no-default-profile] [--[no-]allow-ambient-credential]
73
+ claude-use identity set <name> [--credential <source>]... [--credential-target <bearer|apiKey|oauthToken>] [--no-credential]
74
+ claude-use identity remove <name> [--yes]
66
75
  claude-use identity use <name>
67
76
  claude-use @<name> # shorthand for `identity use <name>`
68
- claude-use identity list
69
- claude-use identity set-default-profile <identity> <profile>
70
- claude-use identity set <name> [--allow-ambient-credential | --no-allow-ambient-credential]
71
- claude-use identity resolve <name> # interactively resolve a retained superseded farm's conflicts
72
-
73
- claude-use profile create <name> [--extends <name>,<name>,...]
74
- claude-use profile list
75
- claude-use profile set-default <name>
76
- claude-use profile set <name> --category <cat>=<bool>[,<cat>=<bool>,...]
77
- claude-use profile set <name> --entry "<path>"=<bool>[,"<path>"=<bool>,...]
78
- claude-use profile set <name> [--skip-permissions] [--remote-control] [--headroom]
79
-
80
- claude-use provider add <name> --display-name <name> --base-url <url> (--token-env <VAR> | --token-command <argv...>) [--auth-scheme <bearer|apiKey>] [--env KEY=VALUE]
81
- claude-use provider list
82
- claude-use provider show <name>
83
- claude-use provider remove <name>
84
-
85
- claude-use headroom status
86
-
87
- claude @<identity> --headroom # one launch routed through headroom
88
- claude --no-headroom # one launch routed direct, overriding every layer
89
-
90
- claude-use rules add <path> [--profile <name>] [--identity <name>]
91
- claude-use rules list
92
- claude-use rules remove <path>
93
-
94
- claude-use configure <identity> [path]
95
- claude-use check [path] [--identity <name>]
96
- claude-use doctor
97
- claude-use run [args...]
77
+ claude-use identity resolve-conflicts <name> # interactively resolve a retained superseded farm's conflicts
78
+
79
+ claude-use profile add [name] [--extends <profile>]... [--description <text>] # interactive with no options on a terminal
80
+ claude-use profile set <name> [--category <category>=<bool>]... [--entry <category>/<path>=<bool>]...
81
+ claude-use profile set <name> [--extends <profile>]... [--no-extends] [--description <text> | --no-description]
82
+ claude-use profile set <name> [--[no-]launch-skip-permissions] [--[no-]launch-remote-control] [--[no-]launch-headroom]
83
+ claude-use profile set <name> [--launch-provider <provider> | --no-launch-provider]
84
+ claude-use profile list [--json]
85
+ claude-use profile show <name> [--json]
86
+ claude-use profile remove <name> [--yes]
87
+ claude-use profile use <name> # the global default configuration profile
88
+
89
+ claude-use provider add <name> --display-name <name> --base-url <url> (--credential <source>)... [--credential-target <bearer|apiKey>] [--env KEY=VALUE]...
90
+ claude-use provider set <name> [--display-name <name>] [--base-url <url>] [--credential <source>]... [--credential-target <bearer|apiKey>] [--env KEY=VALUE]... [--unset-env KEY]...
91
+ claude-use provider list [--json]
92
+ claude-use provider show <name> [--json]
93
+ claude-use provider remove <name> [--yes]
94
+
95
+ claude-use rule add <path> [--config-profile <profile>] [--identity <identity>]
96
+ claude-use rule set <path> [--config-profile <profile> | --no-config-profile] [--identity <identity> | --no-identity]
97
+ claude-use rule list [--json]
98
+ claude-use rule show <path> [--json]
99
+ claude-use rule remove <path> [--yes]
100
+
101
+ claude-use configure [path] [--identity <identity>]
102
+ claude-use check [path] [--identity <identity>] [--json] [--strict]
103
+ claude-use doctor [--json]
104
+ claude-use headroom status [--json]
105
+ claude-use completion <bash|zsh|fish>
98
106
  claude-use shim enable [--dir <path>] [--force]
99
107
  claude-use shim disable [--dir <path>] [--force]
108
+
109
+ claude-use run [@<identity>] [launch flags] [claude arguments]
110
+ # launch flags, recognised only before a `--` terminator:
111
+ # --identity <name> --config-profile <name> --provider <name> | --no-provider
112
+ # --category <category>=<bool> --share <category>/<path> --hide <category>/<path> (each repeatable)
113
+ # --[no-]skip-permissions --[no-]remote-control --[no-]headroom
114
+ claude @<identity> ... # the same, once `claude-use shim enable` has run
100
115
  ```
101
116
 
102
- `claude-use check [path]` resolves the full cascade for a directory without touching the farm, and is the primary way to answer "why is X shared or hidden here". `claude-use doctor` audits the whole `~/.claude-use` config graph at once: every identity, profile, `extends` chain, and directory rule, plus whether the right `claude-use` is the one actually on `PATH`.
117
+ Every `list`, `show`, `check`, `doctor` and `headroom status` prints text by default and JSON with `--json`. Prompts appear only when standard input is a terminal; without one, a command that needs input fails with the option that supplies it (a `remove` needs `--yes`). Failures print as `claude-use: <message>` and exit 1, usage errors exit 2, a selected provider or identity whose credential block yields no token exits 64, and `CLAUDE_USE_DEBUG=1` adds stack traces to unexpected errors. `claude-use completion <bash|zsh|fish>` prints a shell completion script.
118
+
119
+ `claude-use check [path]` resolves the full cascade for a directory without touching the farm, and is the primary way to answer "why is X shared or hidden here". `claude-use doctor` audits the whole `~/.claude-use` config graph at once: every identity, profile, `extends` chain, provider (naming the exact replacement for a file still in the format before the credential block) and directory rule, plus whether the right `claude-use` is the one actually on `PATH`.
103
120
 
104
121
  The full per-setting flag and environment-variable table (global, one-off, and directory-scoped forms of every setting), and the file-precedence rules `configure` uses when writing a toggle, are in [docs/cli-reference.md](docs/cli-reference.md).
105
122
 
@@ -112,7 +129,8 @@ src/
112
129
  cli.ts # entrypoint: dispatches on invoked name to launcher vs identity/profile-manager subcommands
113
130
  launcher.ts # runLauncher: thin orchestration over launcher/*
114
131
  launcher/ # argv parsing, the ambient-credential guard, identity/profile resolution, farm resync
115
- identityManager.ts, configProfiles.ts, directoryRules.ts # `claude-use identity`/`profile`/`rules` subcommands
132
+ identityManager.ts, configProfiles.ts, providers.ts, directoryRules.ts # the `identity`/`profile`/`provider`/`rule` nouns
133
+ program.ts, completion.ts # buildProgram (the whole command tree, side-effect free) and generated shell completion
116
134
  configure.ts, check.ts, doctor.ts, claudeShim.ts # interactive picker, dry-run inspector, whole-tree audit, `claude` shim
117
135
  resolve/ # the pure cascade resolver: flatten, decide, extends, walk, plan, reconcile
118
136
  config/ # Zod schemas, cosmiconfig loading, category classification, atomic JSON store