@amdahl/cli 0.2.4 → 0.3.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 (3) hide show
  1. package/README.md +64 -5
  2. package/dist/amdahl.js +662 -342
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -56,10 +56,60 @@ amdahl login
56
56
  `npx @amdahl/cli ...`. That package ([packages/amdahl](packages/amdahl)) has no
57
57
  code of its own: it depends on `@amdahl/cli` at the same version and runs it.
58
58
 
59
- To connect an AI client, run `amdahl install claude-code` (or `codex`,
59
+ The quickest way to start is `npx amdahl` with nothing after it, in a
60
+ terminal. It walks you through setup:
61
+
62
+ ```
63
+ $ npx amdahl
64
+ Amdahl · predictive ML for GTM
65
+ Set up in:
66
+ > [x] Claude Code
67
+ [ ] Cursor
68
+ [ ] Codex
69
+ (Use the arrow keys, Space to tick or untick, then Enter)
70
+ Opening your browser…
71
+ ✓ Signed in · Acme
72
+ ✓ Added to Claude Code
73
+ Try it: in Claude Code, run /mcp once to connect, then say "make this email sound less like AI"
74
+ ```
75
+
76
+ It finds Claude Code, Cursor and Codex by their command on your PATH
77
+ (`claude`, `cursor`, `codex`) or their folder in your home folder (`.claude`,
78
+ `.cursor`, `.codex`), and ticks the ones it finds. Enter accepts. If you are
79
+ not signed in, it signs you in through the browser first. It prints the
80
+ sign-in link only if the browser could not be opened, or nothing came back
81
+ within 5 seconds, and it waits up to 15 minutes, so someone new can create
82
+ their workspace on the way and land back in the same setup. If the server
83
+ rejects a key set in
84
+ `AMDAHL_KEY` (or `AMDAHL_API_KEY`, `AMDAHL_ACCESS_TOKEN`, `--api-key`), it says
85
+ so and skips the browser sign-in, since that key would still win. Then it
86
+ sets up each client you ticked the way `amdahl install` does, one line each.
87
+ A client that fails prints
88
+ its error and the rest still run; the exit code is the first failure's. It
89
+ ends with something to try in the first client it set up. Each client then
90
+ signs in to Amdahl itself, once, the first time it connects: `/mcp` in
91
+ Claude Code, `codex mcp login amdahl` for Codex (always named, since the CLI
92
+ cannot tell whether it ran), and Cursor asks on first use.
93
+ `npx amdahl --verbose` also prints the files it wrote, the profile and where
94
+ the sign-in is stored.
95
+ Run it again once you are set up and it says `You're set up in Claude Code
96
+ and Cursor.` with a line to try, and asks nothing; if it cannot reach
97
+ Amdahl to check your sign-in, it still says so. Ctrl+C at the question stops
98
+ it with nothing written (exit 130).
99
+
100
+ It only does this for a person at a terminal. When stdin, stdout or stderr
101
+ (where the menu draws) is not a terminal, `CI` is set, an agent runs it (`CLAUDECODE` or `CURSOR_AGENT` is
102
+ set), `AMDAHL_NO_PROMPT=1` is set, or any flag other than `--verbose` is given
103
+ (such as `--json`), bare `amdahl` prints the usage to stderr and exits 2, as
104
+ before.
105
+
106
+ To connect one AI client yourself, run `amdahl install claude-code` (or `codex`,
60
107
  `cursor`). It adds the Amdahl MCP server and also installs the Amdahl skill,
61
108
  a map of everything Amdahl can do, so your agent knows which tool fits each
62
- job. The skill goes to the client's user skills folder:
109
+ job. If the client already points at Amdahl, `install` leaves that as it is
110
+ (for Claude Code it skips `claude mcp add` when `claude mcp get amdahl`
111
+ shows the same URL) and still installs the skill. If it cannot write the
112
+ client's config file, it exits 1 with `write_failed` and names the file. The skill goes to the client's user skills folder:
63
113
 
64
114
  | client | skill file |
65
115
  |---|---|
@@ -77,6 +127,7 @@ https://docs.amdahl.ai/skills/amdahl/SKILL.md.
77
127
  ## Quick start
78
128
 
79
129
  ```sh
130
+ amdahl # in a terminal: guided setup for Claude Code, Cursor and Codex
80
131
  amdahl login # sign in through the browser with your console account
81
132
  amdahl whoami # the account, workspace and role you are signed in as
82
133
  amdahl status # can this workspace optimize, and what blocks it
@@ -85,14 +136,21 @@ amdahl install claude-code # connect an AI client and add the Amdahl skill (al
85
136
  amdahl skills add <publisher>/<skill> # add a skill from amdahl.ai/skills to this project
86
137
  ```
87
138
 
88
- No workspace yet? `amdahl login` prints the console link where you can
89
- create one or join the beta. The CLI never creates or joins a workspace.
139
+ No workspace yet? With a work email, the sign-in page offers to create your
140
+ company's workspace and then finishes signing you in. If you signed in with
141
+ an address Amdahl can't use, the browser tab and the terminal say what to do
142
+ and link a new sign-in ("Sign in with your work email", "Sign in again" for
143
+ a subdomain address, "Try again" once you've confirmed your email), and the
144
+ terminal keeps waiting for it. Anything
145
+ else exits 5 with the one next step (ask your company's admins, try again
146
+ tomorrow, and so on). The CLI itself never creates or joins a workspace.
90
147
 
91
148
  On a server or in CI, skip `login` and set an API key in `AMDAHL_KEY`.
92
149
 
93
150
  ## Commands
94
151
 
95
152
  ```
153
+ amdahl (guided setup, in a terminal)
96
154
  amdahl login [--workspace <slug>] [--no-browser] [--port <n>] (alias: auth login)
97
155
  amdahl logout [--all] (alias: auth logout)
98
156
  amdahl whoami [--show-token] (alias: auth status)
@@ -285,7 +343,8 @@ the default profile). `whoami` names the source that won. `keys create`,
285
343
  tokens.
286
344
  - Tokens: the OS keychain (service `amdahl-cli`; macOS `security`, Linux
287
345
  `secret-tool`), passed on stdin, never on argv. Without a keychain:
288
- `credentials.json` (mode 0600) with a one-time warning.
346
+ `credentials.json` (mode 0600), named under `--verbose`. If that file is
347
+ ever readable by other users, the CLI makes it owner-only and warns.
289
348
  `AMDAHL_CREDENTIAL_STORE=keychain|file` forces either.
290
349
 
291
350
  ## Keys