@aisa-one/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 CHANGED
@@ -7,11 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [0.5.0] — Unreleased
10
+ ## [0.5.2] — 2026-09-10
11
11
 
12
- PR21 command-surface cleanup. Distinct from the unpublished `0.4.0` main
13
- baseline (registry latest remains `0.3.0`; `0.4.0` was never tagged or
14
- published).
12
+ Compatible patch on published `0.5.1`. Expanded `aisa login --help` for Agent
13
+ sign-in handoff, plus a default-off login-help evaluation. No auth runtime,
14
+ credential-precedence, or command-surface changes.
15
+
16
+ ### Changed
17
+
18
+ - `aisa login --help` owns accessible-browser vs persistent headless TTY, live
19
+ URL relay, one-time paste into the same living process, reuse of a running
20
+ login, stale-session recovery, no-TTY native MCP OAuth, and connected-only
21
+ after a successful balance check.
22
+
23
+ ### Added
24
+
25
+ - Default-off `eval/agent-quickstart/login-handoff/`. Excluded from the npm
26
+ package; does not run in default CI or against production AIsa credentials.
27
+
28
+ ## [0.5.1] — 2026-09-10
29
+
30
+ Compatible patch on published `0.5.0`. Browser-login-first onboarding
31
+ guidance and an opt-in Quickstart Skill evaluation. No new commands, auth
32
+ mechanisms, or credential-precedence changes.
33
+
34
+ ### Changed
35
+
36
+ - README, missing-key errors, `whoami`, and Router help recommend `aisa login`
37
+ (browser; stores a CLI key) before pasting a key. `AISA_API_KEY` and
38
+ `aisa login --key` remain for CI. Resolution order is unchanged:
39
+ `AISA_API_KEY`, then `~/.aisa/key`, then legacy login.
40
+ - Quick Start covers login, discovery, catalog browse, and quote. It does not
41
+ copy `aisa chat` or `aisa call`. Quote is a price observation; approval and
42
+ whether to execute remain caller-owned guidance, not an enforced CLI gate.
43
+
44
+ ### Added
45
+
46
+ - Default-off `eval/agent-quickstart/` Skill ablation. Reuses the existing
47
+ Router stub and pack path. Excluded from the npm package; does not run in
48
+ default CI or against production AIsa credentials.
49
+
50
+ ## [0.5.0] — 2026-09-09
51
+
52
+ PR21 command-surface cleanup. Published to npm as `0.5.0`. Distinct from the
53
+ unpublished `0.4.0` main baseline (`0.4.0` was never tagged or published).
15
54
 
16
55
  ### Breaking
17
56
 
@@ -41,7 +80,7 @@ published).
41
80
  ## [0.4.0] — unpublished main baseline
42
81
 
43
82
  Unpublished `main` candidate as of 2026-09-08. Not tagged and not on npm
44
- (registry latest remains `0.3.0`). Kept so the Router work and the
83
+ (skipped between `0.3.0` and published `0.5.0`). Kept so the Router work and the
45
84
  `api search` / `api show` / `run` deprecation history stay identifiable.
46
85
 
47
86
  ### Breaking
@@ -385,7 +424,9 @@ supports today; nothing here depends on a backend change.
385
424
  - Config commands (`aisa config get|set|list|reset`) and auth
386
425
  (`aisa login|logout|whoami`).
387
426
 
388
- [Unreleased]: https://github.com/AIsa-team/cli/compare/v0.5.0...HEAD
427
+ [Unreleased]: https://github.com/AIsa-team/cli/compare/v0.5.2...HEAD
428
+ [0.5.2]: https://github.com/AIsa-team/cli/compare/v0.5.1...v0.5.2
429
+ [0.5.1]: https://github.com/AIsa-team/cli/compare/v0.5.0...v0.5.1
389
430
  [0.5.0]: https://github.com/AIsa-team/cli/compare/v0.3.0...v0.5.0
390
431
  [0.4.0]: https://github.com/AIsa-team/cli/compare/v0.3.0...b5c0b04b2a7a2cb9efcb568be5ee5440d7f7d94d
391
432
  [0.3.0]: https://github.com/AIsa-team/cli/compare/v0.2.4...v0.3.0
package/README.md CHANGED
@@ -14,8 +14,8 @@ npm install -g @aisa-one/cli
14
14
  ## Quick Start
