kenso 0.1.175 → 0.1.177
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 +6 -0
- package/dist/discover.json +1 -1
- package/dist/kenso.js +182 -31
- package/dist/operations.index.json +1 -1
- package/dist/operations.json +1 -1
- package/docs/auth.md +2 -0
- package/docs/crm.md +2 -2
- package/docs/reference.md +5 -5
- package/package.json +2 -2
package/dist/kenso.js
CHANGED
|
@@ -386,6 +386,79 @@ var init_folder = __esm({
|
|
|
386
386
|
}
|
|
387
387
|
});
|
|
388
388
|
|
|
389
|
+
// src/core/endpoint.ts
|
|
390
|
+
function originOf(url) {
|
|
391
|
+
try {
|
|
392
|
+
return new URL(url).origin;
|
|
393
|
+
} catch {
|
|
394
|
+
return void 0;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function checkEndpoint(url, variable) {
|
|
398
|
+
let parsed2;
|
|
399
|
+
try {
|
|
400
|
+
parsed2 = new URL(url);
|
|
401
|
+
} catch {
|
|
402
|
+
throw usageError(`${variable} is not a URL.`, { field: variable, hint: `Set ${variable} to an https URL, or unset it.` });
|
|
403
|
+
}
|
|
404
|
+
if (parsed2.protocol === "https:" || parsed2.protocol === "http:" && LOOPBACK_HOSTS.has(parsed2.hostname)) return parsed2;
|
|
405
|
+
throw new KensoError({
|
|
406
|
+
code: "insecure_url",
|
|
407
|
+
message: `${parsed2.protocol === "http:" ? parsed2.origin : `A ${parsed2.protocol} URL`} is refused: the API key goes only over https (plain http only to localhost or 127.0.0.1).`,
|
|
408
|
+
exitCode: ExitCode.Usage,
|
|
409
|
+
field: variable,
|
|
410
|
+
hint: `Set ${variable} to an https URL, or unset it (it may also come from the profile's saved apiUrl).`
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
function otherOriginWarning(origin, expected, variable) {
|
|
414
|
+
return `Using ${origin}, not ${expected} (${variable === "KENSO_API_URL" ? "KENSO_API_URL or the profile's apiUrl" : variable}): the API key goes there.`;
|
|
415
|
+
}
|
|
416
|
+
function keyOriginError(keyOrigin, origin, variable) {
|
|
417
|
+
return new KensoError({
|
|
418
|
+
code: "key_origin_mismatch",
|
|
419
|
+
message: `The saved API key was issued for ${keyOrigin}, so it is not sent to ${origin}.`,
|
|
420
|
+
exitCode: ExitCode.Auth,
|
|
421
|
+
field: variable,
|
|
422
|
+
hint: variable === "KENSO_API_URL" ? `Set KENSO_API_URL to ${keyOrigin} (or unset it if that is the default), or log in on ${origin} with kenso auth login (--profile <name> keeps the saved key; --save-api-url saves the URL too).` : `Unset KENSO_MCP_URL to use the Kenso MCP, or pass a key for ${origin} in KENSO_API_KEY.`,
|
|
423
|
+
next: "kenso auth login"
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function checkApiSend(url, keyOrigin, warned, warn) {
|
|
427
|
+
const { origin } = new URL(url);
|
|
428
|
+
if (keyOrigin !== void 0 && origin !== keyOrigin) throw keyOriginError(keyOrigin, origin, "KENSO_API_URL");
|
|
429
|
+
if (origin !== DEFAULT_API_ORIGIN && !warned.origin) {
|
|
430
|
+
warned.origin = true;
|
|
431
|
+
warn?.(otherOriginWarning(origin, DEFAULT_API_ORIGIN, "KENSO_API_URL"));
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function isDotSegment(segment) {
|
|
435
|
+
const dots = segment.replace(/%2e/gi, ".");
|
|
436
|
+
return dots === "." || dots === "..";
|
|
437
|
+
}
|
|
438
|
+
function checkPath(path) {
|
|
439
|
+
const route = (path.split(/[?#]/, 1)[0] ?? "").replace(/[\t\n\r]/g, "");
|
|
440
|
+
if (route.split(/[\\/]/).some(isDotSegment)) {
|
|
441
|
+
throw new KensoError({
|
|
442
|
+
code: "path_not_kept",
|
|
443
|
+
message: `The request path ${route} has a . or .. segment, which would send the request to another route.`,
|
|
444
|
+
exitCode: ExitCode.Usage,
|
|
445
|
+
field: "path",
|
|
446
|
+
hint: "No Kenso id or key is . or ..: check the value that filled the path."
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
var DEFAULT_API_ORIGIN, DEFAULT_MCP_ORIGIN, LOOPBACK_HOSTS;
|
|
451
|
+
var init_endpoint = __esm({
|
|
452
|
+
"src/core/endpoint.ts"() {
|
|
453
|
+
"use strict";
|
|
454
|
+
init_errors();
|
|
455
|
+
init_exit_codes();
|
|
456
|
+
DEFAULT_API_ORIGIN = "https://api.ken.so";
|
|
457
|
+
DEFAULT_MCP_ORIGIN = "https://mcp.ken.so";
|
|
458
|
+
LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
|
|
389
462
|
// src/core/config.ts
|
|
390
463
|
import { chmodSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, renameSync as renameSync2, rmSync, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
391
464
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -489,6 +562,9 @@ function clearCache(env = process.env) {
|
|
|
489
562
|
const dir3 = join2(configDir(env), "cache");
|
|
490
563
|
if (existsSync2(dir3)) rmSync(dir3, { recursive: true, force: true });
|
|
491
564
|
}
|
|
565
|
+
function profileKeyOrigin(profile) {
|
|
566
|
+
return profile.keyOrigin ?? originOf(profile.apiUrl ?? DEFAULT_API_URL) ?? DEFAULT_API_ORIGIN;
|
|
567
|
+
}
|
|
492
568
|
function nonEmpty(value) {
|
|
493
569
|
const trimmed = value?.trim();
|
|
494
570
|
return trimmed ? trimmed : void 0;
|
|
@@ -509,11 +585,13 @@ function resolveAuth(flags, env = process.env, cwd = process.cwd()) {
|
|
|
509
585
|
const workspaceId = flagWorkspace ?? envWorkspace ?? folderWorkspace ?? profile.workspaceId;
|
|
510
586
|
const workspaceSource = flagWorkspace ? "flag" : envWorkspace ? "env" : folderWorkspace ? "folder" : profile.workspaceId ? "profile" : "none";
|
|
511
587
|
const apiUrl = (nonEmpty(env.KENSO_API_URL) ?? profile.apiUrl ?? DEFAULT_API_URL).replace(/\/+$/, "");
|
|
588
|
+
const keyOrigin = source === "profile" ? profileKeyOrigin(profile) : void 0;
|
|
512
589
|
return {
|
|
513
590
|
apiKey,
|
|
514
591
|
workspaceId,
|
|
515
592
|
workspaceSource,
|
|
516
593
|
apiUrl,
|
|
594
|
+
...keyOrigin !== void 0 ? { keyOrigin } : {},
|
|
517
595
|
profileName,
|
|
518
596
|
source,
|
|
519
597
|
...folder ? { folderFile: folder.path } : {},
|
|
@@ -521,6 +599,11 @@ function resolveAuth(flags, env = process.env, cwd = process.cwd()) {
|
|
|
521
599
|
...skipped ? { folderFileSkipped: skipped } : {}
|
|
522
600
|
};
|
|
523
601
|
}
|
|
602
|
+
function apiUrlToSave(auth, env, saveEnvUrl, profileName) {
|
|
603
|
+
if (auth.apiUrl === DEFAULT_API_URL) return void 0;
|
|
604
|
+
if (nonEmpty(env.KENSO_API_URL) === void 0 || saveEnvUrl) return auth.apiUrl;
|
|
605
|
+
return readConfig(env).profiles[profileName]?.apiUrl?.replace(/\/+$/, "") === auth.apiUrl ? auth.apiUrl : void 0;
|
|
606
|
+
}
|
|
524
607
|
function folderProfileNotice(auth) {
|
|
525
608
|
return auth.profileFromFolder ? `${auth.folderFile} chooses profile ${auth.profileName} here; pass --profile for another.` : void 0;
|
|
526
609
|
}
|
|
@@ -537,10 +620,11 @@ var init_config = __esm({
|
|
|
537
620
|
init_errors();
|
|
538
621
|
init_exit_codes();
|
|
539
622
|
init_folder();
|
|
623
|
+
init_endpoint();
|
|
540
624
|
DEFAULT_API_URL = "https://api.ken.so";
|
|
541
625
|
DEFAULT_PROFILE = "default";
|
|
542
626
|
CONFIG_FILE = "config.json";
|
|
543
|
-
PROFILE_KEYS = ["apiKey", "workspaceId", "apiUrl", "email", "keyId"];
|
|
627
|
+
PROFILE_KEYS = ["apiKey", "workspaceId", "apiUrl", "keyOrigin", "email", "keyId"];
|
|
544
628
|
}
|
|
545
629
|
});
|
|
546
630
|
|
|
@@ -630,6 +714,7 @@ var KEN_VERSION, REQUEST_TIMEOUT_MS, TRANSIENT_STATUSES, MAX_TRANSIENT_RETRIES,
|
|
|
630
714
|
var init_http = __esm({
|
|
631
715
|
"src/core/http.ts"() {
|
|
632
716
|
"use strict";
|
|
717
|
+
init_endpoint();
|
|
633
718
|
init_errors();
|
|
634
719
|
init_exit_codes();
|
|
635
720
|
init_redact();
|
|
@@ -647,16 +732,23 @@ var init_http = __esm({
|
|
|
647
732
|
sleep;
|
|
648
733
|
rateLimitBudgetMs;
|
|
649
734
|
rateLimitWaitedMs = 0;
|
|
650
|
-
|
|
735
|
+
/** Shared with the withApiKey copy, so the other-origin warning prints once per command. */
|
|
736
|
+
warned;
|
|
737
|
+
constructor(opts, warned = { origin: false }) {
|
|
651
738
|
this.opts = { ...opts, apiUrl: opts.apiUrl.replace(/\/+$/, "") };
|
|
739
|
+
this.warned = warned;
|
|
652
740
|
this.workspaceId = opts.workspaceId;
|
|
653
741
|
this.fetchImpl = opts.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
654
742
|
this.sleep = opts.sleep;
|
|
655
743
|
this.rateLimitBudgetMs = opts.maxRateLimitWaitMs ?? DEFAULT_RATE_LIMIT_BUDGET_MS;
|
|
656
744
|
}
|
|
657
|
-
/** The same client with another credential: kenso work run --token-stdin sets the run token this way. */
|
|
745
|
+
/** The same client with another credential (not a saved key): kenso work run --token-stdin sets the run token this way. */
|
|
658
746
|
withApiKey(apiKey) {
|
|
659
|
-
return new _KensoClient({ ...this.opts, apiKey });
|
|
747
|
+
return new _KensoClient({ ...this.opts, apiKey, keyOrigin: void 0 }, this.warned);
|
|
748
|
+
}
|
|
749
|
+
/** What --dry-run prints: the URL, after the checks a send makes. */
|
|
750
|
+
urlFor(req) {
|
|
751
|
+
return this.sendUrl(req);
|
|
660
752
|
}
|
|
661
753
|
/** Sends one API call. Throws KensoError on a non-2xx answer after retries. */
|
|
662
754
|
async request(req) {
|
|
@@ -664,7 +756,7 @@ var init_http = __esm({
|
|
|
664
756
|
if (req.method === "GET" && (req.body !== void 0 || req.form !== void 0)) {
|
|
665
757
|
throw usageError("A GET request cannot carry a body.", { field: "data", hint: "Send the values in the query string, or use another method." });
|
|
666
758
|
}
|
|
667
|
-
const url = this.
|
|
759
|
+
const url = this.sendUrl(req);
|
|
668
760
|
const headers = this.buildHeaders(req);
|
|
669
761
|
const body2 = req.form ?? (req.body !== void 0 ? JSON.stringify(req.body) : void 0);
|
|
670
762
|
const mayRetryTransient = req.method !== "POST" || req.retrySafe === true;
|
|
@@ -776,7 +868,7 @@ var init_http = __esm({
|
|
|
776
868
|
*/
|
|
777
869
|
async openStream(req, signal) {
|
|
778
870
|
if (!req.anonymous && !this.opts.apiKey) throw noApiKeyError();
|
|
779
|
-
const url = this.
|
|
871
|
+
const url = this.sendUrl(req);
|
|
780
872
|
const headers = this.buildHeaders({ ...req, headers: { Accept: "text/event-stream", ...req.headers } });
|
|
781
873
|
const connect = new AbortController();
|
|
782
874
|
const timer = setTimeout(() => connect.abort(new DOMException("No answer in time.", "TimeoutError")), REQUEST_TIMEOUT_MS);
|
|
@@ -831,7 +923,16 @@ var init_http = __esm({
|
|
|
831
923
|
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
832
924
|
}
|
|
833
925
|
}
|
|
926
|
+
/** The URL to send `req` to, after checkApiSend. */
|
|
927
|
+
sendUrl(req) {
|
|
928
|
+
const url = this.buildUrl(req.path, req.query);
|
|
929
|
+
checkApiSend(url, req.keyOrigin ?? (req.anonymous ? void 0 : this.opts.keyOrigin), this.warned, this.opts.onWarning);
|
|
930
|
+
return url;
|
|
931
|
+
}
|
|
932
|
+
/** Refuses an insecure API URL (DEV-13403) and a path the URL would resolve to another route (DEV-13401). */
|
|
834
933
|
buildUrl(path, query) {
|
|
934
|
+
checkEndpoint(this.opts.apiUrl, "KENSO_API_URL");
|
|
935
|
+
checkPath(path);
|
|
835
936
|
const url = new URL(this.opts.apiUrl + (path.startsWith("/") ? path : `/${path}`));
|
|
836
937
|
for (const [key, value] of Object.entries(query ?? {})) {
|
|
837
938
|
if (value === void 0) continue;
|
|
@@ -3429,7 +3530,7 @@ var VERSION;
|
|
|
3429
3530
|
var init_version = __esm({
|
|
3430
3531
|
"src/core/version.ts"() {
|
|
3431
3532
|
"use strict";
|
|
3432
|
-
VERSION = true ? "0.1.
|
|
3533
|
+
VERSION = true ? "0.1.177" : "0.0.0-dev";
|
|
3433
3534
|
}
|
|
3434
3535
|
});
|
|
3435
3536
|
|
|
@@ -3451,6 +3552,8 @@ function createContext(flags, env = process.env, overrides2) {
|
|
|
3451
3552
|
const client = new KensoClient({
|
|
3452
3553
|
apiKey: auth.apiKey,
|
|
3453
3554
|
apiUrl: auth.apiUrl,
|
|
3555
|
+
keyOrigin: auth.keyOrigin,
|
|
3556
|
+
onWarning: (message) => output.warn(message),
|
|
3454
3557
|
workspaceId: auth.workspaceId,
|
|
3455
3558
|
agent,
|
|
3456
3559
|
version: VERSION,
|
|
@@ -7702,8 +7805,13 @@ function buildRequest(op, values) {
|
|
|
7702
7805
|
}
|
|
7703
7806
|
const path = op.path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
7704
7807
|
const value = values[name];
|
|
7705
|
-
|
|
7706
|
-
|
|
7808
|
+
const flag = op.routeParams.find((p) => p.name === name)?.flag ?? name;
|
|
7809
|
+
if (isBlank(value)) throw missing(op, flag);
|
|
7810
|
+
const text4 = String(value);
|
|
7811
|
+
if (text4 === "." || text4 === "..") {
|
|
7812
|
+
throw usageError(`--${flag} cannot be "${text4}": in the path it would send ${commandOf(op)} to another route.`, { field: flag });
|
|
7813
|
+
}
|
|
7814
|
+
return encodeURIComponent(text4);
|
|
7707
7815
|
});
|
|
7708
7816
|
const query = {};
|
|
7709
7817
|
for (const name of queryNames) {
|
|
@@ -7867,9 +7975,9 @@ function sameCommand(ctx, op, flags) {
|
|
|
7867
7975
|
for (const [name, value] of globals) if (value !== void 0) parts2.push(flagWithValue(name, value));
|
|
7868
7976
|
return parts2.join(" ");
|
|
7869
7977
|
}
|
|
7870
|
-
function describeRequest(req, op) {
|
|
7978
|
+
function describeRequest(ctx, req, op) {
|
|
7871
7979
|
const secrets = new Set(secretParams(op).map((s) => s.name));
|
|
7872
|
-
const out = { method: req.method, path: req.path };
|
|
7980
|
+
const out = { method: req.method, path: req.path, url: ctx.client.urlFor(req) };
|
|
7873
7981
|
if (req.query) out.query = req.query;
|
|
7874
7982
|
if (req.body !== void 0) out.body = maskSecrets(req.body, secrets);
|
|
7875
7983
|
if (req.form) out.form = describeForm(req.form, secrets);
|
|
@@ -8002,7 +8110,7 @@ async function runOperation(ctx, op, flags) {
|
|
|
8002
8110
|
const req = lean ? buildRequest(op, { ...values, ...lean }) : plain2;
|
|
8003
8111
|
if (ctx.flags.dryRun) {
|
|
8004
8112
|
const cost = op.effect === "spend" ? await spendCost(ctx, op, [req]) : {};
|
|
8005
|
-
ctx.output.object({ dryRun: true, operationId: op.id, request: describeRequest(req, op), ...cost });
|
|
8113
|
+
ctx.output.object({ dryRun: true, operationId: op.id, request: describeRequest(ctx, req, op), ...cost });
|
|
8006
8114
|
return ExitCode.Ok;
|
|
8007
8115
|
}
|
|
8008
8116
|
if (isDestructive(op)) await confirmDestructive(ctx, `${commandOf(op)} sends ${req.method} ${req.path}`, `${sameCommand(ctx, op, flags)} --yes`);
|
|
@@ -9772,6 +9880,7 @@ var init_client = __esm({
|
|
|
9772
9880
|
"use strict";
|
|
9773
9881
|
init_errors();
|
|
9774
9882
|
init_exit_codes();
|
|
9883
|
+
init_endpoint();
|
|
9775
9884
|
init_redact();
|
|
9776
9885
|
DEFAULT_MCP_URL = "https://mcp.ken.so/mcp";
|
|
9777
9886
|
MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
@@ -9784,6 +9893,7 @@ var init_client = __esm({
|
|
|
9784
9893
|
nextId = 1;
|
|
9785
9894
|
initialized = false;
|
|
9786
9895
|
constructor(opts) {
|
|
9896
|
+
checkEndpoint(opts.url, "KENSO_MCP_URL");
|
|
9787
9897
|
this.opts = opts;
|
|
9788
9898
|
this.fetchImpl = opts.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
9789
9899
|
}
|
|
@@ -9936,7 +10046,7 @@ var init_agents = __esm({
|
|
|
9936
10046
|
var auth_default;
|
|
9937
10047
|
var init_auth = __esm({
|
|
9938
10048
|
"docs/auth.md"() {
|
|
9939
|
-
auth_default = '# Authentication\n\nThe CLI calls the Kenso API with a Kenso API key (`kenso_live_` plus 49 characters, or an older key: `ken_` plus 43 characters). It sends the key as `Authorization: Bearer <key>` and never prints it, logs it or puts it in an error.\n\n`kenso login`, `kenso logout` and `kenso whoami` are the same commands as `kenso auth login`, `kenso auth logout` and `kenso auth status`.\n\n## Log in with an API key\n\n1. In app.ken.so, go to Settings > API keys and create a key.\n2. Pipe it to `kenso auth login --with-key`. The key is read from stdin, never from a flag, so it stays out of your shell history and process list.\n\n```bash\necho $KEY | kenso auth login --with-key\nkenso auth login --with-key --profile client-a --workspace 1234 < key.txt\n```\n\nThe CLI checks the key with `GET /v1/me`, then saves it to `~/.kenso/config.json` (file mode 0600, folder mode 0700). It prints:\n\n```json\n{"profile":"default","email":"you@acme.io","workspaceId":"1234","workspaceCount":1}\n```\n\nA developer sandbox does not count here unless every workspace is one: a key whose user has one workspace and a sandbox saves that workspace. When the key reaches several workspaces and you did not pass `--workspace`, no workspace is saved and the output carries `"next":"kenso workspace list --search <name>"`. A key in the wrong format exits 2 (`invalid_key_format`). A key Kenso rejects exits 3.\n\n## Browser login\n\n```bash\nkenso auth login\nkenso auth login --no-browser --device-name "build box"\n```\n\nBrowser login is available to every workspace. The CLI prints a link and a code on stderr. You open the link, sign in to app.ken.so, check that the code matches the one in your terminal, pick the workspace to start in and approve. The CLI then saves a new API key to the profile and prints:\n\n```json\n{"profile":"default","email":"you@acme.io","workspaceId":"1234","keyExpiresAt":"2027-02-02T06:26:59Z"}\n```\n\nThe key is the same kind you create in the app. It is named `Kenso CLI - <device name>` (`--device-name`, else `kenso-cli on <hostname>`), lasts 90 days, and shows in your API key list at Settings > API keys, where you can revoke it. The CLI opens the browser itself only when no coding agent is detected and the machine has a display. An agent prints the link and asks you to open it. The login expires after 10 minutes (`login_expired`, exit 3), and a denied login exits 3 with `access_denied`. If the API answers that browser login is off (`browser_login_unavailable`, exit 3, `"next":"kenso auth login --with-key"`), log in with an API key as above.\n\n## Hand a login to a person (agents)\n\nAn agent that should not sit in a 10-minute wait starts the login, hands the link and code to its person, and collects the key once the person has approved:\n\n```bash\nkenso login --no-wait\nkenso auth wait\nkenso auth wait --timeout 2m\n```\n\n`kenso login --no-wait` (or `kenso auth login --no-wait`) starts a browser login, opens no browser and returns at once:\n\n```json\n{"verificationUrl":"https://app.ken.so/cli/login?code=WXYZ-2345","userCode":"WXYZ-2345","expiresAt":"2026-11-21T10:10:00.000Z","next":"kenso auth wait"}\n```\n\nIt saves the login in `~/.kenso/pending-login.json` (file mode 0600). The file holds the login\'s poll id, which can pick up the key, so the CLI never prints it and removes the file when the login ends. Running `kenso login --no-wait` again while that login is pending for the same profile and API URL, with more than a minute left, prints the same link and code and starts nothing new; `kenso login` without the flag reuses it too and waits for it. A waiting `kenso login` that is stopped leaves the file behind, so `kenso auth wait` can still collect the login.\n\n`kenso auth wait` polls only the API the login was started on, saves the key to the profile the login was started for, and prints what `kenso auth login` prints. By default it waits until the code expires; `--timeout` stops it sooner, after at least one poll, so `--timeout 0` checks once. `--workspace <id>` saves that workspace instead of the one the person approved. The pending login keeps no workspace, so `kenso login --no-wait --workspace <id>` is refused (exit 2): give the workspace to `kenso auth wait`. If the pending login is for another profile whose API differs, `kenso auth wait` answers `no_pending_login` with `next` set to `kenso auth wait --profile <name>`.\n\n| Outcome | Exit | Code | `next` | Pending file |\n|---|---|---|---|---|\n| Approved | 0 | - | - | removed |\n| No pending login, or one started on another API URL | 2 | `no_pending_login` | `kenso login --no-wait` | kept |\n| Denied in the browser | 3 | `login_denied` | `kenso login --no-wait` | removed |\n| The code expired | 3 | `login_expired` | `kenso login --no-wait` | removed |\n| `--timeout` passed first | 3 | `login_pending` | `kenso auth wait` | kept |\n\n## The workspace line\n\nUnder a coding agent, a command that is not a read prints one line on stderr before it runs, its `--dry-run` included: the workspace it acts in and where that came from.\n\n```text\nworkspace: 1234 (--workspace)\nworkspace: 1234 (KENSO_WORKSPACE_ID)\nworkspace: 1234 (kenso.json)\nworkspace: 1234 (profile client-a)\nworkspace: none set (the API picks the key\'s only workspace or answers workspace_required)\n```\n\nRead commands, the login and logout commands, and commands that bring their own credential print no line. The line costs no request.\n\n## CI, scripts and agents: use the environment\n\nYou do not need to log in on a machine that has the key in its environment:\n\n```bash\nexport KENSO_API_KEY=kenso_live_...\nexport KENSO_WORKSPACE_ID=1234\nkenso auth status\n```\n\n`KENSO_API_KEY` wins over any saved profile. Store it as a secret in your CI or agent platform, never in a file in the repo.\n\n## Workspaces\n\nA key reaches every workspace its user belongs to. Each command runs in one workspace, picked in this order:\n\n1. `--workspace <id>` on the command\n2. `KENSO_WORKSPACE_ID`\n3. `workspaceId` in a `kenso.json` in this folder or a folder above it, up to the repository root or your home folder (see [kenso.json](workflows.md#kensojson))\n4. the workspace saved in the profile (`kenso workspace use`)\n\n```bash\nkenso workspace list --search acme\nkenso workspace use 1234\nkenso campaigns list --workspace 5678\n```\n\n`workspace list` prints one page and says on stderr when there are more: add `--all` for every page. A command that needs a workspace when none is picked fails with `workspace_required` (exit 2) and `"next":"kenso workspace list --search <name>"`.\n\n## Workspace-owned keys\n\nA workspace admin can create a key the workspace owns: it keeps working when the admin leaves and acts with exactly the permissions of its template (`admin`, `editor` or `viewer`). Workspace keys are on for every workspace. The command is in beta: `kenso --help` and `kenso workspace --help` list it, marked beta, once the CLI has read the workspace\'s features from `GET /v1/me`. When it cannot read them (no key, or the lookup fails or takes more than 1.5 seconds), help hides the command and names it on its "Beta, hidden" line instead; `--all-commands` shows it. It runs when typed either way.\n\n```bash\nkenso workspace keys create --name "Zapier sync" --template editor --expires-in-days 90\n```\n\nNo API key may create a workspace key, the one the CLI logs in with included. The command prints the API\'s refusal (`forbidden`) with `"next":"A workspace admin can create it in the app: Settings > API keys > Workspace keys"` and exits 3, without retrying. A member who is not a workspace admin gets a 403 too (`permission_denied`), with the same next step. An admin creates the key there; the secret is shown once.\n\n## Profiles\n\nA profile holds a key, a workspace, an optional API URL and the email. Use one per client or per key:\n\n```bash\nkenso auth login --with-key --profile client-a < client-a-key.txt\nkenso campaigns list --profile client-a\nKENSO_PROFILE=client-a kenso auth status\n```\n\nThe profile is `--profile`, else `KENSO_PROFILE`, else the active one (the last one you logged in to).\n\n## Check the setup\n\n```bash\nkenso auth status\nkenso doctor\n```\n\n`auth status` prints who the key belongs to and when it expires, and warns on stderr when that is within 14 days:\n\n```json\n{"email":"you@acme.io","workspaceCount":3,"activeWorkspace":{"id":"1234","name":"Acme"},"keyExpiresAt":"2027-01-31T00:00:00Z","keySource":"profile","profile":"default"}\n```\n\n`doctor` prints the version, Node, the config folder, the profile, the key source, the API URL, the workspace and the detected agent, then seven checks: `node_version`, `config_permissions`, `api_reachable`, `key_valid`, `skill_installed`, `skill_current` and `mcp_registered`. A failed check carries the `next` command that fixes it, and the top-level `next` is the first of those; when every check passes, `starters` lists four requests to start with. It exits 0 when the first four checks pass, 3 when the key is missing or rejected, else 1.\n\n## Log out\n\n```bash\nkenso auth logout\nkenso auth logout --profile client-a\nkenso auth logout --keep-key\n```\n\nThis removes the profile and its key from this machine. When browser login made the key, logout revokes it first, so it stops working everywhere; `--keep-key` leaves it valid. If the revoke fails (no network, or the key was already revoked), logout warns and still removes the profile. A key you saved with `--with-key` was made by you in the app, so logout leaves it valid: revoke it at Settings > API keys. The output adds `revoked: true` or `false`.\n\n## Where things live\n\n| What | Default | Override |\n|---|---|---|\n| Config file with profiles and keys | `~/.kenso/config.json` | `KENSO_CONFIG_DIR` |\n| Pending browser login (`kenso login --no-wait`) | `~/.kenso/pending-login.json` | follows `KENSO_CONFIG_DIR` |\n| Run folders | `~/.kenso/runs/` | `KENSO_RUNS_DIR` |\n| Cached workspace features (1 hour) | `~/.kenso/cache/` | follows `KENSO_CONFIG_DIR` |\n| Last update check (once every 7 days) | `~/.kenso/update-check.json` | follows `KENSO_CONFIG_DIR`; `KENSO_NO_UPDATE_NOTIFIER=1` turns the check off |\n| API | `https://api.ken.so` | `KENSO_API_URL` |\n| MCP (for `kenso mcp`) | `https://mcp.ken.so/mcp` | `KENSO_MCP_URL` |\n\n`--verbose` prints each request line to stderr with the key redacted.\n';
|
|
10049
|
+
auth_default = '# Authentication\n\nThe CLI calls the Kenso API with a Kenso API key (`kenso_live_` plus 49 characters, or an older key: `ken_` plus 43 characters). It sends the key as `Authorization: Bearer <key>` and never prints it, logs it or puts it in an error.\n\n`kenso login`, `kenso logout` and `kenso whoami` are the same commands as `kenso auth login`, `kenso auth logout` and `kenso auth status`.\n\n## Log in with an API key\n\n1. In app.ken.so, go to Settings > API keys and create a key.\n2. Pipe it to `kenso auth login --with-key`. The key is read from stdin, never from a flag, so it stays out of your shell history and process list.\n\n```bash\necho $KEY | kenso auth login --with-key\nkenso auth login --with-key --profile client-a --workspace 1234 < key.txt\n```\n\nThe CLI checks the key with `GET /v1/me`, then saves it to `~/.kenso/config.json` (file mode 0600, folder mode 0700). It prints:\n\n```json\n{"profile":"default","email":"you@acme.io","workspaceId":"1234","workspaceCount":1}\n```\n\nA developer sandbox does not count here unless every workspace is one: a key whose user has one workspace and a sandbox saves that workspace. When the key reaches several workspaces and you did not pass `--workspace`, no workspace is saved and the output carries `"next":"kenso workspace list --search <name>"`. A key in the wrong format exits 2 (`invalid_key_format`). A key Kenso rejects exits 3.\n\n## Browser login\n\n```bash\nkenso auth login\nkenso auth login --no-browser --device-name "build box"\n```\n\nBrowser login is available to every workspace. The CLI prints a link and a code on stderr. You open the link, sign in to app.ken.so, check that the code matches the one in your terminal, pick the workspace to start in and approve. The CLI then saves a new API key to the profile and prints:\n\n```json\n{"profile":"default","email":"you@acme.io","workspaceId":"1234","keyExpiresAt":"2027-02-02T06:26:59Z"}\n```\n\nThe key is the same kind you create in the app. It is named `Kenso CLI - <device name>` (`--device-name`, else `kenso-cli on <hostname>`), lasts 90 days, and shows in your API key list at Settings > API keys, where you can revoke it. The CLI opens the browser itself only when no coding agent is detected and the machine has a display. An agent prints the link and asks you to open it. The login expires after 10 minutes (`login_expired`, exit 3), and a denied login exits 3 with `access_denied`. If the API answers that browser login is off (`browser_login_unavailable`, exit 3, `"next":"kenso auth login --with-key"`), log in with an API key as above.\n\n## Hand a login to a person (agents)\n\nAn agent that should not sit in a 10-minute wait starts the login, hands the link and code to its person, and collects the key once the person has approved:\n\n```bash\nkenso login --no-wait\nkenso auth wait\nkenso auth wait --timeout 2m\n```\n\n`kenso login --no-wait` (or `kenso auth login --no-wait`) starts a browser login, opens no browser and returns at once:\n\n```json\n{"verificationUrl":"https://app.ken.so/cli/login?code=WXYZ-2345","userCode":"WXYZ-2345","expiresAt":"2026-11-21T10:10:00.000Z","next":"kenso auth wait"}\n```\n\nIt saves the login in `~/.kenso/pending-login.json` (file mode 0600). The file holds the login\'s poll id, which can pick up the key, so the CLI never prints it and removes the file when the login ends. Running `kenso login --no-wait` again while that login is pending for the same profile and API URL, with more than a minute left, prints the same link and code and starts nothing new; `kenso login` without the flag reuses it too and waits for it. A waiting `kenso login` that is stopped leaves the file behind, so `kenso auth wait` can still collect the login.\n\n`kenso auth wait` polls only the API the login was started on, saves the key to the profile the login was started for, and prints what `kenso auth login` prints. By default it waits until the code expires; `--timeout` stops it sooner, after at least one poll, so `--timeout 0` checks once. `--workspace <id>` saves that workspace instead of the one the person approved. The pending login keeps no workspace, so `kenso login --no-wait --workspace <id>` is refused (exit 2): give the workspace to `kenso auth wait`. If the pending login is for another profile whose API differs, `kenso auth wait` answers `no_pending_login` with `next` set to `kenso auth wait --profile <name>`.\n\n| Outcome | Exit | Code | `next` | Pending file |\n|---|---|---|---|---|\n| Approved | 0 | - | - | removed |\n| No pending login, or one started on another API URL | 2 | `no_pending_login` | `kenso login --no-wait` | kept |\n| Denied in the browser | 3 | `login_denied` | `kenso login --no-wait` | removed |\n| The code expired | 3 | `login_expired` | `kenso login --no-wait` | removed |\n| `--timeout` passed first | 3 | `login_pending` | `kenso auth wait` | kept |\n\n## The workspace line\n\nUnder a coding agent, a command that is not a read prints one line on stderr before it runs, its `--dry-run` included: the workspace it acts in and where that came from.\n\n```text\nworkspace: 1234 (--workspace)\nworkspace: 1234 (KENSO_WORKSPACE_ID)\nworkspace: 1234 (kenso.json)\nworkspace: 1234 (profile client-a)\nworkspace: none set (the API picks the key\'s only workspace or answers workspace_required)\n```\n\nRead commands, the login and logout commands, and commands that bring their own credential print no line. The line costs no request.\n\n## CI, scripts and agents: use the environment\n\nYou do not need to log in on a machine that has the key in its environment:\n\n```bash\nexport KENSO_API_KEY=kenso_live_...\nexport KENSO_WORKSPACE_ID=1234\nkenso auth status\n```\n\n`KENSO_API_KEY` wins over any saved profile. Store it as a secret in your CI or agent platform, never in a file in the repo.\n\n## Workspaces\n\nA key reaches every workspace its user belongs to. Each command runs in one workspace, picked in this order:\n\n1. `--workspace <id>` on the command\n2. `KENSO_WORKSPACE_ID`\n3. `workspaceId` in a `kenso.json` in this folder or a folder above it, up to the repository root or your home folder (see [kenso.json](workflows.md#kensojson))\n4. the workspace saved in the profile (`kenso workspace use`)\n\n```bash\nkenso workspace list --search acme\nkenso workspace use 1234\nkenso campaigns list --workspace 5678\n```\n\n`workspace list` prints one page and says on stderr when there are more: add `--all` for every page. A command that needs a workspace when none is picked fails with `workspace_required` (exit 2) and `"next":"kenso workspace list --search <name>"`.\n\n## Workspace-owned keys\n\nA workspace admin can create a key the workspace owns: it keeps working when the admin leaves and acts with exactly the permissions of its template (`admin`, `editor` or `viewer`). Workspace keys are on for every workspace. The command is in beta: `kenso --help` and `kenso workspace --help` list it, marked beta, once the CLI has read the workspace\'s features from `GET /v1/me`. When it cannot read them (no key, or the lookup fails or takes more than 1.5 seconds), help hides the command and names it on its "Beta, hidden" line instead; `--all-commands` shows it. It runs when typed either way.\n\n```bash\nkenso workspace keys create --name "Zapier sync" --template editor --expires-in-days 90\n```\n\nNo API key may create a workspace key, the one the CLI logs in with included. The command prints the API\'s refusal (`forbidden`) with `"next":"A workspace admin can create it in the app: Settings > API keys > Workspace keys"` and exits 3, without retrying. A member who is not a workspace admin gets a 403 too (`permission_denied`), with the same next step. An admin creates the key there; the secret is shown once.\n\n## Profiles\n\nA profile holds a key, a workspace, an optional API URL and the email. Use one per client or per key:\n\n```bash\nkenso auth login --with-key --profile client-a < client-a-key.txt\nkenso campaigns list --profile client-a\nKENSO_PROFILE=client-a kenso auth status\n```\n\nThe profile is `--profile`, else `KENSO_PROFILE`, else the active one (the last one you logged in to).\n\n## Check the setup\n\n```bash\nkenso auth status\nkenso doctor\n```\n\n`auth status` prints who the key belongs to and when it expires, and warns on stderr when that is within 14 days:\n\n```json\n{"email":"you@acme.io","workspaceCount":3,"activeWorkspace":{"id":"1234","name":"Acme"},"keyExpiresAt":"2027-01-31T00:00:00Z","keySource":"profile","profile":"default"}\n```\n\n`doctor` prints the version, Node, the config folder, the profile, the key source, the API URL, the workspace and the detected agent, then seven checks: `node_version`, `config_permissions`, `api_reachable`, `key_valid`, `skill_installed`, `skill_current` and `mcp_registered`. A failed check carries the `next` command that fixes it, and the top-level `next` is the first of those; when every check passes, `starters` lists four requests to start with. It exits 0 when the first four checks pass, 3 when the key is missing or rejected, else 1.\n\n## Log out\n\n```bash\nkenso auth logout\nkenso auth logout --profile client-a\nkenso auth logout --keep-key\n```\n\nThis removes the profile and its key from this machine. When browser login made the key, logout revokes it first, so it stops working everywhere; `--keep-key` leaves it valid. If the revoke fails (no network, or the key was already revoked), logout warns and still removes the profile. A key you saved with `--with-key` was made by you in the app, so logout leaves it valid: revoke it at Settings > API keys. The output adds `revoked: true` or `false`.\n\n## Where things live\n\n| What | Default | Override |\n|---|---|---|\n| Config file with profiles and keys | `~/.kenso/config.json` | `KENSO_CONFIG_DIR` |\n| Pending browser login (`kenso login --no-wait`) | `~/.kenso/pending-login.json` | follows `KENSO_CONFIG_DIR` |\n| Run folders | `~/.kenso/runs/` | `KENSO_RUNS_DIR` |\n| Cached workspace features (1 hour) | `~/.kenso/cache/` | follows `KENSO_CONFIG_DIR` |\n| Last update check (once every 7 days) | `~/.kenso/update-check.json` | follows `KENSO_CONFIG_DIR`; `KENSO_NO_UPDATE_NOTIFIER=1` turns the check off |\n| API | `https://api.ken.so` | `KENSO_API_URL` |\n| MCP (for `kenso mcp`) | `https://mcp.ken.so/mcp` | `KENSO_MCP_URL` |\n\nAnother API or MCP gets a warning on stderr before the key goes there, and it must be https (plain http only to `localhost` or `127.0.0.1`, `insecure_url`, exit 2). A saved key goes only to the API it was saved for (`key_origin_mismatch`, exit 3, names it): a key from `kenso auth login` run with `KENSO_API_URL` set works on that API only while the variable is set, unless you log in with `--save-api-url`, which saves the URL in the profile. A key saved for `https://api.ken.so` goes to no MCP but `https://mcp.ken.so`. `kenso auth status` prints the `apiUrl` it used.\n\n`--verbose` prints each request line to stderr with the key redacted.\n';
|
|
9940
10050
|
}
|
|
9941
10051
|
});
|
|
9942
10052
|
|
|
@@ -9960,7 +10070,7 @@ var init_connect = __esm({
|
|
|
9960
10070
|
var crm_default;
|
|
9961
10071
|
var init_crm = __esm({
|
|
9962
10072
|
"docs/crm.md"() {
|
|
9963
|
-
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `import accounts <file.csv>`, `import people <file.csv>`, `import deals <file.csv>` | Import a CSV export of another CRM, up to 50,000 rows: Kenso proposes the mapping, you approve once, it runs in the background and can be undone for 30 days |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids, a filter or a saved view, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids, a filter or a saved view, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> [--stage <key>] [--pipeline <pipelineId>] [--reason <key>]` | Move a deal to a stage or another pipeline, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore --account-id <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `people restore --person-id <id>`, `opportunities restore --opportunity-id <id>` | Bringing back one person or one deal deleted in the last 30 days |\n| `accounts duplicates`, `accounts merge <id> --into <id>`, `accounts merges list` | The pairs that look like one company, merging a pair, and the log of merges |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved view (`--view <id>`), or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, the members whose mailboxes hold it, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `views pin <viewId>`, `views unpin <viewId>` | Pin a saved view to your own sidebar, or take it off. Needs the `shared_views` flag |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `layouts show\\|set\\|reset <object>` | How every account, person or deal page in the workspace lays out its fields: header, rail sections and hidden fields (needs `record_layout`) |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n| `fields list`, `create`, `update`, `archive` | The built-in and custom fields of accounts, people and deals, and adding your own (needs `custom_fields`) |\n| `field-fill-settings`, `suggestions`, `fields fill` | How Ken fills each field from email, calls and meetings, the values it waits on you for, and filling a deal field for existing deals or a custom field for existing accounts (needs `ken_field_fill`) |\n| `views list`, `create`, `run`, `update`, `delete` | Saved views of accounts, people and deals, private or shared with the workspace (needs `shared_views`) |\n| `reports summary`, `reports run <report>`, `reports query`, `dashboards` | Pipeline reports over your deals, your own counts and sums, and dashboards of saved charts (needs `opportunities` and `reports`) |\n| `forecast show`, `quotas list`, `set`, `propose` | Closed won, commit and best case against each member\'s quota for a month or quarter (needs `opportunities` and `forecast`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# my accounts with a meeting this quarter: me is whoever runs it, so a saved view with it lists each member\'s own\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "owner", "operator": "is", "values": ["me"]}, {"field": "lastMeeting", "operator": "in_period", "values": ["this_quarter"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity --account-id 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (1,000 at most), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), every account a saved view lists (`--view <id>`: the API reads the view\'s own filter, so the count is what `kenso views run` lists), or `--all`. A view with no condition takes `--all` beside it. A filter that holds only options and no condition (`--filter \'{"includeImportOnly":true}\'`) takes `--all` beside it. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. `--add-tag 12,14` and `--remove-tag 13` put tags on every account or take them off (`kenso tags list` gives the ids); each tag is one row per account from `false` to `true` or back, so `kenso changes undo` takes off only the tags the change put on. People take them too; deals have no tags. A text field\'s value is sent as you type it (`--set hqLocation=10001` is the text "10001"); a custom field\'s type is not known to the CLI, so quote its text when it reads as a number or as true or false: `--set \'custom.code="10001"\'`. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\nWithout `--yes` the command previews and prints the change\'s id. `--yes` with the same flags lists the records again as a new change; to apply exactly the preview, run `kenso accounts bulk-update --change-id <id> --yes` (or `kenso changes apply --change-id <id>`). `--change-id` takes no other target or `--set` flag.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `pipelineId`, `q`, `missingFields`). A stage belongs to one pipeline, and a bulk stage change keeps every deal in its own: `"pipelineId"` in the filter names one pipeline\'s deals, and a deal of another pipeline is counted under `failed` with the row code `other_pipeline` and is not moved (`kenso opportunities update` moves one deal to another pipeline):\n\n```bash\nkenso opportunities bulk-update --filter \'{"pipelineId":3,"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--view`, `--all`, `--exclude-ids`, and `--change-id` with `--yes` for a listed preview) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. `kenso changes undo` undoes a delete for 30 days: each account, person or deal still deleted is restored, as `kenso accounts restore`, `kenso people restore` or `kenso opportunities restore` restores it. A restore the record refuses (a person whose email a live person holds by now, a deal whose account is deleted) is that row\'s `undo_failed`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` (a delete of people or deals) when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId` (member ids, or `me` for whoever runs it), `closeDate` (`past_due`, `next_30_days`, `later`, `none`, or a period such as `this_week` or `next_quarter`), `sourceCampaignId`, `closedAt` and `createdAt` (periods). `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\nkenso pipelines propose --description "upsells and renewals for customers"\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`propose`** asks Ken to draft a pipeline from one sentence: a `name`, a `routingRule` and `stages`, in the shape `create` takes. It saves nothing. Read it, change what you want, and send it to `create`.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Deals in a pipeline\n\nA deal\'s stage names its pipeline, and the deal\'s `pipelineId` repeats it. To work one pipeline\'s deals, or move a deal between pipelines:\n\n```bash\nkenso opportunities list --pipeline-id 6\nkenso opportunities search --pipeline-id 6 --data \'{"countBy": ["stage"]}\'\nkenso opportunities create --account-id 501 --pipeline-id 6\nkenso opportunities move 77 --pipeline 6\nkenso opportunities move 77 --pipeline 6 --stage negotiating\n```\n\n- **`create --pipeline-id`** opens the deal in that pipeline\'s first live open stage. Without it, and without a `stage`, Ken reads each pipeline\'s `routingRule` and opens the deal in the pipeline whose rule clearly fits the account, else in the default pipeline. A pipeline you name always wins.\n- **`move --pipeline`** alone keeps the deal\'s category (`open`, `won` or `lost`): it lands in that pipeline\'s live stage of the category with the same label as its stage now, else in the category\'s first live stage. The printed deal says where it landed. With `--stage`, the stage must be that pipeline\'s; the error lists the pipeline\'s stage keys otherwise.\n- An archived pipeline takes no deal from another pipeline (`pipeline_archived`). The deals already in it still move between its stages.\n- A move is a stage change: it writes the same history, and a stage a person set is refused with `pinned_by_user` unless you pass `--overwrite-pinned`.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore --account-id 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore --account-id <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. Its Studio pages, committee seats and Knowledge facts do not come back: the delete purged them. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n```bash\nkenso people restore --person-id 16079\nkenso opportunities restore --opportunity-id 2133\n```\n\n`people restore` brings back a person deleted in the last 30 days, with the champion watch the delete ended, on no account as they were when they were deleted. A live person who holds their email, LinkedIn URL or accepted Instagram account by now keeps it: the restore answers `409` `person_exists` with that person\'s id. `opportunities restore` brings back a deal deleted in the last 30 days onto its account; while the account is deleted it answers `409` `account_deleted`, and `accounts restore` brings back the deals deleted with the account. A deal whose stage was removed since answers `409` `stage_removed`. A merged person, or a deal on a merged account, cannot be restored. Both are behind `crm_import_export` too.\n\n## Import a CSV export of another CRM\n\n```bash\nkenso import accounts companies.csv\nkenso import accounts companies.csv --map "Company=name" --map "Notes=" --yes\nkenso import accounts --id 42 --yes\nkenso record-import-rows list --import-id 42 --outcome skipped\nkenso record-imports undo --import-id 42\n```\n\n`kenso import accounts <file.csv>` uploads the file (a header row, at most 50,000 rows) and prints Kenso\'s plan: which field each column fills, which columns it skips, how owner and stage values are read (`valueMaps`) and what it could not settle (`questions`). Headers of Kenso, Twenty, HubSpot, Attio and Salesforce exports are recognized. `matches` says how many rows will fill a record the workspace already holds (`existing`: a match by the run\'s own keys, a restore of an account deleted in the last 30 days, or a row that repeats a record an earlier row creates) and how many will create one (`new`); a row the import would skip is in neither. It is counted when the plan is made and again when a change moves a column that decides matching or `--source`, so the workspace can still change before the start; it is left out when Kenso could not count. Nothing is written to your accounts yet. `--map "Header=field"` changes a column and `--map "Header="` skips it. A column fills a custom field with `--map "Header=custom.<key>"` (`kenso fields list --object account` has the keys; people are `person`, deals `opportunity`), and `--map "Header=new"` adds the custom field Kenso proposes for a column no field matches (`new:text` picks the type), and a column whose header is a custom field\'s label is mapped to it already; owner and stage values change with `kenso record-imports update --import-id <id>`.\n\nWith `--yes` the import starts and the command waits for it (`--timeout`, default 30m; the import keeps running on the server either way), then prints how many rows were created, updated, restored, left unchanged and skipped. Without `--yes` it stops at the plan and prints the command that starts that import (`--id <importId> --yes`), so the file is uploaded once. `--dry-run` sends nothing: with a file it prints the upload it would make, since the plan needs the upload, and with `--id` it reads the planned import and prints what `--map`, `--source` and `--research` would change on it. `--source twenty` names the system the file\'s record ids come from: pass the same one for every file of an export, so the people and deals files find the accounts by their old ids. `kenso record-imports delete --import-id <id>` discards an import that was planned and never started; one left planned for 30 days is discarded by itself.\n\nPer row: a domain no account has creates an account; a domain that is already an account fills only that account\'s empty fields, so nothing you entered is overwritten; an account deleted in the last 30 days is restored; a row with no usable domain is skipped, and `kenso record-import-rows list --import-id <id> --outcome skipped` says why. Research of new accounts is off unless you pass `--research`, which is charged per account. It needs the `accounts` and `crm_import_export` flags. This is a different command from `accounts import`, which creates accounts row by row from the machine running the CLI.\n\n`kenso record-imports undo --import-id <id>` takes a finished import back in the background (`kenso record-imports get --import-id <id>` reads `undoing`, then `undone`): an account the import created is deleted, and can be restored for 30 days, unless someone changed it since, it holds a deal, a person was added to it since, or it was merged; a field the import filled is emptied while it still holds the imported value. `kenso record-import-rows list --import-id <id>` shows each row\'s `undoOutcome`, and on a kept row its `undoReason`: `no_record`, `merged`, `changed_since` (a member, an API key or an agent worked it after the import), `has_deals`, `has_people` (a person was added to the account since), `on_other_accounts` (a person on an account the row did not place them on), `place_worked` (a touch or a member\'s write on a place the row gave the person), `deleted_since`, `fields_changed_since` (every field the row filled holds another value now), `delete_refused` or `undo_failed` (the undo failed on the row three times).\n\n`kenso import people <file.csv>` works the same way for people. Import the accounts file first: a people row\'s company id (Twenty\'s `Company Id`, HubSpot\'s associated company id) places the person on the account that kept that id, and without one the person goes on the account that holds their email\'s or company\'s domain. A people import never creates an account; a person whose company is no account comes in without one and the row says so. A row matches a person by email, then LinkedIn URL, then name on the company, as every other way into People does; a matched person gets only their empty fields filled (a phone only when they have none). A row with none of the three is skipped, and a row with only a name needs a company that is an account with a domain. `kenso record-imports undo --import-id <id>` takes a people import back too: a person it created leaves the accounts the row placed them on and is deleted, unless someone changed them since, they were contacted or have a touch planned, or they are on an open deal; a field it filled is emptied while it still holds the imported value. `kenso people import` stays the JSONL and enrichment path (`--find-emails`); `kenso import people` is the CRM file with a plan, a row report and one approval.\n\n`kenso import deals <file.csv>` works the same way for deals, after the accounts file and the people file. A row opens a deal on the account that kept its company id (Twenty\'s `Company Id`, HubSpot\'s associated company id), else on the account that holds its company domain; a row whose account Kenso does not know is skipped and says so. Its contact is the person a people import kept the row\'s contact id for (Twenty\'s `Point of Contact Id`). The plan maps each stage in the file to one of the workspace\'s deal stages (`valueMaps`, field `stage`): a stage\'s key or label matches by itself, Closed Won and Closed Lost go to the first won and lost stage, and a value with no match opens in the first open stage until you pick one with `kenso record-imports update`. Amounts stay in the workspace currency: an amount in another currency is left out with a warning, never converted. A row whose deal id an earlier import kept is that deal and only gets its empty fields filled. A row no id names a deal for is the one live deal on its account with its name and its contact (a side with no contact matches any) that is open, won or lost as the row is: it fills that deal\'s empty fields and keeps the row\'s id for it, and a row that matches two such deals is skipped and names them. A file with no id column is matched that way only, and the plan says so (`no_source_id`). `kenso record-imports undo --import-id <id>` takes a deals import back: a deal it opened is deleted unless someone changed it since, and a field it filled is emptied while it still holds the imported value. Undo in the reverse order of the imports (deals, then people, then accounts): an account that holds a deal is kept.\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --view 40 --out pipeline.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved view of that object, your own or one shared with the workspace (`kenso views list --object account` shows the ids; people are `person`, deals `opportunity`): the file holds the rows the view lists, in its sort, so its row count is the view\'s count. `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields; given with `--view`, each replaces that key of the view. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## Duplicates and merges\n\n```bash\nkenso accounts duplicates --scan\nkenso accounts merge 812 --into 77 --dry-run\nkenso accounts merge 812 --into 77 --yes\nkenso accounts merges list --merged-by system\nkenso accounts merges 41\nkenso people merge 9 --into 7 --dry-run\nkenso people merge 9 --into 7 --yes\n```\n\nThese need the `crm_import_export` flag beside `accounts`. `accounts duplicates` lists the pairs of accounts that look like one company: both accounts, why they were paired (`reasons`: `domain`, `linkedin`, `name`) and `isCertain`, true when the two share the name and the domain apart from its ending (acme.com and acme.co). `--scan` compares every account first; a scan also runs after each accounts import. `--status dismissed` or `merged` shows the answered pairs. `kenso account-duplicates dismiss --duplicate-id <duplicateId>` answers that a pair is not a duplicate, for good.\n\n`accounts merge <accountId> --into <id>` merges the first account into the second, the one you keep. A merge cannot be undone, so look first: `--dry-run` prints `mergeSummary` (each field that changes with its value before and after, and how many people, deals, touches and domains move) and writes nothing. The merge itself needs `--yes` when no person is at the terminal. It answers the kept account with the same summary and a `mergeId`.\n\n`people merge <personId> --into <id>` merges the first person into the second, the one you keep, and needs only the `accounts` flag. The kept person keeps their own values and takes the other\'s for their blank fields, custom fields included; account places, deals, meetings, tasks, notes and captured email and meetings move to them. It cannot be undone either: `--dry-run` (which needs `crm_import_export`) prints the kept person with `mergeSummary`, the `fieldChanges` the merge would fill and `moved` (`accountCount`, `combinedAccountCount`, `opportunityCount`, `meetingCount`, `taskCount`, `noteCount`, `timelineEventCount`), and writes nothing. The merge itself needs `--yes` when no person is at the terminal. The same as the MCP\'s `people(operation="merge", dry_run=true)`.\n\n`accounts merges list` is the log, newest first, and `accounts merges <mergeId>` opens one merge with `mergedValues`: the merged-away account as it was. `--merged-by system` shows the merges Ken made itself. Where automatic merging is on for the workspace, Ken merges only certain pairs, keeps the customer, then the owned, then the last touched account, and leaves a pair for you when both are customers, the two have different owners, or one is being worked and the other is set aside (`heldReason` on the pair says which). That job is off unless it was turned on for the workspace.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. The created entry of a deal a CSV import brought in has `imported: true`; one imported in a won or lost stage entered it on its file\'s close date, which is its `enteredAt`. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. With the `pipelines` flag on, a move between pipelines also has `pipeline` and `fromPipeline` (`{id, name}`), the pipeline the deal moved into and out of. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes list --account 5 --related # with the notes on its deals and people\nkenso notes list --parent 900 # every comment under note 900, oldest first\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\n`notes list` prints each note with its first 50 comments; when `commentCount` is higher, `notes list --parent <noteId>` reads them all. The body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the notes on the account, its deals and its people (`notes list --account <id> --related` reads the same). The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules --pipeline 6\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier --dry-run\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Without `--pipeline` the list is the default pipeline\'s stages; `--pipeline <id>` lists that pipeline\'s. A stage key is unique across pipelines, so a stage of any pipeline is set by its key, and with `--pipeline` the command first checks the stage is that pipeline\'s. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Record page layouts\n\n```bash\nkenso layouts show account\nkenso layouts set account --header tier,ownerMemberId,score,custom.arr\nkenso layouts show account > layout.json && kenso layouts set account --data @layout.json\nkenso layouts reset account --dry-run\nkenso layouts reset account --yes\n```\n\nWith the `record_layout` flag on, a workspace lays out each record page once, for every member: `account`, `person` or `opportunity` (a deal). `show` prints `GET /v1/record-layouts/{object}`: `isDefault`, `version`, `headerFields` (up to 6, pinned under the record\'s name), `railSections` (`{name, fields}`), `hiddenFields` (under the rail\'s More), `sections` (`{key, label, placement, locked, hidden}`, in page order) and `availableFields`. Field keys are the field catalog\'s (`ownerMemberId`, `closeDate`, `primaryDomain`); a custom field is `custom.<field_key>`, and a new one joins the last rail section.\n\n`set --header` pins up to 6 fields and keeps the rest of the saved layout; the fields it unpins go to the top of the first rail section. `set --data` saves a whole layout, so group the rail into sections or hide a section that way, starting from `show`. A save made after someone else\'s answers a conflict: show it again. `reset` puts the page back to Kenso\'s default for every member, so it needs `--yes` (save the layout with `show` first). `set` and `reset` print the request with `--dry-run` and change nothing. Saving needs the `workspace_settings` permission, and the account page also needs the `accounts` plan. The same as the MCP\'s `account_views` operations `record-layouts-get`, `record-layouts-replace` and `record-layouts-reset`.\n\n## Pin a saved view\n\n```bash\nkenso views pin 118\nkenso views unpin 118\n```\n\nWith the `shared_views` flag on, `views pin` adds a saved view to your own sidebar, nested under its list (an account view under Accounts, a person view under People, a deal view under Deals). It is `kenso pins add --kind view --view-id <viewId>` under the name you would try: it prints the pin, and a view already pinned answers the pin it has. Pins are yours alone: pinning a shared view does not pin it for a teammate. `views unpin` finds your pin of the view and removes it, and prints `{"viewId": ..., "removed": true}`; a view you had not pinned prints `removed: false` and changes nothing. The view itself stays either way. `kenso pins list` shows every pin you have.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time with its offset (`2026-11-20T15:00:00Z`); `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. When one fails, its error names the tasks before it, which are already changed. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n\n## Custom fields\n\n```bash\nkenso fields list --object account\nkenso fields create --object account --type select --label Region --data \'{"options":["EMEA","North America"]}\' --dry-run\nkenso fields create --object account --type select --label Region --data \'{"options":["EMEA","North America"]}\'\nkenso fields update --field-id 412 --label "Sales region"\nkenso fields archive --field-id 412 --yes\n```\n\nWith the `custom_fields` flag on, each workspace adds its own fields to accounts, people and deals (`--object account`, `person` or `opportunity`). `fields list` prints the built-in and custom fields; a custom field is `custom.<key>`, the name `customFields`, `bulk-update --set`, stage rules, layouts and imports use. Run it before you add a field that may already exist.\n\n- **`create`** takes `--object`, `--type` (`text`, `number`, `boolean`, `date`, `json`, `select`, `multi_select`, `currency`, `url` or `user`; fixed once created) and `--label`. `--key` is made from the label when you leave it out ("Contract value" is `contract_value`). `--description` says what the field means; Ken reads it when it fills the field. A select or multi_select takes its choices in `--data` as `options`, each a label or `{label, color, key}`, up to 200.\n- **`update`** changes the label, the description or the options. `options` in `--data` is the whole list: keep an option by its `key`, and one you leave out is archived, never deleted, so the records that hold it keep it.\n- **`archive`** hides a field from the pickers, the columns and the record rail and keeps every value, so it asks for `--yes`. `kenso fields update --field-id 412 --no-is-archived` brings it back. An object holds at most 100 live custom fields.\n\n## Field-fill settings and Ken\'s suggestions\n\n```bash\nkenso field-fill-settings list\nkenso field-fill-settings update --object opportunity --field amount --mode suggest --instruction "Budget the buyer named, in USD"\nkenso suggestions list --account-id 812\nkenso suggestions approve --suggestion-id 31\nkenso suggestions reject --suggestion-id 32 --reason "That was last year\'s budget"\nkenso fields fill --object opportunity --field nextStep --all\nkenso fields fill --object account --field custom.segment --data \'{"ids":[812,813]}\'\n```\n\nWith the `ken_field_fill` flag on, Ken reads email, calls and meetings and fills record fields. `field-fill-settings list` shows each field Ken can fill with its `mode`: `default` (Ken fills an empty field and suggests a change to a filled one), `off`, `suggest` (every value waits for a person) or `auto`. `update` sets a field\'s mode and an `--instruction` of up to 500 characters that tells Ken what to look for. A new mode applies to the next email, call or meeting Ken reads.\n\nA value that waits for a person is a suggestion: the field, its value now (`from`), Ken\'s value (`to`), the quote and its source. `suggestions list` shows the pending ones; narrow it with `--status`, `--object` and `--record-id` (one record), `--account-id` (the account, its people and its deals) or `--meeting-id`. `approve` writes Ken\'s value to the record (`--data \'{"value": ...}\'` writes yours instead) and `reject` leaves the record as it is. Both are a person\'s call: run them on the user\'s word.\n\n`fields fill` fills one deal field for the deals that have none, from their recorded meetings and captured email. As written above it only answers how many deals have no value and what filling them costs, and starts nothing; `--no-body-dry-run` starts it. It needs `bulk_edit` too.\n\n`fields fill --object account` does the same for one custom field of accounts (`custom.<key>`, of type text, number, select or date; it needs `custom_fields` too). Ken reads only what Kenso already holds about each account: its company facts, newest research, Knowledge facts, the team\'s notes, recorded meetings, captured email a teammate may read, and stored website pages. It runs no research and looks nothing up outside Kenso. It costs 1 credit per account Ken reads, the dry run shows the count and the credits first, and Ken writes only an empty field: a value a person set is never overwritten. The field\'s `--description` tells Ken what to look for.\n\n## Saved views\n\n```bash\nkenso views list --object account\nkenso views create --object account --name "Tier 1, no meeting in 30 days" --visibility workspace --data @view.json --dry-run\nkenso views run --view-id 140 --limit 100 --include-total\nkenso views update --view-id 140 --name "Tier 1, quiet for 30 days"\nkenso views delete --view-id 140 --yes\n```\n\nWith the `shared_views` flag on, a saved view is a name, its object\'s search `filter` and `sort`, `columns` and a `layout` (`list` or `board`), private to its maker or shared with the workspace (`--visibility workspace`). `view.json` holds `filter` and `sort` in the shape the object\'s search takes (`filters`, `where`, `q`), so try it with `kenso accounts search --data` first. `views list` shows the workspace\'s shared views and your private ones. `run` lists a view\'s records exactly as its object\'s search returns them, page by page. `update` changes what you send, and `filter` replaces the whole filter. Any member changes or deletes a shared view, but only its maker makes it private. `delete` asks for `--yes` and takes the view off every member\'s sidebar. `kenso views pin` (above) pins one.\n\n## Reports and dashboards\n\n```bash\nkenso reports summary\nkenso reports list\nkenso reports run won_by_month --period this_year --owner 41\nkenso reports query --data \'{"measures":[{"op":"sum","field":"amount"}],"dimensions":[{"field":"stage"}]}\'\nkenso dashboards create --name "Q4 pipeline" --visibility workspace\nkenso dashboards add-chart --dashboard-id 3 --title "Won by month" --data \'{"report":{"key":"won_by_month","period":"this_year"}}\'\n```\n\nWith the `opportunities` and `reports` flags on, reports count and sum your deals. `reports summary` prints where the period stands (closed won, open pipeline, weighted pipeline, win rate) and what needs you, then one row per stock report. `reports run <report>` prints one stock report as a table: `pipeline_by_stage`, `won_by_month`, `stage_conversion`, `time_in_stage`, `won_by_source_campaign` or `activity_by_member`. Each takes `--period` (`this_quarter` by default, a month such as `2026-03`, a quarter, a year or a day range), `--owner` and `--pipeline`, and `--full` prints the whole answer with each bucket\'s filter for `opportunities search`.\n\n`reports query` asks your own question: `measures` (1 to 4 of `count`, `sum`, `avg` or `weighted_sum` of `amount`), `dimensions` (up to 2 of `stage`, `stageCategory`, `ownerMemberId`, `sourceCampaignId`, `closedAt`, `createdAt` or `closeDate`, the dates by `month`, `quarter` or `year`) and a `filter` as `opportunities search` takes it. It only reads.\n\nA dashboard keeps charts, up to 12, private to its owner or shared with the workspace. A chart is a stock report (`report`: its `key`, `period`, `ownerMemberId`, `pipelineId`) or a `query`, drawn as `bars` or a `trend`. `dashboards get --dashboard-id 3` reads one, and `update`, `remove-chart` and `delete` change it (the last two ask for `--yes`).\n\n## Forecast and quotas\n\n```bash\nkenso forecast show --period 2026-Q4\nkenso forecast show --period 2026-11 --include-deals\nkenso quotas list --period 2026-Q4\nkenso quotas propose --period 2027-Q1 --uplift-percent 15\nkenso quotas propose --period 2027-Q1 --uplift-percent 15 --apply\nkenso quotas set --period 2027-Q1 --member-id 41 --amount 120000\n```\n\nWith the `opportunities` and `forecast` flags on, `forecast show` reads closed won, commit and best case for a quarter (`2026-Q4`) or a month (`2026-11`), per member and for the team, each against its quota. Without `--period` it reads the current quarter. `--include-deals` adds the deals it counted. `noCloseDate` counts the open deals no period holds because they have no close date; with two pipelines or more, its `pipelines` splits that count by pipeline. `quotas propose` works out each member\'s quota from what they closed won in the quarter before the period (or the last quarter that has ended) plus `--uplift-percent` (0 to 200, default 15), and writes nothing; with `--apply` it saves those amounts. `quotas set` sets one member\'s quota in the workspace currency, and `--data \'{"memberId":41,"amount":null}\'` removes it.\n';
|
|
10073
|
+
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `import accounts <file.csv>`, `import people <file.csv>`, `import deals <file.csv>` | Import a CSV export of another CRM, up to 50,000 rows: Kenso proposes the mapping, you approve once, it runs in the background and can be undone for 30 days |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids, a filter or a saved view, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids, a filter or a saved view, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> [--stage <key>] [--pipeline <pipelineId>] [--reason <key>]` | Move a deal to a stage or another pipeline, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore --account-id <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `people restore --person-id <id>`, `opportunities restore --opportunity-id <id>` | Bringing back one person or one deal deleted in the last 30 days |\n| `accounts duplicates`, `accounts merge <id> --into <id>`, `accounts merges list` | The pairs that look like one company, merging a pair, and the log of merges |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved view (`--view <id>`), or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, the members whose mailboxes hold it, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `layouts show\\|set\\|reset <object>` | How every account, person or deal page in the workspace lays out its fields: header, rail sections and hidden fields (needs `record_layout`) |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n| `fields list`, `create`, `update`, `archive` | The built-in and custom fields of accounts, people and deals, and adding your own (needs `custom_fields`) |\n| `field-fill-settings`, `suggestions`, `fields fill` | How Ken fills each field from email, calls and meetings, the values it waits on you for, and filling a deal field for existing deals or a custom field for existing accounts (needs `ken_field_fill`) |\n| `views list`, `create`, `run`, `update`, `delete` | Saved views of accounts, people and deals, private or shared with the workspace (needs `shared_views`) |\n| `views pin <viewId>`, `views unpin <viewId>` | Pin a saved view to your own sidebar, or take it off. Needs the `shared_views` flag |\n| `reports summary`, `reports run <report>`, `reports query`, `dashboards` | Pipeline reports over your deals, your own counts and sums, and dashboards of saved charts (needs `opportunities` and `reports`) |\n| `forecast show`, `quotas list`, `set`, `propose` | Closed won, commit and best case against each member\'s quota for a month or quarter (needs `opportunities` and `forecast`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# my accounts with a meeting this quarter: me is whoever runs it, so a saved view with it lists each member\'s own\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "owner", "operator": "is", "values": ["me"]}, {"field": "lastMeeting", "operator": "in_period", "values": ["this_quarter"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity --account-id 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (1,000 at most), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), every account a saved view lists (`--view <id>`: the API reads the view\'s own filter, so the count is what `kenso views run` lists), or `--all`. A view with no condition takes `--all` beside it. A filter that holds only options and no condition (`--filter \'{"includeImportOnly":true}\'`) takes `--all` beside it. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. `--add-tag 12,14` and `--remove-tag 13` put tags on every account or take them off (`kenso tags list` gives the ids); each tag is one row per account from `false` to `true` or back, so `kenso changes undo` takes off only the tags the change put on. `kenso people bulk-update` takes them too, with the same flags; `kenso opportunities bulk-update` does not, because deals have no tags. A text field\'s value is sent as you type it (`--set hqLocation=10001` is the text "10001"); a custom field\'s type is not known to the CLI, so quote its text when it reads as a number or as true or false: `--set \'custom.code="10001"\'`. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\nWithout `--yes` the command previews and prints the change\'s id. `--yes` with the same flags lists the records again as a new change; to apply exactly the preview, run `kenso accounts bulk-update --change-id <id> --yes` (or `kenso changes apply --change-id <id>`). `--change-id` takes no other target or `--set` flag.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `pipelineId`, `q`, `missingFields`). A stage belongs to one pipeline, and a bulk stage change keeps every deal in its own: `"pipelineId"` in the filter names one pipeline\'s deals, and a deal of another pipeline is counted under `failed` with the row code `other_pipeline` and is not moved (`kenso opportunities update` moves one deal to another pipeline):\n\n```bash\nkenso opportunities bulk-update --filter \'{"pipelineId":3,"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--view`, `--all`, `--exclude-ids`, and `--change-id` with `--yes` for a listed preview) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. `kenso changes undo` undoes a delete for 30 days: each account, person or deal still deleted is restored, as `kenso accounts restore`, `kenso people restore` or `kenso opportunities restore` restores it. A restore the record refuses (a person whose email a live person holds by now, a deal whose account is deleted) is that row\'s `undo_failed`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` (a delete of people or deals) when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId` (member ids, or `me` for whoever runs it), `closeDate` (`past_due`, `next_30_days`, `later`, `none`, or a period such as `this_week` or `next_quarter`), `sourceCampaignId`, `closedAt` and `createdAt` (periods). `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\nkenso pipelines propose --description "upsells and renewals for customers"\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`propose`** asks Ken to draft a pipeline from one sentence: a `name`, a `routingRule` and `stages`, in the shape `create` takes. It saves nothing. Read it, change what you want, and send it to `create`.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Deals in a pipeline\n\nA deal\'s stage names its pipeline, and the deal\'s `pipelineId` repeats it. To work one pipeline\'s deals, or move a deal between pipelines:\n\n```bash\nkenso opportunities list --pipeline-id 6\nkenso opportunities search --pipeline-id 6 --data \'{"countBy": ["stage"]}\'\nkenso opportunities create --account-id 501 --pipeline-id 6\nkenso opportunities move 77 --pipeline 6\nkenso opportunities move 77 --pipeline 6 --stage negotiating\n```\n\n- **`create --pipeline-id`** opens the deal in that pipeline\'s first live open stage. Without it, and without a `stage`, Ken reads each pipeline\'s `routingRule` and opens the deal in the pipeline whose rule clearly fits the account, else in the default pipeline. A pipeline you name always wins.\n- **`move --pipeline`** alone keeps the deal\'s category (`open`, `won` or `lost`): it lands in that pipeline\'s live stage of the category with the same label as its stage now, else in the category\'s first live stage. The printed deal says where it landed. With `--stage`, the stage must be that pipeline\'s; the error lists the pipeline\'s stage keys otherwise.\n- An archived pipeline takes no deal from another pipeline (`pipeline_archived`). The deals already in it still move between its stages.\n- A move is a stage change: it writes the same history, and a stage a person set is refused with `pinned_by_user` unless you pass `--overwrite-pinned`.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore --account-id 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore --account-id <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. Its Studio pages, committee seats and Knowledge facts do not come back: the delete purged them. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n```bash\nkenso people restore --person-id 16079\nkenso opportunities restore --opportunity-id 2133\n```\n\n`people restore` brings back a person deleted in the last 30 days, with the champion watch the delete ended, on no account as they were when they were deleted. A live person who holds their email, LinkedIn URL or accepted Instagram account by now keeps it: the restore answers `409` `person_exists` with that person\'s id. `opportunities restore` brings back a deal deleted in the last 30 days onto its account; while the account is deleted it answers `409` `account_deleted`, and `accounts restore` brings back the deals deleted with the account. A deal whose stage was removed since answers `409` `stage_removed`. A merged person, or a deal on a merged account, cannot be restored. Both are behind `crm_import_export` too.\n\n## Import a CSV export of another CRM\n\n```bash\nkenso import accounts companies.csv\nkenso import accounts companies.csv --map "Company=name" --map "Notes=" --yes\nkenso import accounts --id 42 --yes\nkenso record-import-rows list --import-id 42 --outcome skipped\nkenso record-imports undo --import-id 42\n```\n\n`kenso import accounts <file.csv>` uploads the file (a header row, at most 50,000 rows) and prints Kenso\'s plan: which field each column fills, which columns it skips, how owner and stage values are read (`valueMaps`) and what it could not settle (`questions`). Headers of Kenso, Twenty, HubSpot, Attio and Salesforce exports are recognized. `matches` says how many rows will fill a record the workspace already holds (`existing`: a match by the run\'s own keys, a restore of an account deleted in the last 30 days, or a row that repeats a record an earlier row creates) and how many will create one (`new`); a row the import would skip is in neither. It is counted when the plan is made and again when a change moves a column that decides matching or `--source`, so the workspace can still change before the start; it is left out when Kenso could not count. Nothing is written to your accounts yet. `--map "Header=field"` changes a column and `--map "Header="` skips it. A column fills a custom field with `--map "Header=custom.<key>"` (`kenso fields list --object account` has the keys; people are `person`, deals `opportunity`), and `--map "Header=new"` adds the custom field Kenso proposes for a column no field matches (`new:text` picks the type), and a column whose header is a custom field\'s label is mapped to it already; owner and stage values change with `kenso record-imports update --import-id <id>`.\n\nWith `--yes` the import starts and the command waits for it (`--timeout`, default 30m; the import keeps running on the server either way), then prints how many rows were created, updated, restored, left unchanged and skipped. Without `--yes` it stops at the plan and prints the command that starts that import (`--id <importId> --yes`), so the file is uploaded once. `--dry-run` sends nothing: with a file it prints the upload it would make, since the plan needs the upload, and with `--id` it reads the planned import and prints what `--map`, `--source` and `--research` would change on it. `--source twenty` names the system the file\'s record ids come from: pass the same one for every file of an export, so the people and deals files find the accounts by their old ids. `kenso record-imports delete --import-id <id>` discards an import that was planned and never started; one left planned for 30 days is discarded by itself.\n\nPer row: a domain no account has creates an account; a domain that is already an account fills only that account\'s empty fields, so nothing you entered is overwritten; an account deleted in the last 30 days is restored; a row with no usable domain is skipped, and `kenso record-import-rows list --import-id <id> --outcome skipped` says why. Research of new accounts is off unless you pass `--research`, which is charged per account. It needs the `accounts` and `crm_import_export` flags. This is a different command from `accounts import`, which creates accounts row by row from the machine running the CLI.\n\n`kenso record-imports undo --import-id <id>` takes a finished import back in the background (`kenso record-imports get --import-id <id>` reads `undoing`, then `undone`): an account the import created is deleted, and can be restored for 30 days, unless someone changed it since, it holds a deal, a person was added to it since, or it was merged; a field the import filled is emptied while it still holds the imported value. `kenso record-import-rows list --import-id <id>` shows each row\'s `undoOutcome`, and on a kept row its `undoReason`: `no_record`, `merged`, `changed_since` (a member, an API key or an agent worked it after the import), `has_deals`, `has_people` (a person was added to the account since), `on_other_accounts` (a person on an account the row did not place them on), `place_worked` (a touch or a member\'s write on a place the row gave the person), `deleted_since`, `fields_changed_since` (every field the row filled holds another value now), `delete_refused` or `undo_failed` (the undo failed on the row three times).\n\n`kenso import people <file.csv>` works the same way for people. Import the accounts file first: a people row\'s company id (Twenty\'s `Company Id`, HubSpot\'s associated company id) places the person on the account that kept that id, and without one the person goes on the account that holds their email\'s or company\'s domain. A people import never creates an account; a person whose company is no account comes in without one and the row says so. A row matches a person by email, then LinkedIn URL, then name on the company, as every other way into People does; a matched person gets only their empty fields filled (a phone only when they have none). A row with none of the three is skipped, and a row with only a name needs a company that is an account with a domain. `kenso record-imports undo --import-id <id>` takes a people import back too: a person it created leaves the accounts the row placed them on and is deleted, unless someone changed them since, they were contacted or have a touch planned, or they are on an open deal; a field it filled is emptied while it still holds the imported value. `kenso people import` stays the JSONL and enrichment path (`--find-emails`); `kenso import people` is the CRM file with a plan, a row report and one approval.\n\n`kenso import deals <file.csv>` works the same way for deals, after the accounts file and the people file. A row opens a deal on the account that kept its company id (Twenty\'s `Company Id`, HubSpot\'s associated company id), else on the account that holds its company domain; a row whose account Kenso does not know is skipped and says so. Its contact is the person a people import kept the row\'s contact id for (Twenty\'s `Point of Contact Id`). The plan maps each stage in the file to one of the workspace\'s deal stages (`valueMaps`, field `stage`): a stage\'s key or label matches by itself, Closed Won and Closed Lost go to the first won and lost stage, and a value with no match opens in the first open stage until you pick one with `kenso record-imports update`. Amounts stay in the workspace currency: an amount in another currency is left out with a warning, never converted. A row whose deal id an earlier import kept is that deal and only gets its empty fields filled. A row no id names a deal for is the one live deal on its account with its name and its contact (a side with no contact matches any) that is open, won or lost as the row is: it fills that deal\'s empty fields and keeps the row\'s id for it, and a row that matches two such deals is skipped and names them. A file with no id column is matched that way only, and the plan says so (`no_source_id`). `kenso record-imports undo --import-id <id>` takes a deals import back: a deal it opened is deleted unless someone changed it since, and a field it filled is emptied while it still holds the imported value. Undo in the reverse order of the imports (deals, then people, then accounts): an account that holds a deal is kept.\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --view 40 --out pipeline.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved view of that object, your own or one shared with the workspace (`kenso views list --object account` shows the ids; people are `person`, deals `opportunity`): the file holds the rows the view lists, in its sort, so its row count is the view\'s count. `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields; given with `--view`, each replaces that key of the view. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## Duplicates and merges\n\n```bash\nkenso accounts duplicates --scan\nkenso accounts merge 812 --into 77 --dry-run\nkenso accounts merge 812 --into 77 --yes\nkenso accounts merges list --merged-by system\nkenso accounts merges 41\nkenso people merge 9 --into 7 --dry-run\nkenso people merge 9 --into 7 --yes\n```\n\nThese need the `crm_import_export` flag beside `accounts`. `accounts duplicates` lists the pairs of accounts that look like one company: both accounts, why they were paired (`reasons`: `domain`, `linkedin`, `name`) and `isCertain`, true when the two share the name and the domain apart from its ending (acme.com and acme.co). `--scan` compares every account first; a scan also runs after each accounts import. `--status dismissed` or `merged` shows the answered pairs. `kenso account-duplicates dismiss --duplicate-id <duplicateId>` answers that a pair is not a duplicate, for good.\n\n`accounts merge <accountId> --into <id>` merges the first account into the second, the one you keep. A merge cannot be undone, so look first: `--dry-run` prints `mergeSummary` (each field that changes with its value before and after, and how many people, deals, touches and domains move) and writes nothing. The merge itself needs `--yes` when no person is at the terminal. It answers the kept account with the same summary and a `mergeId`.\n\n`people merge <personId> --into <id>` merges the first person into the second, the one you keep, and needs only the `accounts` flag. The kept person keeps their own values and takes the other\'s for their blank fields, custom fields included; account places, deals, meetings, tasks, notes and captured email and meetings move to them. It cannot be undone either: `--dry-run` (which needs `crm_import_export`) prints the kept person with `mergeSummary`, the `fieldChanges` the merge would fill and `moved` (`accountCount`, `combinedAccountCount`, `opportunityCount`, `meetingCount`, `taskCount`, `noteCount`, `timelineEventCount`), and writes nothing. The merge itself needs `--yes` when no person is at the terminal. The same as the MCP\'s `people(operation="merge", dry_run=true)`.\n\n`accounts merges list` is the log, newest first, and `accounts merges <mergeId>` opens one merge with `mergedValues`: the merged-away account as it was. `--merged-by system` shows the merges Ken made itself. Where automatic merging is on for the workspace, Ken merges only certain pairs, keeps the customer, then the owned, then the last touched account, and leaves a pair for you when both are customers, the two have different owners, or one is being worked and the other is set aside (`heldReason` on the pair says which). That job is off unless it was turned on for the workspace.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. The created entry of a deal a CSV import brought in has `imported: true`; one imported in a won or lost stage entered it on its file\'s close date, which is its `enteredAt`. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. With the `pipelines` flag on, a move between pipelines also has `pipeline` and `fromPipeline` (`{id, name}`), the pipeline the deal moved into and out of. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes list --account 5 --related # with the notes on its deals and people\nkenso notes list --parent 900 # every comment under note 900, oldest first\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\n`notes list` prints each note with its first 50 comments; when `commentCount` is higher, `notes list --parent <noteId>` reads them all. The body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the notes on the account, its deals and its people (`notes list --account <id> --related` reads the same). The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules --pipeline 6\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier --dry-run\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Without `--pipeline` the list is the default pipeline\'s stages; `--pipeline <id>` lists that pipeline\'s. A stage key is unique across pipelines, so a stage of any pipeline is set by its key, and with `--pipeline` the command first checks the stage is that pipeline\'s. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Record page layouts\n\n```bash\nkenso layouts show account\nkenso layouts set account --header tier,ownerMemberId,score,custom.arr\nkenso layouts show account > layout.json && kenso layouts set account --data @layout.json\nkenso layouts reset account --dry-run\nkenso layouts reset account --yes\n```\n\nWith the `record_layout` flag on, a workspace lays out each record page once, for every member: `account`, `person` or `opportunity` (a deal). `show` prints `GET /v1/record-layouts/{object}`: `isDefault`, `version`, `headerFields` (up to 6, pinned under the record\'s name), `railSections` (`{name, fields}`), `hiddenFields` (under the rail\'s More), `sections` (`{key, label, placement, locked, hidden}`, in page order) and `availableFields`. Field keys are the field catalog\'s (`ownerMemberId`, `closeDate`, `primaryDomain`); a custom field is `custom.<field_key>`, and a new one joins the last rail section.\n\n`set --header` pins up to 6 fields and keeps the rest of the saved layout; the fields it unpins go to the top of the first rail section. `set --data` saves a whole layout, so group the rail into sections or hide a section that way, starting from `show`. A save made after someone else\'s answers a conflict: show it again. `reset` puts the page back to Kenso\'s default for every member, so it needs `--yes` (save the layout with `show` first). `set` and `reset` print the request with `--dry-run` and change nothing. Saving needs the `workspace_settings` permission, and the account page also needs the `accounts` plan. The same as the MCP\'s `account_views` operations `record-layouts-get`, `record-layouts-replace` and `record-layouts-reset`.\n\n## Pin a saved view\n\n```bash\nkenso views pin 118\nkenso views unpin 118\n```\n\nWith the `shared_views` flag on, `views pin` adds a saved view to your own sidebar, nested under its list (an account view under Accounts, a person view under People, a deal view under Deals). It is `kenso pins add --kind view --view-id <viewId>` under the name you would try: it prints the pin, and a view already pinned answers the pin it has. Pins are yours alone: pinning a shared view does not pin it for a teammate. `views unpin` finds your pin of the view and removes it, and prints `{"viewId": ..., "removed": true}`; a view you had not pinned prints `removed: false` and changes nothing. The view itself stays either way. `kenso pins list` shows every pin you have.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time with its offset (`2026-11-20T15:00:00Z`); `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. When one fails, its error names the tasks before it, which are already changed. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n\n## Custom fields\n\n```bash\nkenso fields list --object account\nkenso fields create --object account --type select --label Region --data \'{"options":["EMEA","North America"]}\' --dry-run\nkenso fields create --object account --type select --label Region --data \'{"options":["EMEA","North America"]}\'\nkenso fields update --field-id 412 --label "Sales region"\nkenso fields archive --field-id 412 --yes\n```\n\nWith the `custom_fields` flag on, each workspace adds its own fields to accounts, people and deals (`--object account`, `person` or `opportunity`). `fields list` prints the built-in and custom fields; a custom field is `custom.<key>`, the name `customFields`, `bulk-update --set`, stage rules, layouts and imports use. Run it before you add a field that may already exist.\n\n- **`create`** takes `--object`, `--type` (`text`, `number`, `boolean`, `date`, `json`, `select`, `multi_select`, `currency`, `url` or `user`; fixed once created) and `--label`. `--key` is made from the label when you leave it out ("Contract value" is `contract_value`). `--description` says what the field means; Ken reads it when it fills the field. A select or multi_select takes its choices in `--data` as `options`, each a label or `{label, color, key}`, up to 200.\n- **`update`** changes the label, the description or the options. `options` in `--data` is the whole list: keep an option by its `key`, and one you leave out is archived, never deleted, so the records that hold it keep it.\n- **`archive`** hides a field from the pickers, the columns and the record rail and keeps every value, so it asks for `--yes`. `kenso fields update --field-id 412 --no-is-archived` brings it back. An object holds at most 100 live custom fields.\n\n## Field-fill settings and Ken\'s suggestions\n\n```bash\nkenso field-fill-settings list\nkenso field-fill-settings update --object opportunity --field amount --mode suggest --instruction "Budget the buyer named, in USD"\nkenso suggestions list --account-id 812\nkenso suggestions approve --suggestion-id 31\nkenso suggestions reject --suggestion-id 32 --reason "That was last year\'s budget"\nkenso fields fill --object opportunity --field nextStep --all\nkenso fields fill --object account --field custom.segment --data \'{"ids":[812,813]}\'\n```\n\nWith the `ken_field_fill` flag on, Ken reads email, calls and meetings and fills record fields. `field-fill-settings list` shows each field Ken can fill with its `mode`: `default` (Ken fills an empty field and suggests a change to a filled one), `off`, `suggest` (every value waits for a person) or `auto`. `update` sets a field\'s mode and an `--instruction` of up to 500 characters that tells Ken what to look for. A new mode applies to the next email, call or meeting Ken reads.\n\nA value that waits for a person is a suggestion: the field, its value now (`from`), Ken\'s value (`to`), the quote and its source. `suggestions list` shows the pending ones; narrow it with `--status`, `--object` and `--record-id` (one record), `--account-id` (the account, its people and its deals) or `--meeting-id`. `approve` writes Ken\'s value to the record (`--data \'{"value": ...}\'` writes yours instead) and `reject` leaves the record as it is. Both are a person\'s call: run them on the user\'s word.\n\n`fields fill` fills one deal field for the deals that have none, from their recorded meetings and captured email. As written above it only answers how many deals have no value and what filling them costs, and starts nothing; `--no-body-dry-run` starts it. It needs `bulk_edit` too.\n\n`fields fill --object account` does the same for one custom field of accounts (`custom.<key>`, of type text, number, select or date; it needs `custom_fields` too). Ken reads only what Kenso already holds about each account: its company facts, newest research, Knowledge facts, the team\'s notes, recorded meetings, captured email a teammate may read, and stored website pages. It runs no research and looks nothing up outside Kenso. It costs 1 credit per account Ken reads, the dry run shows the count and the credits first, and Ken writes only an empty field: a value a person set is never overwritten. The field\'s `--description` tells Ken what to look for.\n\n## Saved views\n\n```bash\nkenso views list --object account\nkenso views create --object account --name "Tier 1, no meeting in 30 days" --visibility workspace --data @view.json --dry-run\nkenso views run --view-id 140 --limit 100 --include-total\nkenso views update --view-id 140 --name "Tier 1, quiet for 30 days"\nkenso views delete --view-id 140 --yes\n```\n\nWith the `shared_views` flag on, a saved view is a name, its object\'s search `filter` and `sort`, `columns` and a `layout` (`list` or `board`), private to its maker or shared with the workspace (`--visibility workspace`). `view.json` holds `filter` and `sort` in the shape the object\'s search takes (`filters`, `where`, `q`), so try it with `kenso accounts search --data` first. `views list` shows the workspace\'s shared views and your private ones. `run` lists a view\'s records exactly as its object\'s search returns them, page by page. `update` changes what you send, and `filter` replaces the whole filter. Any member changes or deletes a shared view, but only its maker makes it private. `delete` asks for `--yes` and takes the view off every member\'s sidebar. `kenso views pin` (above) pins one.\n\n## Reports and dashboards\n\n```bash\nkenso reports summary\nkenso reports list\nkenso reports run won_by_month --period this_year --owner 41\nkenso reports query --data \'{"measures":[{"op":"sum","field":"amount"}],"dimensions":[{"field":"stage"}]}\'\nkenso dashboards create --name "Q4 pipeline" --visibility workspace\nkenso dashboards add-chart --dashboard-id 3 --title "Won by month" --data \'{"report":{"key":"won_by_month","period":"this_year"}}\'\n```\n\nWith the `opportunities` and `reports` flags on, reports count and sum your deals. `reports summary` prints where the period stands (closed won, open pipeline, weighted pipeline, win rate) and what needs you, then one row per stock report. `reports run <report>` prints one stock report as a table: `pipeline_by_stage`, `won_by_month`, `stage_conversion`, `time_in_stage`, `won_by_source_campaign` or `activity_by_member`. Each takes `--period` (`this_quarter` by default, a month such as `2026-03`, a quarter, a year or a day range), `--owner` and `--pipeline`, and `--full` prints the whole answer with each bucket\'s filter for `opportunities search`.\n\n`reports query` asks your own question: `measures` (1 to 4 of `count`, `sum`, `avg` or `weighted_sum` of `amount`), `dimensions` (up to 2 of `stage`, `stageCategory`, `ownerMemberId`, `sourceCampaignId`, `closedAt`, `createdAt` or `closeDate`, the dates by `month`, `quarter` or `year`) and a `filter` as `opportunities search` takes it. It only reads.\n\nA dashboard keeps charts, up to 12, private to its owner or shared with the workspace. A chart is a stock report (`report`: its `key`, `period`, `ownerMemberId`, `pipelineId`) or a `query`, drawn as `bars` or a `trend`. `dashboards get --dashboard-id 3` reads one, and `update`, `remove-chart` and `delete` change it (the last two ask for `--yes`).\n\n## Forecast and quotas\n\n```bash\nkenso forecast show --period 2026-Q4\nkenso forecast show --period 2026-11 --include-deals\nkenso quotas list --period 2026-Q4\nkenso quotas propose --period 2027-Q1 --uplift-percent 15\nkenso quotas propose --period 2027-Q1 --uplift-percent 15 --apply\nkenso quotas set --period 2027-Q1 --member-id 41 --amount 120000\n```\n\nWith the `opportunities` and `forecast` flags on, `forecast show` reads closed won, commit and best case for a quarter (`2026-Q4`) or a month (`2026-11`), per member and for the team, each against its quota. Without `--period` it reads the current quarter. `--include-deals` adds the deals it counted. `noCloseDate` counts the open deals no period holds because they have no close date; with two pipelines or more, its `pipelines` splits that count by pipeline. `quotas propose` works out each member\'s quota from what they closed won in the quarter before the period (or the last quarter that has ended) plus `--uplift-percent` (0 to 200, default 15), and writes nothing; with `--apply` it saves those amounts. `quotas set` sets one member\'s quota in the workspace currency, and `--data \'{"memberId":41,"amount":null}\'` removes it.\n';
|
|
9964
10074
|
}
|
|
9965
10075
|
});
|
|
9966
10076
|
|
|
@@ -11110,7 +11220,7 @@ async function browserLogin(ctx, opts, overrides2) {
|
|
|
11110
11220
|
openBrowser(pending.verificationUrl, deps);
|
|
11111
11221
|
}
|
|
11112
11222
|
const picked = await collect(ctx, deps, pending, { retry: RETRY_LOGIN, deniedCode: "access_denied" });
|
|
11113
|
-
return saveLogin(ctx, { profile: opts.profile,
|
|
11223
|
+
return saveLogin(ctx, { profile: opts.profile, workspace: opts.workspace, saveApiUrl: opts.saveApiUrl === true }, picked);
|
|
11114
11224
|
}
|
|
11115
11225
|
async function waitForPendingLogin(ctx, opts, overrides2) {
|
|
11116
11226
|
const deps = { ...defaultDeps, ...overrides2 };
|
|
@@ -11132,7 +11242,7 @@ async function waitForPendingLogin(ctx, opts, overrides2) {
|
|
|
11132
11242
|
ctx.output.info(`Waiting for the person to approve ${pending.verificationUrl} (code ${pending.userCode}) until ${pending.expiresAt}.`);
|
|
11133
11243
|
const stopAtMs = opts.timeoutMs !== void 0 ? deps.now() + opts.timeoutMs : void 0;
|
|
11134
11244
|
const picked = await collect(ctx, deps, pending, { retry: NO_WAIT_RETRY, deniedCode: "login_denied", stopAtMs });
|
|
11135
|
-
return saveLogin(ctx, { profile: pending.profile,
|
|
11245
|
+
return saveLogin(ctx, { profile: pending.profile, workspace: opts.workspace, saveApiUrl: opts.saveApiUrl === true }, picked);
|
|
11136
11246
|
}
|
|
11137
11247
|
async function collect(ctx, deps, pending, opts) {
|
|
11138
11248
|
try {
|
|
@@ -11147,6 +11257,12 @@ async function collect(ctx, deps, pending, opts) {
|
|
|
11147
11257
|
function forget(ctx, pending) {
|
|
11148
11258
|
if (readPendingLogin(ctx.env)?.loginId === pending.loginId) removePendingLogin(ctx.env);
|
|
11149
11259
|
}
|
|
11260
|
+
function warnUnsavedApiUrl(ctx, savedApiUrl) {
|
|
11261
|
+
if (savedApiUrl !== void 0 || ctx.auth.apiUrl === DEFAULT_API_URL) return;
|
|
11262
|
+
ctx.output.warn(
|
|
11263
|
+
`The key was saved for ${ctx.auth.apiUrl}, but the URL was not: later commands reach that API only while KENSO_API_URL is set. Log in with --save-api-url to save it in the profile.`
|
|
11264
|
+
);
|
|
11265
|
+
}
|
|
11150
11266
|
function saveLogin(ctx, target2, picked) {
|
|
11151
11267
|
const workspaceId = target2.workspace ?? (picked.workspaceId !== void 0 ? String(picked.workspaceId) : void 0);
|
|
11152
11268
|
if (target2.workspace !== void 0 && picked.workspaceId !== void 0 && target2.workspace !== String(picked.workspaceId)) {
|
|
@@ -11154,6 +11270,7 @@ function saveLogin(ctx, target2, picked) {
|
|
|
11154
11270
|
`The key was approved for workspace ${String(picked.workspaceId)}, but --workspace ${target2.workspace} was saved. The key reaches every workspace you belong to, so this works only if you are a member of it.`
|
|
11155
11271
|
);
|
|
11156
11272
|
}
|
|
11273
|
+
const apiUrl = apiUrlToSave(ctx.auth, ctx.env, target2.saveApiUrl, target2.profile);
|
|
11157
11274
|
writeProfile(
|
|
11158
11275
|
target2.profile,
|
|
11159
11276
|
{
|
|
@@ -11161,11 +11278,13 @@ function saveLogin(ctx, target2, picked) {
|
|
|
11161
11278
|
workspaceId,
|
|
11162
11279
|
email: picked.email,
|
|
11163
11280
|
keyId: picked.apiKeyId !== void 0 ? String(picked.apiKeyId) : void 0,
|
|
11164
|
-
apiUrl
|
|
11281
|
+
apiUrl,
|
|
11282
|
+
keyOrigin: originOf(ctx.auth.apiUrl)
|
|
11165
11283
|
},
|
|
11166
11284
|
{ activate: true, env: ctx.env }
|
|
11167
11285
|
);
|
|
11168
11286
|
clearCache(ctx.env);
|
|
11287
|
+
warnUnsavedApiUrl(ctx, apiUrl);
|
|
11169
11288
|
if (ctx.auth.source === "env") {
|
|
11170
11289
|
ctx.output.warn("KENSO_API_KEY is set and wins over the saved profile. Unset it to use the saved key.");
|
|
11171
11290
|
}
|
|
@@ -11234,6 +11353,7 @@ var init_browser_login = __esm({
|
|
|
11234
11353
|
init_config();
|
|
11235
11354
|
init_errors();
|
|
11236
11355
|
init_exit_codes();
|
|
11356
|
+
init_endpoint();
|
|
11237
11357
|
init_http();
|
|
11238
11358
|
init_pending_login();
|
|
11239
11359
|
MAX_DEVICE_NAME = 100;
|
|
@@ -11307,6 +11427,7 @@ var init_login = __esm({
|
|
|
11307
11427
|
init_config();
|
|
11308
11428
|
init_errors();
|
|
11309
11429
|
init_exit_codes();
|
|
11430
|
+
init_endpoint();
|
|
11310
11431
|
init_http();
|
|
11311
11432
|
init_input();
|
|
11312
11433
|
init_browser_login();
|
|
@@ -11322,9 +11443,10 @@ var init_login = __esm({
|
|
|
11322
11443
|
when: "before the first command on a machine, or after an unauthorized error: a person approves the sign-in in the browser",
|
|
11323
11444
|
next: "kenso workspace use <workspaceId>, then kenso doctor"
|
|
11324
11445
|
},
|
|
11325
|
-
description: "With --with-key, reads one API key from stdin, checks it with GET /v1/me and saves it to the profile (--profile, KENSO_PROFILE, the folder's kenso.json or the active one) in ~/.kenso/config.json with mode 0600. The workspace is --workspace when the key can reach it, else the key's only workspace (a developer sandbox counts only when every workspace is one). The key is never a flag value: to use a key from an environment variable, pipe the variable in as the first example shows (an empty or malformed key is refused, exit 2, without printing it). Without --with-key it starts a browser login and waits up to 10 minutes for the approval. --no-wait prints {verificationUrl, userCode, expiresAt, next} and returns at once, for an agent to hand the link to its person; kenso auth wait then collects the key. While that login is pending, another login for the same profile and API reuses it.",
|
|
11446
|
+
description: "With --with-key, reads one API key from stdin, checks it with GET /v1/me and saves it to the profile (--profile, KENSO_PROFILE, the folder's kenso.json or the active one) in ~/.kenso/config.json with mode 0600. The workspace is --workspace when the key can reach it, else the key's only workspace (a developer sandbox counts only when every workspace is one). The key is never a flag value: to use a key from an environment variable, pipe the variable in as the first example shows (an empty or malformed key is refused, exit 2, without printing it). Without --with-key it starts a browser login and waits up to 10 minutes for the approval. --no-wait prints {verificationUrl, userCode, expiresAt, next} and returns at once, for an agent to hand the link to its person; kenso auth wait then collects the key. While that login is pending, another login for the same profile and API reuses it. The key is saved for the API it was checked on and is sent to no other. A KENSO_API_URL other than https://api.ken.so is saved in the profile only with --save-api-url; without it, later commands reach that API only while KENSO_API_URL is set.",
|
|
11326
11447
|
flags: {
|
|
11327
11448
|
"with-key": { type: "boolean", description: "Read the API key from stdin" },
|
|
11449
|
+
"save-api-url": { type: "boolean", description: "Save KENSO_API_URL in the profile, so later commands use that API without the variable" },
|
|
11328
11450
|
"device-name": { type: "string", description: "Name this machine on the browser sign-in page" },
|
|
11329
11451
|
"no-browser": { type: "boolean", description: "Print the sign-in link instead of opening a browser" },
|
|
11330
11452
|
"no-wait": { type: "boolean", description: "Start the browser login, print the link and code, and return at once (collect it with kenso auth wait)" }
|
|
@@ -11341,7 +11463,8 @@ var init_login = __esm({
|
|
|
11341
11463
|
deviceName: typeof flags["device-name"] === "string" ? flags["device-name"] : void 0,
|
|
11342
11464
|
noBrowser: flags["no-browser"] === true,
|
|
11343
11465
|
workspace: ctx.flags.workspace,
|
|
11344
|
-
noWait: flags["no-wait"] === true
|
|
11466
|
+
noWait: flags["no-wait"] === true,
|
|
11467
|
+
saveApiUrl: flags["save-api-url"] === true
|
|
11345
11468
|
});
|
|
11346
11469
|
}
|
|
11347
11470
|
const stdin = ctx.stdin ?? process.stdin;
|
|
@@ -11400,17 +11523,20 @@ var init_login = __esm({
|
|
|
11400
11523
|
const counted = ids2.length > 1 ? await withoutSandboxes(ctx, key, ids2) : ids2;
|
|
11401
11524
|
if (counted.length === 1) workspaceId = counted[0];
|
|
11402
11525
|
}
|
|
11526
|
+
const apiUrl = apiUrlToSave(ctx.auth, ctx.env, flags["save-api-url"] === true, profile);
|
|
11403
11527
|
writeProfile(
|
|
11404
11528
|
profile,
|
|
11405
11529
|
{
|
|
11406
11530
|
apiKey: key,
|
|
11407
11531
|
workspaceId,
|
|
11408
|
-
apiUrl
|
|
11532
|
+
apiUrl,
|
|
11533
|
+
keyOrigin: originOf(ctx.auth.apiUrl),
|
|
11409
11534
|
email: me.email
|
|
11410
11535
|
},
|
|
11411
11536
|
{ activate: true, env: ctx.env }
|
|
11412
11537
|
);
|
|
11413
11538
|
clearCache(ctx.env);
|
|
11539
|
+
warnUnsavedApiUrl(ctx, apiUrl);
|
|
11414
11540
|
if (ctx.auth.source === "env") {
|
|
11415
11541
|
ctx.output.warn("KENSO_API_KEY is set and wins over the saved profile. Unset it to use the saved key.");
|
|
11416
11542
|
}
|
|
@@ -11432,19 +11558,21 @@ var logout_exports = {};
|
|
|
11432
11558
|
__export(logout_exports, {
|
|
11433
11559
|
default: () => logout_default
|
|
11434
11560
|
});
|
|
11435
|
-
async function revoke(ctx,
|
|
11436
|
-
const auth = { Authorization: `Bearer ${apiKey}` };
|
|
11561
|
+
async function revoke(ctx, profile) {
|
|
11562
|
+
const auth = { Authorization: `Bearer ${profile.apiKey}` };
|
|
11563
|
+
const keyOrigin = profileKeyOrigin(profile);
|
|
11437
11564
|
try {
|
|
11438
|
-
let workspaceId =
|
|
11565
|
+
let workspaceId = profile.workspaceId;
|
|
11439
11566
|
if (!workspaceId) {
|
|
11440
|
-
const me = await ctx.client.request({ method: "GET", path: "/v1/me", anonymous: true, noWorkspace: true, headers: auth, signal: ctx.signal });
|
|
11567
|
+
const me = await ctx.client.request({ method: "GET", path: "/v1/me", anonymous: true, keyOrigin, noWorkspace: true, headers: auth, signal: ctx.signal });
|
|
11441
11568
|
const first = unwrap(me.body)?.workspaces?.[0]?.id;
|
|
11442
11569
|
workspaceId = first !== void 0 ? String(first) : void 0;
|
|
11443
11570
|
}
|
|
11444
11571
|
await ctx.client.request({
|
|
11445
11572
|
method: "DELETE",
|
|
11446
|
-
path: `/v1/api-keys/${encodeURIComponent(keyId)}`,
|
|
11573
|
+
path: `/v1/api-keys/${encodeURIComponent(profile.keyId)}`,
|
|
11447
11574
|
anonymous: true,
|
|
11575
|
+
keyOrigin,
|
|
11448
11576
|
noWorkspace: true,
|
|
11449
11577
|
headers: workspaceId ? { ...auth, "X-Ken-Workspace-Id": workspaceId } : auth,
|
|
11450
11578
|
signal: ctx.signal
|
|
@@ -11452,6 +11580,15 @@ async function revoke(ctx, apiKey, keyId, savedWorkspaceId) {
|
|
|
11452
11580
|
return true;
|
|
11453
11581
|
} catch (err) {
|
|
11454
11582
|
if (err instanceof KensoError && err.exitCode === ExitCode.Interrupted) throw err;
|
|
11583
|
+
if (err instanceof KensoError && err.code === "key_origin_mismatch") {
|
|
11584
|
+
throw new KensoError({
|
|
11585
|
+
code: err.code,
|
|
11586
|
+
message: `${err.message} Nothing was removed.`,
|
|
11587
|
+
exitCode: err.exitCode,
|
|
11588
|
+
field: err.field,
|
|
11589
|
+
hint: `Set KENSO_API_URL to ${keyOrigin} (or unset it if that is the default) and log out again, or pass --keep-key to remove the profile without revoking the key.`
|
|
11590
|
+
});
|
|
11591
|
+
}
|
|
11455
11592
|
const why = err instanceof Error ? err.message : String(err);
|
|
11456
11593
|
ctx.output.warn(`Could not revoke the key (${why}). The profile is removed anyway; revoke the key at Settings > API keys.`);
|
|
11457
11594
|
return false;
|
|
@@ -11474,7 +11611,7 @@ var init_logout = __esm({
|
|
|
11474
11611
|
when: "this machine should stop using a saved profile: it removes the profile and revokes the key browser login made",
|
|
11475
11612
|
next: "kenso auth login to sign in again"
|
|
11476
11613
|
},
|
|
11477
|
-
description: "Removes the profile (--profile, KENSO_PROFILE, the folder's kenso.json or the active one) from ~/.kenso/config.json. When browser login made its key, it revokes that key first (--keep-key keeps it valid); if the revoke fails it warns and still removes the profile. A key saved with --with-key stays valid: revoke it at Settings > API keys.",
|
|
11614
|
+
description: "Removes the profile (--profile, KENSO_PROFILE, the folder's kenso.json or the active one) from ~/.kenso/config.json. When browser login made its key, it revokes that key first (--keep-key keeps it valid); if the revoke fails it warns and still removes the profile, but on an API other than the one the key was issued for it sends nothing and removes nothing (key_origin_mismatch, exit 3). A key saved with --with-key stays valid: revoke it at Settings > API keys.",
|
|
11478
11615
|
flags: {
|
|
11479
11616
|
"keep-key": { type: "boolean", description: "Remove the profile but leave its key valid" }
|
|
11480
11617
|
},
|
|
@@ -11486,7 +11623,7 @@ var init_logout = __esm({
|
|
|
11486
11623
|
if (notice) ctx.output.warn(notice);
|
|
11487
11624
|
const profile = readConfig(ctx.env).profiles[name];
|
|
11488
11625
|
const removed = profile !== void 0;
|
|
11489
|
-
const revoked = profile?.apiKey && profile.keyId && flags["keep-key"] !== true ? await revoke(ctx, profile.apiKey, profile.keyId
|
|
11626
|
+
const revoked = profile?.apiKey && profile.keyId && flags["keep-key"] !== true ? await revoke(ctx, { ...profile, apiKey: profile.apiKey, keyId: profile.keyId }) : false;
|
|
11490
11627
|
if (removed) removeProfile(name, ctx.env);
|
|
11491
11628
|
clearCache(ctx.env);
|
|
11492
11629
|
if (ctx.auth.source === "env") ctx.output.warn("KENSO_API_KEY is still set, so commands keep using that key.");
|
|
@@ -11519,7 +11656,7 @@ var init_status = __esm({
|
|
|
11519
11656
|
action: "status",
|
|
11520
11657
|
summary: "Show the key's user, workspace and expiry",
|
|
11521
11658
|
effect: "read",
|
|
11522
|
-
description: `Reads GET /v1/me for the email and workspaces, and GET /v1/api-keys for the key's expiry. Warns on stderr when the key expires within ${EXPIRY_WARNING_DAYS} days. A sandbox test key (kenso_test_) adds keyKind "test" and the sandbox it works in. workspaceSource says where the workspace came from: flag (--workspace), env (KENSO_WORKSPACE_ID), folder (a kenso.json, named in folderFile), profile or none.`,
|
|
11659
|
+
description: `Reads GET /v1/me for the email and workspaces, and GET /v1/api-keys for the key's expiry. Warns on stderr when the key expires within ${EXPIRY_WARNING_DAYS} days. A sandbox test key (kenso_test_) adds keyKind "test" and the sandbox it works in. apiUrl is the API the key was sent to. workspaceSource says where the workspace came from: flag (--workspace), env (KENSO_WORKSPACE_ID), folder (a kenso.json, named in folderFile), profile or none.`,
|
|
11523
11660
|
flags: {},
|
|
11524
11661
|
examples: ["kenso auth status", "kenso auth status --profile client-a"],
|
|
11525
11662
|
operationIds: ["me.get", "api-keys.list"],
|
|
@@ -11585,6 +11722,8 @@ var init_status = __esm({
|
|
|
11585
11722
|
activeWorkspace,
|
|
11586
11723
|
keyExpiresAt,
|
|
11587
11724
|
keySource: ctx.auth.source,
|
|
11725
|
+
// The API the key went to (KENSO_API_URL, the profile's apiUrl or the default), so a redirect cannot hide (DEV-13403).
|
|
11726
|
+
apiUrl: ctx.auth.apiUrl,
|
|
11588
11727
|
...staff ? { isSuperAdmin: true } : {},
|
|
11589
11728
|
profile: ctx.auth.profileName,
|
|
11590
11729
|
workspaceSource: ctx.auth.workspaceSource,
|
|
@@ -11621,6 +11760,7 @@ var init_wait2 = __esm({
|
|
|
11621
11760
|
effect: "read",
|
|
11622
11761
|
doc: { when: "After kenso login --no-wait, once you have handed the link and code to the person", next: "kenso whoami" },
|
|
11623
11762
|
flags: {
|
|
11763
|
+
"save-api-url": { type: "boolean", description: "Save KENSO_API_URL in the profile, so later commands use that API without the variable" },
|
|
11624
11764
|
timeout: { type: "string", description: "Stop waiting after this long: 90s, 10m, 1h or a number of seconds; it always polls once, so 0 checks once (default: until the code expires)" }
|
|
11625
11765
|
},
|
|
11626
11766
|
examples: ["kenso auth wait", "kenso auth wait --timeout 2m"],
|
|
@@ -11631,7 +11771,7 @@ var init_wait2 = __esm({
|
|
|
11631
11771
|
if (text4 !== void 0 && timeoutMs2 === void 0) {
|
|
11632
11772
|
throw usageError(`--timeout takes 90s, 10m, 1h or a number of seconds (got "${text4}").`, { field: "timeout", next: "kenso auth wait --help" });
|
|
11633
11773
|
}
|
|
11634
|
-
return waitForPendingLogin(ctx, { timeoutMs: timeoutMs2, workspace: ctx.flags.workspace });
|
|
11774
|
+
return waitForPendingLogin(ctx, { timeoutMs: timeoutMs2, workspace: ctx.flags.workspace, saveApiUrl: flags["save-api-url"] === true });
|
|
11635
11775
|
}
|
|
11636
11776
|
};
|
|
11637
11777
|
wait_default2 = command12;
|
|
@@ -16223,6 +16363,13 @@ var init_logs = __esm({
|
|
|
16223
16363
|
function mcpUrl(ctx) {
|
|
16224
16364
|
return ctx.env.KENSO_MCP_URL?.trim() || DEFAULT_MCP_URL;
|
|
16225
16365
|
}
|
|
16366
|
+
function keyMcpUrl(ctx) {
|
|
16367
|
+
const url = mcpUrl(ctx);
|
|
16368
|
+
const { origin } = checkEndpoint(url, "KENSO_MCP_URL");
|
|
16369
|
+
if (ctx.auth.keyOrigin === DEFAULT_API_ORIGIN && origin !== DEFAULT_MCP_ORIGIN) throw keyOriginError(ctx.auth.keyOrigin, origin, "KENSO_MCP_URL");
|
|
16370
|
+
if (origin !== DEFAULT_MCP_ORIGIN) ctx.output.warn(otherOriginWarning(origin, DEFAULT_MCP_ORIGIN, "KENSO_MCP_URL"));
|
|
16371
|
+
return url;
|
|
16372
|
+
}
|
|
16226
16373
|
function mcpClient(ctx) {
|
|
16227
16374
|
const apiKey = ctx.auth.apiKey;
|
|
16228
16375
|
if (!apiKey) {
|
|
@@ -16234,7 +16381,7 @@ function mcpClient(ctx) {
|
|
|
16234
16381
|
next: "kenso auth login"
|
|
16235
16382
|
});
|
|
16236
16383
|
}
|
|
16237
|
-
const url =
|
|
16384
|
+
const url = keyMcpUrl(ctx);
|
|
16238
16385
|
return new McpClient({
|
|
16239
16386
|
url,
|
|
16240
16387
|
apiKey,
|
|
@@ -16254,6 +16401,7 @@ var init_connect4 = __esm({
|
|
|
16254
16401
|
"use strict";
|
|
16255
16402
|
init_errors();
|
|
16256
16403
|
init_exit_codes();
|
|
16404
|
+
init_endpoint();
|
|
16257
16405
|
init_client();
|
|
16258
16406
|
}
|
|
16259
16407
|
});
|
|
@@ -17775,8 +17923,10 @@ function saveTestKey(ctx, sandboxId, key) {
|
|
|
17775
17923
|
{
|
|
17776
17924
|
apiKey: key.secret,
|
|
17777
17925
|
workspaceId: sandboxId,
|
|
17778
|
-
// The API
|
|
17926
|
+
// The API that issued the test key, the only one it works on (DEV-13403). Unlike a login, a sandbox profile
|
|
17927
|
+
// saves a non-default KENSO_API_URL without --save-api-url: the key is useless anywhere else.
|
|
17779
17928
|
apiUrl: ctx.auth.apiUrl !== DEFAULT_API_URL ? ctx.auth.apiUrl : void 0,
|
|
17929
|
+
keyOrigin: originOf(ctx.auth.apiUrl),
|
|
17780
17930
|
email: current.email,
|
|
17781
17931
|
keyId: key.id
|
|
17782
17932
|
},
|
|
@@ -17806,6 +17956,7 @@ var init_shared = __esm({
|
|
|
17806
17956
|
init_config();
|
|
17807
17957
|
init_errors();
|
|
17808
17958
|
init_exit_codes();
|
|
17959
|
+
init_endpoint();
|
|
17809
17960
|
SANDBOX_PROFILE = "sandbox";
|
|
17810
17961
|
SANDBOX_GATES = { all: ["developer_sandboxes"] };
|
|
17811
17962
|
SANDBOX_ID_POSITIONAL = { name: "sandboxId", description: "The sandbox id (default: your one sandbox)" };
|