15
15
 
16
16
  ```bash
17
- # Authenticate (or set AISA_API_KEY)
18
- aisa login --key sk-your-api-key
17
+ # Sign in (browser; stores a CLI key — no key to copy)
18
+ aisa login
19
19
 
20
20
  # Discover published tools (Router; search/schema may be anonymous)
21
21
  aisa search "company facts" --json
@@ -25,17 +25,19 @@ aisa schema get_financial_company_facts --json
25
25
  aisa api list
26
26
  aisa api show financial
27
27
 
28
- # Chat with any model
29
- aisa chat "Explain quantum computing" --model claude-opus-4-6
30
-
31
- # Quote then execute a published Router tool (same request JSON)
28
+ # Quote a published Router tool (does not execute)
32
29
  aisa quote --input '{"calls":[{"call_id":"c1","tool":"get_financial_company_facts","arguments":{"ticker":"AAPL"}}]}' --json
33
- aisa call --input '{"calls":[{"call_id":"c1","tool":"get_financial_company_facts","arguments":{"ticker":"AAPL"}}]}' --json
34
30
  ```
35
31
 
36
- Get your API key at
37
- [console.aisa.one/api-keys](https://console.aisa.one/api-keys). New accounts
38
- receive $5 in free credits.
32
+ `aisa login` opens a browser, signs you in, and stores a CLI key. You do not
33
+ need to create or paste a key from the console. For CI or scripts, set
34
+ `AISA_API_KEY` or run `aisa login --key <key>`. New accounts receive $5 in
35
+ free credits.
36
+
37
+ This first block does not run `aisa chat` or `aisa call`. Quote is a price
38
+ observation, not authorization to execute. See
39
+ [Published tools](#published-tools-tool-router) for the quote/approval
40
+ contract before a billable call.
39
41
 
40
42
  Root help lists 21 explicit commands plus implicit `help`. Removed domain
41
43
  shortcuts and raw execution names are unknown commands — not aliases and
@@ -102,8 +104,10 @@ HTTP error; `3` means the Router returned a batch with at least one failed
102
104
  item.
103
105
 
104
106
  `search` and `schema` may be anonymous. `quote` and `call` require a
105
- configured AIsa API key: `AISA_API_KEY`, then `~/.aisa/key`, then legacy
106
- login. `aisa login` and `AISA_API_KEY` are alternatives. The default Router
107
+ configured AIsa API key. Sign in with `aisa login` first; it mints and stores
108
+ a CLI key. Resolution order is unchanged: `AISA_API_KEY`, then `~/.aisa/key`,
109
+ then legacy login. `AISA_API_KEY` still takes precedence over the stored key.
110
+ For CI, set `AISA_API_KEY` or use `aisa login --key <key>`. The default Router
107
111
  origin is `https://tools.aisa.one` (independent of `baseUrl` /
108
112
  `https://api.aisa.one`). Point a test Router at `AISA_ROUTER_BASE_URL` (origin
109
113
  or prefix before `/v1/tool-router/...`), or `aisa config set routerUrl`. There
@@ -319,7 +323,8 @@ Settings:
319
323
  independent of `baseUrl`); overridden by `AISA_ROUTER_BASE_URL`
320
324
  - `outputFormat` — `text` or `json`
321
325
 
322
- Environment variables: `AISA_API_KEY` takes precedence over the stored key.
326
+ `aisa login` stores a CLI key in `~/.aisa/key`. Environment variables:
327
+ `AISA_API_KEY` takes precedence over the stored key.
323
328
  `AISA_ROUTER_BASE_URL` is the Router origin/prefix before
324
329
  `/v1/tool-router/...` and overrides the default `https://tools.aisa.one`.
325
330
  `AISA_CACHE_DIR` relocates the cache. `GITHUB_TOKEN`
@@ -1,5 +1,5 @@
1
1
  import chalk from "chalk";
2
- import { setApiKey, clearApiKey, getApiKey, getKeySource, maskKey } from "../config.js";
2
+ import { setApiKey, clearApiKey, getApiKey, getKeySource, maskKey, AUTH_SETUP_GUIDANCE } from "../config.js";
3
3
  import { success, info } from "../utils/display.js";
4
4
  import { CONSOLE_URL, ENV_VAR_NAME } from "../constants.js";
5
5
  export async function loginAction(options) {
@@ -55,7 +55,7 @@ export function whoamiAction() {
55
55
  const source = getKeySource();
56
56
  if (!key) {
57
57
  info("Not authenticated.");
58
- console.log(chalk.gray(` Run "aisa login --key <key>" or set ${ENV_VAR_NAME}`));
58
+ console.log(chalk.gray(` ${AUTH_SETUP_GUIDANCE}`));
59
59
  return;
60
60
  }
61
61
  console.log(` Key: ${maskKey(key)}`);
@@ -27,6 +27,8 @@ export declare function mintCliKey(options?: {
27
27
  lang?: Lang;
28
28
  catcher?: OAuthCatcher;
29
29
  }): Promise<string>;
30
+ /** Commander after-help for `aisa login`. Mechanics only; runtime is unchanged. */
31
+ export declare function loginHelpAfter(): string;
30
32
  export declare function oauthLogin(options?: {
31
33
  open?: boolean;
32
34
  lang?: Lang;
@@ -319,6 +319,20 @@ export async function mintCliKey(options = {}) {
319
319
  setApiKey(minted.key);
320
320
  return minted.key;
321
321
  }
322
+ /** Commander after-help for `aisa login`. Mechanics only; runtime is unchanged. */
323
+ export function loginHelpAfter() {
324
+ return `
325
+ Default: open a browser this person can actually use (SSH/CI/no display skip the local open). The live authorize URL is printed at the same time — relay that exact URL immediately. Do not invent, shorten, or delay it.
326
+
327
+ --no-browser needs a persistent interactive TTY. Agents request only the one-time redirect URL or code — never an API key, access token, or refresh token. Paste that result into this same living process once. Reuse a running login; do not start another. "Done" is not that input. If they cannot type here, relay the paste through chat into this PTY. An empty line cancels.
328
+
329
+ If this process already timed out, or the URL/code is from an older run, start a fresh aisa login and use the new URL and its result. Do not reuse a stale paste.
330
+
331
+ No browser and no TTY: this CLI cannot complete OAuth here. Normal setup is native MCP OAuth at https://tools.aisa.one/mcp.
332
+
333
+ Do not report connected unless login stored a key and the following balance check succeeded. aisa whoami and a stored local key are not proof. Scripts/CI: AISA_API_KEY or --key.
334
+ `;
335
+ }
322
336
  export async function oauthLogin(options = {}) {
323
337
  if (options.open === false && !process.stdin.isTTY) {
324
338
  error("--no-browser needs an interactive terminal to paste the redirect URL into.");
@@ -32,7 +32,7 @@ export const ROUTER_EXITS = {
32
32
  const FLOW = "Recommended sequence: aisa search → aisa schema when has_full_schema=false → aisa quote → aisa call.";
33
33
  const INLINE = "--input is inline JSON text (no file required). Shell examples are POSIX sh with single-quoted --input; apostrophes are written as '\\'' so $(), backticks, and other expansions stay literal. -f FILE and -f - remain available.";
34
34
  const JSON_CONTRACT = "--json writes the unmodified application body, including MCP identifiers and numeric tokens. Human output maps only AISA_SEARCH_TOOL, AISA_BATCH_GET_SCHEMA, AISA_BATCH_QUOTE, and AISA_BATCH_USE to aisa search / schema / quote / call.";
35
- const KEY_RESOLUTION = "AISA_API_KEY, then ~/.aisa/key, then legacy login. aisa login and AISA_API_KEY are alternatives.";
35
+ const KEY_RESOLUTION = "Prefer aisa login (stores a CLI key). Resolution: AISA_API_KEY, then ~/.aisa/key, then legacy login. CI: AISA_API_KEY or aisa login --key.";
36
36
  const ENFORCED_OPTIONAL = `Enforced: invalid local input exits 2 and is not sent. A configured AIsa API key is optional (${KEY_RESOLUTION}).`;
37
37
  const ENFORCED_REQUIRED = `Enforced: quote and call refuse to run without a configured AIsa API key (${KEY_RESOLUTION}). Invalid local input exits 2 and is not sent. search and schema may be anonymous.`;
38
38
  const NOT_ENFORCED = "Not enforced: the CLI does not record quotes, approvals, or budget caps and does not reject an unquoted aisa call.";
@@ -1,7 +1,6 @@
1
1
  import ora from "ora";
2
2
  import chalk from "chalk";
3
- import { getApiKey } from "../config.js";
4
- import { ENV_VAR_NAME } from "../constants.js";
3
+ import { getApiKey, MISSING_API_KEY_GUIDANCE } from "../config.js";
5
4
  import { CliError, EXIT_PARTIAL, EXIT_TRANSPORT, transportError } from "../cli-error.js";
6
5
  import { routerPost } from "../router.js";
7
6
  import { error as printError } from "../utils/display.js";
@@ -61,7 +60,7 @@ async function runToolCommand(kind, operands, options, auth) {
61
60
  function requireRouterKey(kind) {
62
61
  const key = getApiKey();
63
62
  if (!key) {
64
- throw new CliError(`No API key found. Run "aisa login --key <key>" or set ${ENV_VAR_NAME}. ` +
63
+ throw new CliError(`${MISSING_API_KEY_GUIDANCE} ` +
65
64
  `search and schema may be anonymous; ${kind} will not run without a key. ` +
66
65
  `Do not invent a business result.`, EXIT_TRANSPORT);
67
66
  }
package/dist/config.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export declare function getApiKey(): string | undefined;
2
+ /** Next step when no local credential is present. Browser login first; env/--key are CI. */
3
+ export declare const AUTH_SETUP_GUIDANCE = "Run \"aisa login\". For CI, set AISA_API_KEY or use \"aisa login --key <key>\".";
4
+ export declare const MISSING_API_KEY_GUIDANCE = "No API key found. Run \"aisa login\". For CI, set AISA_API_KEY or use \"aisa login --key <key>\".";
2
5
  export declare function requireApiKey(): string;
3
6
  export declare function setApiKey(key: string): void;
4
7
  export declare function clearApiKey(): void;
package/dist/config.js CHANGED
@@ -84,10 +84,13 @@ export function getApiKey() {
84
84
  }
85
85
  return undefined;
86
86
  }
87
+ /** Next step when no local credential is present. Browser login first; env/--key are CI. */
88
+ export const AUTH_SETUP_GUIDANCE = `Run "aisa login". For CI, set ${ENV_VAR_NAME} or use "aisa login --key <key>".`;
89
+ export const MISSING_API_KEY_GUIDANCE = `No API key found. ${AUTH_SETUP_GUIDANCE}`;
87
90
  export function requireApiKey() {
88
91
  const key = getApiKey();
89
92
  if (!key) {
90
- console.error(`No API key found. Run "aisa login --key <key>" or set ${ENV_VAR_NAME}.`);
93
+ console.error(MISSING_API_KEY_GUIDANCE);
91
94
  process.exit(1);
92
95
  }
93
96
  return key;
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "0.5.0";
1
+ export declare const VERSION = "0.5.2";
2
2
  /** Root of the platform. Per-surface bases are derived in api.ts#resolveBases. */
3
3
  export declare const BASE_URL = "https://api.aisa.one";
4
4
  export declare const ENV_VAR_NAME = "AISA_API_KEY";
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.5.0";
1
+ export const VERSION = "0.5.2";
2
2
  /** Root of the platform. Per-surface bases are derived in api.ts#resolveBases. */
3
3
  export const BASE_URL = "https://api.aisa.one";
4
4
  export const ENV_VAR_NAME = "AISA_API_KEY";
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { VERSION } from "./constants.js";
4
4
  import { CliError } from "./cli-error.js";
5
5
  // Auth
6
6
  import { loginAction, logoutAction, whoamiAction } from "./commands/auth.js";
7
+ import { loginHelpAfter } from "./commands/oauth-login.js";
7
8
  // Account
8
9
  import { balanceAction, topupAction, usageAction } from "./commands/account.js";
9
10
  // API
@@ -75,6 +76,7 @@ program
75
76
  .description("Sign in to AIsa — browser sign-in by default, or --key to paste one")
76
77
  .option("--key <key>", "API key (skips the browser sign-in)")
77
78
  .option("--no-browser", "Print the sign-in URL and paste the redirect back (detected on its own over SSH)")
79
+ .addHelpText("after", loginHelpAfter())
78
80
  .action(wrap(loginAction));
79
81
  program
80
82
  .command("logout")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aisa-one/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "CLI for the AIsa unified AI infrastructure platform - one API key for 80+ LLMs and 900+ endpoints across finance, search, social, and video APIs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",