kenso 0.1.158 → 0.1.160
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 +2 -0
- package/dist/discover.json +1 -1
- package/dist/kenso.js +163 -119
- package/dist/operations.index.json +1 -1
- package/dist/operations.json +1 -1
- package/docs/agents.md +5 -3
- package/docs/crm.md +5 -2
- package/docs/reference.md +2 -2
- package/package.json +2 -2
- package/skill/kenso/SKILL.md +5 -2
- package/skill/kenso-cli/SKILL.md +2 -2
- package/skill/shipped.json +6 -2
package/dist/kenso.js
CHANGED
|
@@ -3422,7 +3422,7 @@ var VERSION;
|
|
|
3422
3422
|
var init_version = __esm({
|
|
3423
3423
|
"src/core/version.ts"() {
|
|
3424
3424
|
"use strict";
|
|
3425
|
-
VERSION = true ? "0.1.
|
|
3425
|
+
VERSION = true ? "0.1.160" : "0.0.0-dev";
|
|
3426
3426
|
}
|
|
3427
3427
|
});
|
|
3428
3428
|
|
|
@@ -4254,6 +4254,57 @@ var init_rate_card = __esm({
|
|
|
4254
4254
|
}
|
|
4255
4255
|
});
|
|
4256
4256
|
|
|
4257
|
+
// src/commands/credits/common.ts
|
|
4258
|
+
function toCredits(millicredits) {
|
|
4259
|
+
return typeof millicredits === "number" && Number.isFinite(millicredits) ? Math.round(millicredits) / 1e3 : void 0;
|
|
4260
|
+
}
|
|
4261
|
+
function positiveFlag(flags, name) {
|
|
4262
|
+
const raw = flags[name];
|
|
4263
|
+
if (raw === void 0) return void 0;
|
|
4264
|
+
const text4 = String(raw).trim();
|
|
4265
|
+
if (!/^\d+$/.test(text4) || Number(text4) < 1 || !Number.isSafeInteger(Number(text4))) {
|
|
4266
|
+
throw usageError(`--${name} must be a positive whole number, not "${text4}".`, { field: name });
|
|
4267
|
+
}
|
|
4268
|
+
return Number(text4);
|
|
4269
|
+
}
|
|
4270
|
+
function instantFlag(flags, name) {
|
|
4271
|
+
const raw = flags[name];
|
|
4272
|
+
if (typeof raw !== "string") return void 0;
|
|
4273
|
+
const text4 = raw.trim();
|
|
4274
|
+
const back = /^(\d+)([dh])$/.exec(text4);
|
|
4275
|
+
if (back) return new Date(Date.now() - Number(back[1]) * (back[2] === "d" ? DAY_MS : DAY_MS / 24)).toISOString();
|
|
4276
|
+
const day = /^\d{4}-\d{2}-\d{2}$/.test(text4);
|
|
4277
|
+
const ms = Date.parse(day ? `${text4}T00:00:00Z` : text4);
|
|
4278
|
+
if (Number.isNaN(ms)) {
|
|
4279
|
+
throw usageError(`--${name} "${text4}" is not a date.`, { field: name, hint: "Use 7d, 12h, 2026-11-01 or 2026-11-01T09:00:00Z." });
|
|
4280
|
+
}
|
|
4281
|
+
return new Date(day && name === "until" ? ms + DAY_MS - 1 : ms).toISOString();
|
|
4282
|
+
}
|
|
4283
|
+
async function readAvailable(ctx) {
|
|
4284
|
+
try {
|
|
4285
|
+
const res = await ctx.client.request({ method: "GET", path: "/v1/credits", signal: ctx.signal });
|
|
4286
|
+
const available = unwrap(res.body)?.availableMillicredits;
|
|
4287
|
+
return { available: typeof available === "number" ? available : void 0 };
|
|
4288
|
+
} catch (err) {
|
|
4289
|
+
if (err instanceof KensoError && (err.exitCode === ExitCode.Auth || err.exitCode === ExitCode.Interrupted)) throw err;
|
|
4290
|
+
ctx.output.warn(`Could not read the available credits: ${err instanceof Error ? err.message : String(err)}`);
|
|
4291
|
+
return { estimateError: err instanceof KensoError ? { code: err.code, message: err.message } : { message: String(err) } };
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
function estimateFailed(error) {
|
|
4295
|
+
return new KensoError({ code: error.code ?? "estimate_failed", message: error.message, exitCode: ExitCode.Error });
|
|
4296
|
+
}
|
|
4297
|
+
var DAY_MS;
|
|
4298
|
+
var init_common = __esm({
|
|
4299
|
+
"src/commands/credits/common.ts"() {
|
|
4300
|
+
"use strict";
|
|
4301
|
+
init_errors();
|
|
4302
|
+
init_exit_codes();
|
|
4303
|
+
init_http();
|
|
4304
|
+
DAY_MS = 864e5;
|
|
4305
|
+
}
|
|
4306
|
+
});
|
|
4307
|
+
|
|
4257
4308
|
// src/core/sse.ts
|
|
4258
4309
|
var SseParser;
|
|
4259
4310
|
var init_sse = __esm({
|
|
@@ -7401,7 +7452,10 @@ async function runEach(ctx, op, values, file, opts = {}) {
|
|
|
7401
7452
|
const args = eachArgs(op, opts.argValues ?? values, file);
|
|
7402
7453
|
const applyCommand = commandLine(op, args, ctx, ["--yes"]);
|
|
7403
7454
|
if (!isRead(op) && ctx.flags.yes !== true && ctx.flags.dryRun !== true) {
|
|
7404
|
-
throw usageError(`--each sends one ${op.method} per row:
|
|
7455
|
+
throw usageError(`--each sends one ${op.method} per row: run --dry-run to see the plan first, then its next adds --yes.`, {
|
|
7456
|
+
field: "yes",
|
|
7457
|
+
next: commandLine(op, args, ctx, ["--dry-run"])
|
|
7458
|
+
});
|
|
7405
7459
|
}
|
|
7406
7460
|
const input = await readInput(file, { stdin: ctx.stdin });
|
|
7407
7461
|
const index2 = paramIndex(op);
|
|
@@ -7416,6 +7470,7 @@ async function runEach(ctx, op, values, file, opts = {}) {
|
|
|
7416
7470
|
invalid2.push({ row, status: "invalid", reason: err.code, error: err.message, ...err.field ? { field: err.field } : {} });
|
|
7417
7471
|
}
|
|
7418
7472
|
});
|
|
7473
|
+
const spend = ctx.flags.dryRun === true && op.effect === "spend" ? await spendCost(ctx, op, items.map((item) => item.request)) : {};
|
|
7419
7474
|
const outcome = await runBatch(
|
|
7420
7475
|
{
|
|
7421
7476
|
command: `${op.resource} ${op.action}`,
|
|
@@ -7430,7 +7485,7 @@ async function runEach(ctx, op, values, file, opts = {}) {
|
|
|
7430
7485
|
execChunk: (chunk, chunkCtx) => sendRow(chunk[0], chunkCtx),
|
|
7431
7486
|
invalid: invalid2,
|
|
7432
7487
|
dryRun: ctx.flags.dryRun === true,
|
|
7433
|
-
dryRunExtra: { operationId: op.id, firstRequest: preview(items[0]?.request, op) },
|
|
7488
|
+
dryRunExtra: { operationId: op.id, firstRequest: preview(items[0]?.request, op), ...spend },
|
|
7434
7489
|
applyCommand
|
|
7435
7490
|
},
|
|
7436
7491
|
ctx
|
|
@@ -7468,7 +7523,8 @@ __export(execute_exports, {
|
|
|
7468
7523
|
operationExamples: () => operationExamples,
|
|
7469
7524
|
operationFlags: () => operationFlags,
|
|
7470
7525
|
operationToCommand: () => operationToCommand,
|
|
7471
|
-
secretParams: () => secretParams
|
|
7526
|
+
secretParams: () => secretParams,
|
|
7527
|
+
spendCost: () => spendCost
|
|
7472
7528
|
});
|
|
7473
7529
|
function isRecord4(value) {
|
|
7474
7530
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -7874,19 +7930,49 @@ async function* paginateLean(ctx, lean, plain2, opts) {
|
|
|
7874
7930
|
yield* ctx.client.paginate(plain2, opts);
|
|
7875
7931
|
}
|
|
7876
7932
|
}
|
|
7877
|
-
|
|
7933
|
+
function chargedLines(op, req) {
|
|
7878
7934
|
const skip = SKIPPED_CREDITS[op.id];
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
return
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7935
|
+
if (skip === void 0 || req.query?.[skip.query] !== skip.value) return { lines: op.credits ?? [] };
|
|
7936
|
+
return { lines: (op.credits ?? []).filter((line) => !skip.drops.includes(line.action)), skipped: skip.why };
|
|
7937
|
+
}
|
|
7938
|
+
function callMillicredits(op, charged, cards) {
|
|
7939
|
+
if (charged.lines.length === 0) return charged.skipped !== void 0 ? 0 : void 0;
|
|
7940
|
+
if (!ONE_UNIT_PER_CALL.has(op.id)) return void 0;
|
|
7941
|
+
let total = 0;
|
|
7942
|
+
for (const line of charged.lines) {
|
|
7943
|
+
const price = line.pricing === "varies" ? void 0 : unitMillicredits(line.action, cards);
|
|
7944
|
+
if (price === void 0) return void 0;
|
|
7945
|
+
total += price;
|
|
7946
|
+
}
|
|
7947
|
+
return total;
|
|
7948
|
+
}
|
|
7949
|
+
async function dryRunBalance(ctx) {
|
|
7950
|
+
try {
|
|
7951
|
+
return await readAvailable(ctx);
|
|
7952
|
+
} catch (err) {
|
|
7953
|
+
if (!(err instanceof KensoError) || err.exitCode !== ExitCode.Auth) throw err;
|
|
7954
|
+
ctx.output.warn(`Could not read the available credits: ${err.message}`);
|
|
7955
|
+
return { estimateError: { code: err.code, message: err.message } };
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7958
|
+
async function spendCost(ctx, op, requests) {
|
|
7959
|
+
const charged = requests.map((req) => chargedLines(op, req));
|
|
7960
|
+
const first = charged[0] ?? { lines: op.credits ?? [] };
|
|
7961
|
+
if (charged.length > 0 && charged.every((c) => c.skipped !== void 0 && c.lines.length === 0)) {
|
|
7962
|
+
return { cost: { lines: [], text: `not charged in credits (${first.skipped})`, rateCard: null }, credits: creditsCheck(0, void 0) };
|
|
7963
|
+
}
|
|
7964
|
+
const cards = (op.credits?.length ?? 0) > 0 ? await loadRateCards(ctx) : [];
|
|
7965
|
+
const cost = first.lines.length === 0 ? { lines: [], rateCard: null } : {
|
|
7966
|
+
lines: first.lines.map((line) => ({ ...line, price: priceLine(line, cards) })),
|
|
7967
|
+
rateCard: { source: cards[0]?.source ?? "bundled", versions: cards.map((card) => card.version) }
|
|
7889
7968
|
};
|
|
7969
|
+
let needed = 0;
|
|
7970
|
+
for (const call2 of charged) {
|
|
7971
|
+
const millicredits = callMillicredits(op, call2, cards);
|
|
7972
|
+
needed = needed === void 0 || millicredits === void 0 ? void 0 : needed + millicredits;
|
|
7973
|
+
}
|
|
7974
|
+
const { available, estimateError } = await dryRunBalance(ctx);
|
|
7975
|
+
return { cost, credits: creditsCheck(needed, available), ...estimateError ? { estimateError } : {} };
|
|
7890
7976
|
}
|
|
7891
7977
|
async function runOperation(ctx, op, flags) {
|
|
7892
7978
|
const secrets = secretParams(op);
|
|
@@ -7906,7 +7992,7 @@ async function runOperation(ctx, op, flags) {
|
|
|
7906
7992
|
const plain2 = buildRequest(op, values);
|
|
7907
7993
|
const req = lean ? buildRequest(op, { ...values, ...lean }) : plain2;
|
|
7908
7994
|
if (ctx.flags.dryRun) {
|
|
7909
|
-
const cost = op.effect === "spend" ? await spendCost(ctx, op, req) : {};
|
|
7995
|
+
const cost = op.effect === "spend" ? await spendCost(ctx, op, [req]) : {};
|
|
7910
7996
|
ctx.output.object({ dryRun: true, operationId: op.id, request: describeRequest(req, op), ...cost });
|
|
7911
7997
|
return ExitCode.Ok;
|
|
7912
7998
|
}
|
|
@@ -8035,7 +8121,7 @@ ${api}` : api,
|
|
|
8035
8121
|
run: (ctx, args) => runOperation(ctx, op, args.flags)
|
|
8036
8122
|
};
|
|
8037
8123
|
}
|
|
8038
|
-
var STREAM_HELP, DATA_KEY, IDEMPOTENCY_KEY, IDEMPOTENCY_KEY_FLAG, SCALAR_TYPES, FLAG_ALIASES, OUT_FLAG, CONTACT_FIELDS, COMPACT_FIELDS, COMPACT_NOTES, FULL_FLAG, LEAN_PARAMS, LIST_PARAM_TEXT, SKIPPED_CREDITS, HELP_NOTES_MAX, HELP_FLAG_MAX, FOOTER_FLAGS;
|
|
8124
|
+
var STREAM_HELP, DATA_KEY, IDEMPOTENCY_KEY, IDEMPOTENCY_KEY_FLAG, SCALAR_TYPES, FLAG_ALIASES, OUT_FLAG, CONTACT_FIELDS, COMPACT_FIELDS, COMPACT_NOTES, FULL_FLAG, LEAN_PARAMS, LIST_PARAM_TEXT, SKIPPED_CREDITS, ONE_UNIT_PER_CALL, HELP_NOTES_MAX, HELP_FLAG_MAX, FOOTER_FLAGS;
|
|
8039
8125
|
var init_execute = __esm({
|
|
8040
8126
|
"src/generated/execute.ts"() {
|
|
8041
8127
|
"use strict";
|
|
@@ -8048,6 +8134,7 @@ var init_execute = __esm({
|
|
|
8048
8134
|
init_secret_flags();
|
|
8049
8135
|
init_transfer();
|
|
8050
8136
|
init_rate_card();
|
|
8137
|
+
init_common();
|
|
8051
8138
|
init_stream();
|
|
8052
8139
|
STREAM_HELP = "A live stream: it prints one JSON line per event ({event, id, data}) as it arrives and runs until Ctrl-C, reconnecting when the server closes it (with Last-Event-ID once events carry an id). --until <event> ends after that event, --max-events <n> after n events, --once when the server closes it.";
|
|
8053
8140
|
DATA_KEY = "$data";
|
|
@@ -8110,6 +8197,7 @@ var init_execute = __esm({
|
|
|
8110
8197
|
why: "--skip-research: no research or committee run"
|
|
8111
8198
|
}
|
|
8112
8199
|
};
|
|
8200
|
+
ONE_UNIT_PER_CALL = /* @__PURE__ */ new Set(["email-finds.create", "search.get-place", "search.place-photos", "search.place-reviews"]);
|
|
8113
8201
|
HELP_NOTES_MAX = 320;
|
|
8114
8202
|
HELP_FLAG_MAX = 140;
|
|
8115
8203
|
FOOTER_FLAGS = /* @__PURE__ */ new Set(["each", "concurrency", "data"]);
|
|
@@ -8745,7 +8833,7 @@ function warnDropped(ctx, mapping) {
|
|
|
8745
8833
|
ctx.output.warn(`Not sent: ${list2}. Rename a column with --map '{"<column>": "customVariables.<name>"}'.`);
|
|
8746
8834
|
}
|
|
8747
8835
|
var OUT_FLAG2, CONCURRENCY_FLAG;
|
|
8748
|
-
var
|
|
8836
|
+
var init_common2 = __esm({
|
|
8749
8837
|
"src/commands/contacts/common.ts"() {
|
|
8750
8838
|
"use strict";
|
|
8751
8839
|
init_errors();
|
|
@@ -9083,7 +9171,7 @@ var init_bulk_update = __esm({
|
|
|
9083
9171
|
init_errors();
|
|
9084
9172
|
init_exit_codes();
|
|
9085
9173
|
init_http();
|
|
9086
|
-
|
|
9174
|
+
init_common2();
|
|
9087
9175
|
init_wait();
|
|
9088
9176
|
POLL_MS = 2e3;
|
|
9089
9177
|
MAX_IDS = 1e3;
|
|
@@ -9164,7 +9252,7 @@ var init_merge = __esm({
|
|
|
9164
9252
|
init_errors();
|
|
9165
9253
|
init_exit_codes();
|
|
9166
9254
|
init_http();
|
|
9167
|
-
|
|
9255
|
+
init_common2();
|
|
9168
9256
|
command3 = {
|
|
9169
9257
|
resource: "accounts",
|
|
9170
9258
|
action: "merge",
|
|
@@ -9377,7 +9465,7 @@ async function releaseClaim(ctx, claimId, headers = {}) {
|
|
|
9377
9465
|
return isRecord6(data) && typeof data.released === "number" ? data.released : 0;
|
|
9378
9466
|
}
|
|
9379
9467
|
var BETA, KINDS_TEXT, MAX_PER_FILE, MIN_LEASE_MINUTES, MAX_LEASE_MINUTES, KIND_FLAG, CAMPAIGN_FLAG, LIVE_ONLY_FLAG, PER_FILE_FLAG, LEASE_FLAG, OUT_FLAG3, UNTIL_DONE, WORK_TIMING, MAX_UNAVAILABLE_WAITS;
|
|
9380
|
-
var
|
|
9468
|
+
var init_common3 = __esm({
|
|
9381
9469
|
"src/commands/work/common.ts"() {
|
|
9382
9470
|
"use strict";
|
|
9383
9471
|
init_errors();
|
|
@@ -9418,7 +9506,7 @@ var init_duplicates = __esm({
|
|
|
9418
9506
|
init_errors();
|
|
9419
9507
|
init_exit_codes();
|
|
9420
9508
|
init_http();
|
|
9421
|
-
|
|
9509
|
+
init_common3();
|
|
9422
9510
|
STATUSES2 = ["open", "dismissed", "merged"];
|
|
9423
9511
|
command4 = {
|
|
9424
9512
|
resource: "accounts",
|
|
@@ -9492,8 +9580,8 @@ var init_merges = __esm({
|
|
|
9492
9580
|
init_errors();
|
|
9493
9581
|
init_exit_codes();
|
|
9494
9582
|
init_http();
|
|
9495
|
-
init_common();
|
|
9496
9583
|
init_common2();
|
|
9584
|
+
init_common3();
|
|
9497
9585
|
MERGED_BY = ["user", "agent", "api_key", "workflow", "system"];
|
|
9498
9586
|
command5 = {
|
|
9499
9587
|
resource: "accounts",
|
|
@@ -9766,7 +9854,7 @@ var init_client = __esm({
|
|
|
9766
9854
|
var agents_default;
|
|
9767
9855
|
var init_agents = __esm({
|
|
9768
9856
|
"docs/agents.md"() {
|
|
9769
|
-
agents_default = '# Coding agents\n\nThe CLI is built to be driven by a coding agent: Claude Code, Codex, Cursor, Gemini CLI or anything else that runs shell commands. An agent learns it from the Agent Skill, `kenso --help` and `kenso describe`, and never needs these web pages.\n\n## Set up an agent in three steps\n\n1. Install the CLI where the agent runs: on macOS or Linux, the [install script](https://ken.so/install.sh) piped to `sh` needs no Node; anywhere, `npm i -g kenso` needs Node 22 or newer. Without a global install, `npx -y kenso@latest <command>` runs any command.\n2. Give it a key. Either set `KENSO_API_KEY` (and `KENSO_WORKSPACE_ID` when the key reaches several workspaces) in the agent\'s environment, or log in once on that machine:\n\n```bash\nkenso auth login\nkenso workspace use 1234\n```\n\n3. Install the Agent Skill and connect the Kenso MCP server in one step, then check everything:\n\n```bash\nkenso agent setup\nkenso agent setup -y\nkenso doctor\n```\n\nTo hand the whole setup to an agent, give it [ken.so/get-started.md](https://ken.so/get-started.md): it runs these steps and stops only where a person has to act.\n\n## kenso agent setup\n\n`kenso agent setup` installs the `kenso` and `kenso-cli` skills (as `kenso skill install` does) and registers the Kenso MCP server, `https://mcp.ken.so/mcp`, with each coding agent:\n\n| Agent | `--client` | MCP server added with |\n|---|---|---|\n| Claude Code | `claude-code` | `claude mcp add --scope user --transport http kenso https://mcp.ken.so/mcp` |\n| Codex | `codex` | `codex mcp add kenso --url https://mcp.ken.so/mcp` |\n| Cursor | `cursor` | a `kenso` entry in `~/.cursor/mcp.json` |\n| Gemini CLI | `gemini` | `gemini mcp add --scope user --transport http kenso https://mcp.ken.so/mcp` |\n| OpenCode | `opencode` | a `kenso` entry in `~/.config/opencode/opencode.json` |\n\n```bash\nkenso agent setup --client claude-code -y\nkenso agent setup --client all -y\nkenso agent setup --status --json\n```\n\n- Without `--client`, it sets up the agent that runs it, else every agent found on the machine (its command on `PATH` or its config folder present).\n- Without `-y` it prints the plan and changes nothing; the plan\'s `next` applies it. `--status` reports, for every agent, the state of each bundled skill (`missing`, `current`, `stale` from an older kenso, or `edited` by hand) and whether the MCP server is `registered`, `missing`, in `conflict` or `unknown` (a config file it cannot read as JSON), and changes nothing. `--json` prints JSON on a terminal too.\n- An MCP entry with the Kenso URL under another name (such as `ken-ai` from the plugin) counts as registered, and nothing is added. A `kenso` entry pointing at another URL is left alone (`conflict`). A config file that is not plain JSON (it has comments) is left alone (`skipped`), and so is an agent whose command is not on `PATH`: their `next` is the command or edit to make by hand.\n- A missing `SKILL.md` and one an older kenso wrote are written. One edited by hand is left alone (`"status":"edited"`, with a stderr line naming `--force`) while the rest of the setup runs; `--force` replaces it. After a successful run, four requests to start with follow on stderr.\n- It exits 1 when any agent was not fully set up. The MCP server signs in with your Kenso account in the browser the first time the agent uses it; each agent\'s `next` says how (in Claude Code, `/mcp`).\n\n## An AGENTS.md section for your repo\n\nPaste this into the `AGENTS.md` (or `CLAUDE.md`) of a repo whose agents work in Kenso:\n\n```markdown\n## Kenso\n\n- Kenso is our outbound platform. One record or a question: use the Kenso MCP server (https://mcp.ken.so/mcp). A file or more than about 50 records: use the `kenso` CLI.\n- Setup: `npm i -g kenso`, `kenso auth login` (a person approves in the browser), `kenso agent setup -y`, `kenso doctor`.\n- Every write runs first with `--dry-run`; apply with the plan\'s `next`. Never put an API key in a flag, a file or the chat: use `KENSO_API_KEY`.\n- Code that calls the API: send `Authorization: Bearer $KENSO_API_KEY`, `Ken-Version` and `X-Ken-Workspace-Id`. Reference: ken.so/docs.md; the kenso-api skill is listed at ken.so/.well-known/skills/index.json.\n```\n\n## The Agent Skills\n\n`kenso skill install` writes the two skills bundled with this CLI, each one `SKILL.md` in a folder named like the skill, where each agent looks for skills:\n\n- `kenso`, the entry skill: it sends the agent to the Kenso skill for the job and sets the rules for the workspace, credits, sends and the final reply. Agents load it first; every help under an agent starts with `Agents: load the kenso skill first: kenso skill show kenso`.\n- `kenso-cli`: the CLI\'s commands for work from a file or over about 50 records.\n\n| Agent | `--client` | Folders |\n|---|---|---|\n| Claude Code | `claude-code` | `~/.claude/skills/kenso/`, `~/.claude/skills/kenso-cli/` |\n| Codex | `codex` | `~/.agents/skills/kenso/`, `~/.agents/skills/kenso-cli/` |\n| Cursor | `cursor` | `~/.cursor/skills/kenso/`, `~/.cursor/skills/kenso-cli/` |\n| Gemini CLI | `gemini` | `~/.gemini/skills/kenso/`, `~/.gemini/skills/kenso-cli/` |\n| OpenCode | `opencode` | `~/.config/opencode/skills/kenso/`, `~/.config/opencode/skills/kenso-cli/` |\n\nClaude Code\'s folders follow `CLAUDE_CONFIG_DIR` when that is set. Without `--client`, it installs for the agent that runs it when that is Claude Code, Codex or Cursor (detected from the environment, see below), else for all five. It prints what it wrote:\n\n```json\n{"installed":[{"client":"claude-code","path":"/home/you/.claude/skills/kenso-cli/SKILL.md","status":"created"},{"client":"claude-code","path":"/home/you/.claude/skills/kenso/SKILL.md","status":"created"}]}\n```\n\n```bash\nkenso skill install --client claude-code\nkenso skill install --client all\nkenso skill install --skill kenso\nkenso skill install --dir .claude/skills/kenso-cli\nkenso skill install --force\n```\n\n- `--skill <name>` installs one of the two. `--dir` writes one skill into that folder instead (`--skill`, else `kenso-cli`), for example a project\'s own skills folder. Name the folder like the skill, as agents expect.\n- A missing file is written (`"status":"created"`) and one an older kenso wrote is replaced (`"status":"updated"`); the same file is left as it is (`"status":"unchanged"`). A `SKILL.md` edited by hand is left alone (`"status":"edited"`) with a stderr line that names `--force`, and the command still exits 0. `--force` replaces it (`"status":"replaced"`).\n- `--dry-run` writes nothing and exits 0. It prints each target\'s status and a `next` that applies it.\n- Under a detected agent, when a bundled skill in that agent\'s folder is from an older kenso, a command ends with one stderr line, once per agent session: `The installed <name> skill is from an older kenso: kenso skill install`. It reads the files only, and nothing is replaced until you run `kenso skill install` or `kenso agent setup`. `KENSO_NO_SKILL_NOTICE=1` turns it off.\n- Cursor also reads `~/.claude/skills/` and `~/.agents/skills/` (Gemini CLI and OpenCode read `~/.agents/skills/` too), so after a default install for all of them an agent may list each Kenso skill more than once. To avoid that, install with `--client cursor` only, or remove the copies you do not need.\n\nBoth skills also ship in the Kenso plugin for Claude Code (`Ken-Technology/ken-ai-plugin`), so `npx skills add Ken-Technology/ken-ai-plugin` installs them along with the MCP skills; the plugin\'s copies are these files byte for byte. The other Kenso skills come from the MCP: list them, and read any of them without installing it:\n\n```bash\nkenso skill list\nkenso skill show kenso\nkenso skill show workflows --reference files.md\n```\n\n`kenso skill show` prints `kenso` and `kenso-cli` from the CLI itself, with no network and no sign-in. Any other skill is read from the Kenso MCP with your key.\n\n## Rules the skill teaches\n\n- **Data is on stdout, as JSON when piped.** Progress, warnings and errors are on stderr. Parse stdout; read stderr when the exit code is not 0.\n- **Plan, then apply.** Run a write with `--dry-run`, read the plan, then run the exact command in its `next` (the same command with `--yes`). A command with no dry run refuses `--dry-run` with `usage_error` and does nothing.\n- **Pass files, not rows.** Never paste a CSV into the conversation. Write the file, pass its path with `--file`, and read the summary.\n- **Read failures only.** If the summary\'s `failed`, `notFound` and `invalid` are 0, the work is done. Otherwise read just the problem rows from `results.csv` or `invalid.csv`.\n- **Follow `next`.** Every error with a known fix carries the exact command to run.\n- **Branch on the exit code:** 0 ok, 2 fix the command, 3 fix the key, 5 some rows failed, 6 wait or raise a limit, 130 resume.\n- **Look things up, do not guess.** `kenso describe <resource> <action>` prints any command\'s flags and body schema as JSON.\n- **Find, then look up.** `kenso discover` turns a plain request into the command, doc, skill or workflow step for it, offline, with the next command to run.\n- **See the cost first.** Every dry run of paid work prints `credits` with `needed`, `available` and `sufficient`. `kenso credits` reads the balance, usage and prices.\n\n## What a command does and what it costs\n\nEvery command declares its effect. Help and `kenso describe` print it, so an agent can tell a look from a change before it runs anything:\n\n| Effect | Meaning |\n|---|---|\n| `read` | Changes nothing and charges nothing |\n| `write` | Creates or changes workspace data. Charges nothing the API contract declares. Nothing leaves Kenso |\n| `spend` | Can charge credits under at least one of its flags |\n| `send` | Sends an email, a LinkedIn message, a call or an invitation, or starts or resumes sending |\n| `destructive` | Deletes, archives, removes or merges |\n\nA `write` is not proof that a command is free: the API contract does not mark every route that charges. The dry run\'s `credits` and estimate are the authority on what a command costs.\n\n- Command help prints `Effect: <effect>.` under the summary. A command that charges adds a `Cost:` line in credits, priced from your workspace\'s rate card; signed out or offline it shows both rate cards, labelled `rate card v1` and `rate card v2`. Work your plan bills another way reads `not charged in credits`. No price is typed into the CLI: it comes from the rate card or a dry run\'s estimate.\n- A command that spends, sends or deletes, and each command an agent starts with (`kenso doctor`, `kenso describe`, `kenso docs`, `kenso agent setup`, `kenso skill install`, `kenso auth login`), also prints `When:` (when to pick it) and `Next:` (what to run after it) under its description.\n- A command that only reads says `Read-only.` under its global flags line.\n- `kenso describe <resource> <action>` has the same `effect` and `cost` as JSON.\n- `kenso api`, `kenso mcp call` and `kenso runs resume` read `destructive`, because one call of theirs can do anything. Read-only mode judges each call on its own.\n\n```bash\nkenso describe email-finds create\nkenso email-finds create --help\n```\n\n### Read-only mode\n\nSet `KENSO_READ_ONLY=1`, or pass `--read-only`, while an agent looks into something: every command whose effect is not `read` is refused before it sends a request, with exit 2 and the code `read_only` (see [Output and errors](output-and-errors.md)). A POST that only reads still runs, and a GET that charges is refused. A dry run still prints its plan; the dry run of `bulk-update` and `bulk-delete` asks Kenso for a preview, which Kenso stores. `kenso api` has the effect of the route it calls, and on a route this CLI does not know only a `GET` runs. `kenso mcp call` runs `list_skills` and `load_skill` only.\n\n```bash\nKENSO_READ_ONLY=1 kenso contacts search --limit 1\nkenso --read-only describe email-finds create\n```\n\n## Find a command: kenso discover\n\n`kenso discover` searches every command, doc topic, skill and workflow step type this release has, with no network and no key. Each argument is one query: plain words, or `"<what you have> -> <what you need>"`.\n\n```bash\nkenso discover "linkedin url -> email"\nkenso discover "pause a campaign" "export leads" --kind command --limit 3\nkenso describe email-finds create\n```\n\nIt prints one object per query, `{"query", "hits", "more"}` (NDJSON when piped). Each hit has its `kind`, `id`, `summary`, `effect` (`read`, `write`, `spend`, `send` or `destructive`), `cost` (in credits, from your saved or the bundled rate card, or `null`) and `describe`, the exact command to run next. `--limit` is 5 by default and at most 10. A query with no hit prints an empty `hits` and exits 0. The index is built when the CLI is released, so a skill added since then shows up in the next release.\n\n## Credits\n\nPrices are in credits only, from your workspace\'s own rate card. A skill or a doc never states a price: ask the CLI.\n\n```bash\nkenso credits balance\nkenso credits rate-card --action email_found\nkenso credits quote --kind leads --count 200\nkenso credits usage --since 7d\nkenso credits usage --run <runId>\n```\n\n- `balance`: credits `available`, and where they come from.\n- `rate-card`: what each action costs on your card. Offline it prints the card saved in the last day, else the two bundled cards, labelled.\n- `quote`: an estimate before you run anything, as `credits` with `needed`, `available` and `sufficient`. `--kind` is `campaign`, `build`, `infra`, `accounts`, `leads` or `places`; `--workflow <id or file> --records <n>` prices a workflow run.\n- `usage`: the ledger, filtered by `--run`, `--workflow`, `--campaign`, `--action`, `--since` and `--until`, with the total on stderr. With no filter, this billing month\'s spend by category.\n- `limit` (beta) shows the workflow spend limits, and `savings` the work Kenso did without taking credits.\n\n## The token-saving pattern\n\nAdding 5,000 leads through the MCP sends every lead through the model, hundreds of thousands of tokens. Through the CLI it is two commands and two short JSON objects:\n\n```bash\nkenso contacts import --campaign 812 --file leads.csv --dry-run\nkenso contacts import --campaign 812 --file leads.csv --yes\n```\n\nThen, only if the summary shows failures:\n\n```bash\ngrep -E \'^[0-9]+,(failed|not_found|invalid),\' ~/.kenso/runs/r_tdi5cdnx/results.csv | head -50\n```\n\n## Environment variables\n\n| Variable | What it does |\n|---|---|\n| `KENSO_API_KEY` | The API key. Wins over any saved profile |\n| `KENSO_WORKSPACE_ID` | The workspace for every command. `--workspace` wins over it |\n| `KENSO_PROFILE` | The saved profile to use. `--profile` wins over it |\n| `KENSO_API_URL` | The API, default `https://api.ken.so` |\n| `KENSO_CONFIG_DIR` | Where the config file and cache live, default `~/.kenso` |\n| `KENSO_RUNS_DIR` | Where run folders live, default `<config dir>/runs` |\n| `KENSO_MCP_URL` | The MCP for `kenso mcp`, default `https://mcp.ken.so/mcp` |\n| `KENSO_READ_ONLY` | Set to `1` to refuse every command that is not a read, as `--read-only` does. Any value except empty, `0` or `false` turns it on |\n| `KENSO_AGENT_SESSION` | The agent session id: the full agent help, the update notice and the stale-skill notice each print once per session |\n| `KENSO_NO_UPDATE_NOTIFIER` | Set to `1` to turn off the "a newer kenso is out" line on stderr. A person at a terminal gets it after the weekly check; under a detected agent it comes from the last check, once per agent session, with no request. Never in CI |\n| `KENSO_NO_SKILL_NOTICE` | Set to `1` to turn off the line that says an installed skill is from an older kenso |\n\n## Cloud sandboxes\n\nCloud agents (Claude Code on the web, Codex cloud, Cursor background agents and similar) often run with a network allowlist. Allow:\n\n- `api.ken.so`: every command\n- `mcp.ken.so`: only `kenso mcp tools` and `kenso mcp call`\n- `registry.npmjs.org`: to install the CLI with npm\n\nStore the key as the platform\'s secret and expose it as `KENSO_API_KEY`. Run `kenso doctor` as the first command: it checks Node, the config, that the API is reachable, that the key works, and that the skills and the Kenso MCP server are set up for the agent. It exits 0 when the first four checks pass (the skill and MCP checks never change the exit code), and its `next` names the command to run.\n\n```bash\nkenso doctor\n```\n\nPoint the run folders at the workspace if the home folder does not persist between sessions: `KENSO_RUNS_DIR=./.kenso-runs`. Keep that folder out of git.\n\n## How Kenso knows an agent ran a command\n\nThe CLI checks these environment variables, in this order: `CLAUDECODE` and `CLAUDE_CODE_ENTRYPOINT` (Claude Code), `CODEX_SANDBOX` and `CODEX_THREAD_ID` (Codex), `CURSOR_AGENT` (Cursor), `GEMINI_CLI` (Gemini CLI), `OPENCODE` (OpenCode), then `AI_AGENT`, a free-form name any other agent can set. When one is set:\n\n- every request carries `X-Ken-Client: Kenso CLI via <agent>`, and writes carry `X-Ken-Actor: agent`, so Kenso shows the change as made by you through that agent;\n- help starts with `Agents: load the kenso skill first: kenso skill show kenso`;\n- the first help an agent reads in a session ends with the "For agents" block. After that the block is one line, `Agent rules: kenso --help --verbose (dry-run first, one command per file, next is the next command).`, and `kenso --help --verbose` always prints it in full;\n- browser login never opens a browser itself: it prints the link for you to open.\n\nA session is `KENSO_AGENT_SESSION` when that is set, else `CODEX_THREAD_ID`, else `CLAUDE_CODE_SESSION_ID`, else the agent\'s name and the current two-hour block of the day (UTC), so an agent that sets none of them reads the whole block again every two hours. The CLI keeps what it has shown in `session-seen.json` in the config folder (mode 0600) and forgets an entry after 7 days.\n\n`kenso doctor` shows the agent it detected.\n\n## MCP-only tools\n\nA few Kenso MCP tools have no API route, such as the skills Kenso\'s own agents use. Reach them from the shell with the same key:\n\n```bash\nkenso mcp tools\nkenso mcp call list_skills\nkenso mcp call load_skill --args \'{"name":"create-campaign"}\'\nkenso mcp call contacts_read --operation list --args \'{"limit":5}\'\n```\n\n`mcp call` prints the tool\'s structured result, else its text parsed as JSON, else the text. A tool error exits 1 with `mcp_tool_error`.\n';
|
|
9857
|
+
agents_default = '# Coding agents\n\nThe CLI is built to be driven by a coding agent: Claude Code, Codex, Cursor, Gemini CLI or anything else that runs shell commands. An agent learns it from the Agent Skill, `kenso --help` and `kenso describe`, and never needs these web pages.\n\n## Set up an agent in three steps\n\n1. Install the CLI where the agent runs: on macOS or Linux, the [install script](https://ken.so/install.sh) piped to `sh` needs no Node; anywhere, `npm i -g kenso` needs Node 22 or newer. Without a global install, `npx -y kenso@latest <command>` runs any command.\n2. Give it a key. Either set `KENSO_API_KEY` (and `KENSO_WORKSPACE_ID` when the key reaches several workspaces) in the agent\'s environment, or log in once on that machine:\n\n```bash\nkenso auth login\nkenso workspace use 1234\n```\n\n An agent with no key hands the login to you: `kenso login --no-wait` prints a link and a code without waiting, you open the link and approve, then the agent runs `kenso auth wait` to save the key. Under an agent, `kenso doctor` names `kenso login --no-wait` as the key check\'s `next`.\n\n3. Install the Agent Skill and connect the Kenso MCP server in one step, then check everything:\n\n```bash\nkenso agent setup\nkenso agent setup -y\nkenso doctor\n```\n\nTo hand the whole setup to an agent, give it [ken.so/get-started.md](https://ken.so/get-started.md): it runs these steps and stops only where a person has to act.\n\n## kenso agent setup\n\n`kenso agent setup` installs the `kenso` and `kenso-cli` skills (as `kenso skill install` does) and registers the Kenso MCP server, `https://mcp.ken.so/mcp`, with each coding agent:\n\n| Agent | `--client` | MCP server added with |\n|---|---|---|\n| Claude Code | `claude-code` | `claude mcp add --scope user --transport http kenso https://mcp.ken.so/mcp` |\n| Codex | `codex` | `codex mcp add kenso --url https://mcp.ken.so/mcp` |\n| Cursor | `cursor` | a `kenso` entry in `~/.cursor/mcp.json` |\n| Gemini CLI | `gemini` | `gemini mcp add --scope user --transport http kenso https://mcp.ken.so/mcp` |\n| OpenCode | `opencode` | a `kenso` entry in `~/.config/opencode/opencode.json` |\n\n```bash\nkenso agent setup --client claude-code -y\nkenso agent setup --client all -y\nkenso agent setup --status --json\n```\n\n- Without `--client`, it sets up the agent that runs it, else every agent found on the machine (its command on `PATH` or its config folder present).\n- Without `-y` it prints the plan and changes nothing; the plan\'s `next` applies it. `--status` reports, for every agent, the state of each bundled skill (`missing`, `current`, `stale` from an older kenso, or `edited` by hand) and whether the MCP server is `registered`, `missing`, in `conflict` or `unknown` (a config file it cannot read as JSON), and changes nothing. `--json` prints JSON on a terminal too.\n- An MCP entry with the Kenso URL under another name (such as `ken-ai` from the plugin) counts as registered, and nothing is added. A `kenso` entry pointing at another URL is left alone (`conflict`). A config file that is not plain JSON (it has comments) is left alone (`skipped`), and so is an agent whose command is not on `PATH`: their `next` is the command or edit to make by hand.\n- A missing `SKILL.md` and one an older kenso wrote are written. One edited by hand is left alone (`"status":"edited"`, with a stderr line naming `--force`) while the rest of the setup runs; `--force` replaces it. After a successful run, four requests to start with follow on stderr.\n- It exits 1 when any agent was not fully set up. The MCP server signs in with your Kenso account in the browser the first time the agent uses it; each agent\'s `next` says how (in Claude Code, `/mcp`).\n\n## An AGENTS.md section for your repo\n\nPaste this into the `AGENTS.md` (or `CLAUDE.md`) of a repo whose agents work in Kenso:\n\n```markdown\n## Kenso\n\n- Kenso is our outbound platform. One record or a question: use the Kenso MCP server (https://mcp.ken.so/mcp). A file or more than about 50 records: use the `kenso` CLI.\n- Setup: `npm i -g kenso`, `kenso auth login` (a person approves in the browser), `kenso agent setup -y`, `kenso doctor`.\n- Every write runs first with `--dry-run`; apply with the plan\'s `next`. Never put an API key in a flag, a file or the chat: use `KENSO_API_KEY`.\n- Code that calls the API: send `Authorization: Bearer $KENSO_API_KEY`, `Ken-Version` and `X-Ken-Workspace-Id`. Reference: ken.so/docs.md; the kenso-api skill is listed at ken.so/.well-known/skills/index.json.\n```\n\n## The Agent Skills\n\n`kenso skill install` writes the two skills bundled with this CLI, each one `SKILL.md` in a folder named like the skill, where each agent looks for skills:\n\n- `kenso`, the entry skill: it sends the agent to the Kenso skill for the job and sets the rules for the workspace, credits, sends and the final reply. Agents load it first; every help under an agent starts with `Agents: load the kenso skill first: kenso skill show kenso`.\n- `kenso-cli`: the CLI\'s commands for work from a file or over about 50 records.\n\n| Agent | `--client` | Folders |\n|---|---|---|\n| Claude Code | `claude-code` | `~/.claude/skills/kenso/`, `~/.claude/skills/kenso-cli/` |\n| Codex | `codex` | `~/.agents/skills/kenso/`, `~/.agents/skills/kenso-cli/` |\n| Cursor | `cursor` | `~/.cursor/skills/kenso/`, `~/.cursor/skills/kenso-cli/` |\n| Gemini CLI | `gemini` | `~/.gemini/skills/kenso/`, `~/.gemini/skills/kenso-cli/` |\n| OpenCode | `opencode` | `~/.config/opencode/skills/kenso/`, `~/.config/opencode/skills/kenso-cli/` |\n\nClaude Code\'s folders follow `CLAUDE_CONFIG_DIR` when that is set. Without `--client`, it installs for the agent that runs it when that is Claude Code, Codex or Cursor (detected from the environment, see below), else for all five. It prints what it wrote:\n\n```json\n{"installed":[{"client":"claude-code","path":"/home/you/.claude/skills/kenso-cli/SKILL.md","status":"created"},{"client":"claude-code","path":"/home/you/.claude/skills/kenso/SKILL.md","status":"created"}]}\n```\n\n```bash\nkenso skill install --client claude-code\nkenso skill install --client all\nkenso skill install --skill kenso\nkenso skill install --dir .claude/skills/kenso-cli\nkenso skill install --force\n```\n\n- `--skill <name>` installs one of the two. `--dir` writes one skill into that folder instead (`--skill`, else `kenso-cli`), for example a project\'s own skills folder. Name the folder like the skill, as agents expect.\n- A missing file is written (`"status":"created"`) and one an older kenso wrote is replaced (`"status":"updated"`); the same file is left as it is (`"status":"unchanged"`). A `SKILL.md` edited by hand is left alone (`"status":"edited"`) with a stderr line that names `--force`, and the command still exits 0. `--force` replaces it (`"status":"replaced"`).\n- `--dry-run` writes nothing and exits 0. It prints each target\'s status and a `next` that applies it.\n- Under a detected agent, when a bundled skill in that agent\'s folder is from an older kenso, a command ends with one stderr line, once per agent session: `The installed <name> skill is from an older kenso: kenso skill install`. It reads the files only, and nothing is replaced until you run `kenso skill install` or `kenso agent setup`. `KENSO_NO_SKILL_NOTICE=1` turns it off.\n- Cursor also reads `~/.claude/skills/` and `~/.agents/skills/` (Gemini CLI and OpenCode read `~/.agents/skills/` too), so after a default install for all of them an agent may list each Kenso skill more than once. To avoid that, install with `--client cursor` only, or remove the copies you do not need.\n\nBoth skills also ship in the Kenso plugin for Claude Code (`Ken-Technology/ken-ai-plugin`), so `npx skills add Ken-Technology/ken-ai-plugin` installs them along with the MCP skills; the plugin\'s copies are these files byte for byte. The other Kenso skills come from the MCP: list them, and read any of them without installing it:\n\n```bash\nkenso skill list\nkenso skill show kenso\nkenso skill show workflows --reference files.md\n```\n\n`kenso skill show` prints `kenso` and `kenso-cli` from the CLI itself, with no network and no sign-in. Any other skill is read from the Kenso MCP with your key.\n\n## Rules the skill teaches\n\n- **Data is on stdout, as JSON when piped.** Progress, warnings and errors are on stderr. Parse stdout; read stderr when the exit code is not 0.\n- **Plan, then apply.** Run a write with `--dry-run`, read the plan, then run the exact command in its `next` (the same command with `--yes`). A command with no dry run refuses `--dry-run` with `usage_error` and does nothing.\n- **Pass files, not rows.** Never paste a CSV into the conversation. Write the file, pass its path with `--file`, and read the summary.\n- **Read failures only.** If the summary\'s `failed`, `notFound` and `invalid` are 0, the work is done. Otherwise read just the problem rows from `results.csv` or `invalid.csv`.\n- **Follow `next`.** Every error with a known fix carries the exact command to run.\n- **Branch on the exit code:** 0 ok, 2 fix the command, 3 fix the key, 5 some rows failed, 6 wait or raise a limit, 130 resume.\n- **Look things up, do not guess.** `kenso describe <resource> <action>` prints any command\'s flags and body schema as JSON.\n- **Find, then look up.** `kenso discover` turns a plain request into the command, doc, skill or workflow step for it, offline, with the next command to run.\n- **See the cost first.** The dry run of every `spend` command, one call or an `--each` file, and of `kenso workflows run` prints `credits` with `needed`, `available` and `sufficient`, each `null` when the CLI cannot read or price it. A generated command has a `needed` only where one call charges one unit (an email find, a place opened): its rate-card price times the calls. Every other generated spend prints `needed: null`, because the API decides how many units one call charges (an AI run charges each contact of the campaign). `null` is unknown, never free. A dry run without a key still prints its plan, with `available: null`. `kenso credits` reads the balance, usage and prices.\n\n## What a command does and what it costs\n\nEvery command declares its effect. Help and `kenso describe` print it, so an agent can tell a look from a change before it runs anything:\n\n| Effect | Meaning |\n|---|---|\n| `read` | Changes nothing and charges nothing |\n| `write` | Creates or changes workspace data. Charges nothing the API contract declares. Nothing leaves Kenso |\n| `spend` | Can charge credits under at least one of its flags |\n| `send` | Sends an email, a LinkedIn message, a call or an invitation, or starts or resumes sending |\n| `destructive` | Deletes, archives, removes or merges |\n\nA `write` or a `send` is not proof that a command is free: the API contract does not mark every route that charges, and `kenso workflows run` is a `send` that charges for the workflow\'s steps. The dry run\'s `credits` and estimate are the authority on what a command costs.\n\n- Command help prints `Effect: <effect>.` under the summary. A command that charges adds a `Cost:` line in credits, priced from your workspace\'s rate card; signed out or offline it shows both rate cards, labelled `rate card v1` and `rate card v2`. Work your plan bills another way reads `not charged in credits`. No price is typed into the CLI: it comes from the rate card or a dry run\'s estimate.\n- A command that spends, sends or deletes, and each command an agent starts with (`kenso doctor`, `kenso describe`, `kenso docs`, `kenso agent setup`, `kenso skill install`, `kenso auth login`), also prints `When:` (when to pick it) and `Next:` (what to run after it) under its description.\n- A command that only reads says `Read-only.` under its global flags line.\n- `kenso describe <resource> <action>` has the same `effect` and `cost` as JSON. `cost` is `null` only for a command that declares no charge; a hand-written command that says what it charges has it as `cost.text`, whatever its effect.\n- `kenso api`, `kenso mcp call` and `kenso runs resume` read `destructive`, because one call of theirs can do anything. Read-only mode judges each call on its own.\n\n```bash\nkenso describe email-finds create\nkenso email-finds create --help\n```\n\n### Read-only mode\n\nSet `KENSO_READ_ONLY=1`, or pass `--read-only`, while an agent looks into something: every command whose effect is not `read` is refused before it sends a request, with exit 2 and the code `read_only` (see [Output and errors](output-and-errors.md)). A POST that only reads still runs, and a GET that charges is refused. A dry run still prints its plan; the dry run of `bulk-update` and `bulk-delete` asks Kenso for a preview, which Kenso stores. `kenso api` has the effect of the route it calls, and on a route this CLI does not know only a `GET` runs. `kenso mcp call` runs `list_skills` and `load_skill` only.\n\n```bash\nKENSO_READ_ONLY=1 kenso contacts search --limit 1\nkenso --read-only describe email-finds create\n```\n\n## Find a command: kenso discover\n\n`kenso discover` searches every command, doc topic, skill and workflow step type this release has, with no network and no key. Each argument is one query: plain words, or `"<what you have> -> <what you need>"`.\n\n```bash\nkenso discover "linkedin url -> email"\nkenso discover "pause a campaign" "export leads" --kind command --limit 3\nkenso describe email-finds create\n```\n\nIt prints one object per query, `{"query", "hits", "more"}` (NDJSON when piped). Each hit has its `kind`, `id`, `summary`, `effect` (`read`, `write`, `spend`, `send` or `destructive`), `cost` (in credits, from your saved or the bundled rate card, or `null`) and `describe`, the exact command to run next. `--limit` is 5 by default and at most 10. A query with no hit prints an empty `hits` and exits 0. The index is built when the CLI is released, so a skill added since then shows up in the next release.\n\n## Credits\n\nPrices are in credits only, from your workspace\'s own rate card. A skill or a doc never states a price: ask the CLI.\n\n```bash\nkenso credits balance\nkenso credits rate-card --action email_found\nkenso credits quote --kind leads --count 200\nkenso credits usage --since 7d\nkenso credits usage --run <runId>\n```\n\n- `balance`: credits `available`, and where they come from.\n- `rate-card`: what each action costs on your card. Offline it prints the card saved in the last day, else the two bundled cards, labelled.\n- `quote`: an estimate before you run anything, as `credits` with `needed`, `available` and `sufficient`. `--kind` is `campaign`, `build`, `infra`, `accounts`, `leads` or `places`; `--workflow <id or file> --records <n>` prices a workflow run.\n- `usage`: the ledger, filtered by `--run`, `--workflow`, `--campaign`, `--action`, `--since` and `--until`, with the total on stderr. With no filter, this billing month\'s spend by category.\n- `limit` (beta) shows the workflow spend limits, and `savings` the work Kenso did without taking credits.\n\n## The token-saving pattern\n\nAdding 5,000 leads through the MCP sends every lead through the model, hundreds of thousands of tokens. Through the CLI it is two commands and two short JSON objects:\n\n```bash\nkenso contacts import --campaign 812 --file leads.csv --dry-run\nkenso contacts import --campaign 812 --file leads.csv --yes\n```\n\nThen, only if the summary shows failures:\n\n```bash\ngrep -E \'^[0-9]+,(failed|not_found|invalid),\' ~/.kenso/runs/r_tdi5cdnx/results.csv | head -50\n```\n\n## Environment variables\n\n| Variable | What it does |\n|---|---|\n| `KENSO_API_KEY` | The API key. Wins over any saved profile |\n| `KENSO_WORKSPACE_ID` | The workspace for every command. `--workspace` wins over it |\n| `KENSO_PROFILE` | The saved profile to use. `--profile` wins over it |\n| `KENSO_API_URL` | The API, default `https://api.ken.so` |\n| `KENSO_CONFIG_DIR` | Where the config file and cache live, default `~/.kenso` |\n| `KENSO_RUNS_DIR` | Where run folders live, default `<config dir>/runs` |\n| `KENSO_MCP_URL` | The MCP for `kenso mcp`, default `https://mcp.ken.so/mcp` |\n| `KENSO_READ_ONLY` | Set to `1` to refuse every command that is not a read, as `--read-only` does. Any value except empty, `0` or `false` turns it on |\n| `KENSO_AGENT_SESSION` | The agent session id: the full agent help, the update notice and the stale-skill notice each print once per session |\n| `KENSO_NO_UPDATE_NOTIFIER` | Set to `1` to turn off the "a newer kenso is out" line on stderr. A person at a terminal gets it after the weekly check; under a detected agent it comes from the last check, once per agent session, with no request. Never in CI |\n| `KENSO_NO_SKILL_NOTICE` | Set to `1` to turn off the line that says an installed skill is from an older kenso |\n\n## Cloud sandboxes\n\nCloud agents (Claude Code on the web, Codex cloud, Cursor background agents and similar) often run with a network allowlist. Allow:\n\n- `api.ken.so`: every command\n- `mcp.ken.so`: only `kenso mcp tools` and `kenso mcp call`\n- `registry.npmjs.org`: to install the CLI with npm\n\nStore the key as the platform\'s secret and expose it as `KENSO_API_KEY`. Run `kenso doctor` as the first command: it checks Node, the config, that the API is reachable, that the key works, and that the skills and the Kenso MCP server are set up for the agent. It exits 0 when the first four checks pass (the skill and MCP checks never change the exit code), and its `next` names the command to run.\n\n```bash\nkenso doctor\n```\n\nPoint the run folders at the workspace if the home folder does not persist between sessions: `KENSO_RUNS_DIR=./.kenso-runs`. Keep that folder out of git.\n\n## How Kenso knows an agent ran a command\n\nThe CLI checks these environment variables, in this order: `CLAUDECODE` and `CLAUDE_CODE_ENTRYPOINT` (Claude Code), `CODEX_SANDBOX` and `CODEX_THREAD_ID` (Codex), `CURSOR_AGENT` (Cursor), `GEMINI_CLI` (Gemini CLI), `OPENCODE` (OpenCode), then `AI_AGENT`, a free-form name any other agent can set. When one is set:\n\n- every request carries `X-Ken-Client: Kenso CLI via <agent>`, and writes carry `X-Ken-Actor: agent`, so Kenso shows the change as made by you through that agent;\n- help starts with `Agents: load the kenso skill first: kenso skill show kenso`;\n- the first help an agent reads in a session ends with the "For agents" block. After that the block is one line, `Agent rules: kenso --help --verbose (dry-run first, one command per file, next is the next command).`, and `kenso --help --verbose` always prints it in full;\n- browser login never opens a browser itself: it prints the link for you to open.\n\nA session is `KENSO_AGENT_SESSION` when that is set, else `CODEX_THREAD_ID`, else `CLAUDE_CODE_SESSION_ID`, else the agent\'s name and the current two-hour block of the day (UTC), so an agent that sets none of them reads the whole block again every two hours. The CLI keeps what it has shown in `session-seen.json` in the config folder (mode 0600) and forgets an entry after 7 days.\n\n`kenso doctor` shows the agent it detected.\n\n## MCP-only tools\n\nA few Kenso MCP tools have no API route, such as the skills Kenso\'s own agents use. Reach them from the shell with the same key:\n\n```bash\nkenso mcp tools\nkenso mcp call list_skills\nkenso mcp call load_skill --args \'{"name":"create-campaign"}\'\nkenso mcp call contacts_read --operation list --args \'{"limit":5}\'\n```\n\n`mcp call` prints the tool\'s structured result, else its text parsed as JSON, else the text. A tool error exits 1 with `mcp_tool_error`.\n';
|
|
9770
9858
|
}
|
|
9771
9859
|
});
|
|
9772
9860
|
|
|
@@ -9798,7 +9886,7 @@ var init_connect = __esm({
|
|
|
9798
9886
|
var crm_default;
|
|
9799
9887
|
var init_crm = __esm({
|
|
9800
9888
|
"docs/crm.md"() {
|
|
9801
|
-
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 or by a filter, 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 or by a filter, 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| `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 (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), or `--all`. 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\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`, `--all`, `--exclude-ids`) 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 of accounts for 30 days: each account still deleted is restored, as `kenso accounts restore` restores it. A delete of people or deals is not undone.\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## 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. 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`.\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 --note-id 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\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, and works on deal fields only.\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. `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';
|
|
9889
|
+
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 or by a filter, 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 or by a filter, 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| `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), or `--all`. 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\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`, `--all`, `--exclude-ids`) 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 of accounts for 30 days: each account still deleted is restored, as `kenso accounts restore` restores it. A delete of people or deals is not undone.\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## 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. 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`.\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 --note-id 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. `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';
|
|
9802
9890
|
}
|
|
9803
9891
|
});
|
|
9804
9892
|
|
|
@@ -9870,7 +9958,7 @@ var init_workflows = __esm({
|
|
|
9870
9958
|
var SKILL_default;
|
|
9871
9959
|
var init_SKILL = __esm({
|
|
9872
9960
|
"skill/kenso/SKILL.md"() {
|
|
9873
|
-
SKILL_default = '---\nname: kenso\ndescription: "Use for any outbound work in Kenso: leads, lists, campaigns, sequences, replies, accounts, signals, workflows, Studio, sending setup, reporting. Routes to the Kenso skill for the job and sets the rules for workspace, spend, sends and the final reply."\n---\n\n# Kenso: start here\n\nThis skill comes first for any work in Kenso. It sends you to the skill for the job and sets the rules every other Kenso skill follows: the workspace, spend, sends and the final reply. When another skill says "the spend rules", it means section 5 below.\n\n## 1. First\n\n```bash\nkenso doctor\nkenso whoami\nkenso workspace list\nkenso credits balance\n```\n\n- `kenso doctor` checks the CLI, the key, the skills and the MCP. When a check fails, run its `next` before anything else.\n- `kenso whoami` shows the workspace this folder and key use (`activeWorkspace`, with its `id` and `name`) and where it comes from (`workspaceSource`); `kenso workspace list` lists every workspace the key reaches. Before any change, tell the person: "I will work in <name> (<id>)."\n- `kenso credits balance` shows the credits `available`. Read it before you plan anything that charges.\n\n## 2. The loop\n\n```bash\nkenso discover "find work emails for a list of people"\nkenso describe email-finds create\n```\n\n1. `kenso discover` with the request in plain words finds the command, doc, skill or workflow step for it, offline. Each hit has its `effect` (read, write, spend, send or destructive), its cost line and the `describe` command to run next.\n2. `kenso describe <resource> <action>` prints the command\'s flags, body, `effect` and `cost` as JSON.\n3. Run it with `--dry-run` and read the plan: what it would send and, for paid work, `credits` with `needed`, `available` and `sufficient`.\n4. Run it for real only as the rules below allow, with the plan\'s `next`.\n\nWhile you only look around, set `KENSO_READ_ONLY=1`: any command that is not a read is then refused before it sends anything, and a `--dry-run` still prints its plan.\n\n## 3. Which skill\n\nLoad a skill with `kenso skill show` and its name, for example `kenso skill show workflows`, or with `load_skill` through the Kenso MCP. `kenso skill list` shows the ones this workspace can use.\n\n| Need | Skill |\n|---|---|\n| Count my market, size it and build the list | `tam-builder` |\n| People-search filters for a campaign | `ken-search` |\n| Build a campaign from an ICP and an offer, to launch-ready | `create-campaign` |\n| Why a campaign is up or down; my best and worst campaign | `campaign-diagnosis` |\n| Fix the email that is not working in a live campaign | `campaign-improvement` |\n| Go through replies, draft answers, offer meeting times | `reply-handling` |\n| What needs my attention: what failed, stalled or came out wrong, and what to fix first | `kenso-triage` |\n| My Today queue: the touches due today, to draft, snooze or skip | `today-review` |\n| Bounces up or sends dropped | `deliverability-guard` |\n| Sending setup: inboxes, domains, LinkedIn accounts, the link host | `delivery-setup` |\n| Connect my own sending domains | `connect-domains` |\n| Review or order sending domains | `domain-selection` |\n| Inbox limits, display names, signatures, reply forwarding | `inbox-configuration` |\n| How many domains and inboxes I need | `infra-planning` |\n| Set up a new workspace | `setup-workspace` |\n| Sign up from the agent, with no workspace yet | `onboarding-signup` |\n| Company, offer and voice files in Knowledge | `knowledge-setup` |\n| Edit the skills in Knowledge > Skills | `skill-editor` |\n| Target accounts: add, research, map who buys, plan touches | `accounts` |\n| A one-page brief on an account before a call | `account-brief` |\n| Hiring, funding, job changes, website visits or replies that start outreach | `signals` |\n| Outreach around a conference or trade show | `event-outbound` |\n| A job opening turned into a candidate campaign | `role-intake` |\n| Someone\'s social profiles and recent posts | `social-data` |\n| Build, test and run a workflow, as a file or in the app | `workflows` |\n| Build or edit a Studio template | `studio-template` |\n| Fill a Studio page for an account or a candidate | `studio-asset` |\n| Prep for a call, then follow it up | `meeting-prep-and-followup` |\n| A MEDDIC summary of a call | `meddic-summary` |\n| The objections raised on a call | `objection-log` |\n| The next-steps email after a call | `next-step-email` |\n| The handoff to the AE after a call | `handoff-to-ae` |\n| Open deals by stage, and the stuck ones | `pipeline-review` |\n| The weekly or monthly results report | `report` |\n| The person asks for the start interview | `kenso-start` |\n\n**CLI or MCP.** Use the CLI for work from a file, or on more than about 50 records: imports, updates, exports and workflow runs. The kenso-cli skill has those commands; `kenso agent setup` installs it beside this one. For one record or a question, the MCP is fine.\n\n**What to offer.** Look first:\n\n```bash\nkenso campaigns list --limit 5\n```\n\nA workspace with campaigns: offer "Diagnose my best and worst campaign" (`campaign-diagnosis`) and "Triage today\'s replies" (`reply-handling`). A new workspace: offer the starter menu.\n\n1. Count my market: how many companies and people match my ICP?\n2. Check my sending setup and tell me what to fix before I launch.\n3. Draft a campaign for my company from my website and show it to me before anything is sent.\n4. Tell me what you want to get done.\n\nThey lead to `tam-builder`, `delivery-setup` and `create-campaign`; for the fourth, find the skill in the table or run `kenso discover` with the person\'s words.\n\n## 4. Workspace\n\nName the workspace before the first change, and again whenever it changes. A yes that does not name the workspace is not a yes: ask again, with its name. Under a coding agent, every command that is not a read prints `workspace: <id> (<source>)` on stderr: stop when it is not the workspace the person approved. A `kenso.json` in a folder holds that folder\'s workspace.\n\n## 5. Spend\n\nThese rules hold in every Kenso skill.\n\n- A bounded request ("find emails for these 200 people") covers that scope and nothing wider. An open one ("find me leads") needs a row count and a budget from the person first.\n- Sample first. When a paid step covers more than 25 records, or the estimate\'s `credits.needed` is over 10, run 3 to 5 records first, show the result and the projected cost of the rest, and ask before the rest. These four numbers are thresholds of this contract, not prices.\n- Prices come from a `--dry-run`, `kenso credits quote` or `kenso credits rate-card`, never from memory or from a skill.\n- `Effect: write.` in a command\'s help is not proof that it is free: not every route that charges is marked. The dry run or `kenso credits quote` is the authority.\n- Ask once, with one approval block, and wait for the yes:\n\n```text\nPlan: <what will run>\nRecords: <how many, and from where>\nEstimate: <needed> of <available> available credits (from the dry run)\nCap: --max-credits <the cap you will set>\nReply yes to run it.\n```\n\n- On `kenso workflows run`, always set `--max-credits` to the cap in the approval block.\n- Out of credits (`sufficient: false` in the plan, or a run that stops because the credits ran out): stop, show what finished, and give the billing link, https://app.ken.so/<workspace id>/settings/billing. Never retry in a loop.\n\n```bash\nkenso credits quote --kind leads --count 200\nkenso credits rate-card --action email_found\n```\n\n## 6. Sends\n\nSends, launches, CRM writes and schedule changes need a yes that names the campaign or the record set ("launch campaign 812", "update these 40 deals in the CRM"). A yes to a plan is not a yes to send. A delete, archive or remove runs with `--yes` only after the person said yes to that delete.\n\n## 7. Workflows, signals and tools\n\n- A **workflow** is a saved set of steps that runs on each record (an account, a person, a lead), started by hand, on a schedule or by a signal. The `workflows` skill builds one; its file loop is `kenso skill show workflows --reference files.md`.\n- A **signal** is an event that starts a workflow: hiring, funding, a job change, a website visit, a reply. `kenso signals types` lists them; the `signals` skill watches for them.\n- A **tool** is one command you run yourself (`kenso discover` finds it) or one MCP operation.\n\nThe first run of a workflow template is five commands: `init --template`, `push`, `test`, `push --publish --expected-hash` with the hash `test` printed, and `run`. Check the file after every edit, and dry-run the run before the paid one:\n\n```bash\nkenso workflow-templates list\nkenso workflows init qualify --template <templateKey>\nkenso workflows push qualify.workflow.json\nkenso workflows check qualify.workflow.json --mode publish\nkenso workflows test qualify.workflow.json --record account:<accountId>\nkenso workflows push qualify.workflow.json --publish --expected-hash <definitionHash>\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits <cap> --dry-run\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits <cap> --wait --out results.csv --yes\n```\n\n## 8. Your own agent plan: kenso work\n\nWhere your workspace has it, `kenso work` runs Kenso AI steps on your own Claude or Codex plan at 0 Kenso AI credits. Check with `kenso work status`: it lists what waits for your agent, and answers `not_found` when the workspace does not have it yet. When most of an estimate is AI steps, name this to the person as an option before they approve.\n\n```bash\nkenso work status\n```\n\n## 9. The final reply\n\nEnd every job with this reply, in this order:\n\n```text\nOutcome: <what ran, on how many records, what it produced>\nMisses: <count and reason for each kind of miss, or none>\nLinks: <the app page> and <the results file>\nCredits spent: <from the run summary\'s creditsCharged, or kenso credits usage --run <runId>>\nNext: <the one next step you recommend>\n```\n\n## No Kenso account yet\n\nThese steps run on the Kenso MCP server, which signs in with a Kenso account. If the user has none, send them to https://app.ken.so/get-started to create one, then sign in when the agent asks.\n';
|
|
9961
|
+
SKILL_default = '---\nname: kenso\ndescription: "Use for any outbound work in Kenso: leads, lists, campaigns, sequences, replies, accounts, signals, workflows, Studio, sending setup, reporting. Routes to the Kenso skill for the job and sets the rules for workspace, spend, sends and the final reply."\n---\n\n# Kenso: start here\n\nThis skill comes first for any work in Kenso. It sends you to the skill for the job and sets the rules every other Kenso skill follows: the workspace, spend, sends and the final reply. When another skill says "the spend rules", it means section 5 below.\n\n## 1. First\n\n```bash\nkenso doctor\nkenso whoami\nkenso workspace list\nkenso credits balance\n```\n\n- `kenso doctor` checks the CLI, the key, the skills and the MCP. When a check fails, run its `next` before anything else.\n- No key, or `key_valid` failed: hand the sign-in to the person. `kenso login --no-wait` prints a link and a code; give both to the person, and once they say they approved it, run `kenso auth wait`.\n- `kenso whoami` shows the workspace this folder and key use (`activeWorkspace`, with its `id` and `name`) and where it comes from (`workspaceSource`); `kenso workspace list` lists every workspace the key reaches. Before any change, tell the person: "I will work in <name> (<id>)."\n- `kenso credits balance` shows the credits `available`. Read it before you plan anything that charges.\n\n## 2. The loop\n\n```bash\nkenso discover "find work emails for a list of people"\nkenso describe email-finds create\n```\n\n1. `kenso discover` with the request in plain words finds the command, doc, skill or workflow step for it, offline. Each hit has its `effect` (read, write, spend, send or destructive), its cost line and the `describe` command to run next.\n2. `kenso describe <resource> <action>` prints the command\'s flags, body, `effect` and `cost` as JSON.\n3. Run it with `--dry-run` and read the plan: what it would send and, for paid work, `credits` with `needed`, `available` and `sufficient` (`null` where the CLI could not read or price it). A `null` `needed` is unknown, never free: ask before you run it.\n4. Run it for real only as the rules below allow, with the plan\'s `next`.\n\nWhile you only look around, set `KENSO_READ_ONLY=1`: any command that is not a read is then refused before it sends anything, and a `--dry-run` still prints its plan.\n\n## 3. Which skill\n\nLoad a skill with `kenso skill show` and its name, for example `kenso skill show workflows`, or with `load_skill` through the Kenso MCP. `kenso skill list` shows the ones this workspace can use.\n\n| Need | Skill |\n|---|---|\n| Count my market, size it and build the list | `tam-builder` |\n| People-search filters for a campaign | `ken-search` |\n| Build a campaign from an ICP and an offer, to launch-ready | `create-campaign` |\n| Why a campaign is up or down; my best and worst campaign | `campaign-diagnosis` |\n| Fix the email that is not working in a live campaign | `campaign-improvement` |\n| Go through replies, draft answers, offer meeting times | `reply-handling` |\n| What needs my attention: what failed, stalled or came out wrong, and what to fix first | `kenso-triage` |\n| My Today queue: the touches due today, to draft, snooze or skip | `today-review` |\n| Bounces up or sends dropped | `deliverability-guard` |\n| Sending setup: inboxes, domains, LinkedIn accounts, the link host | `delivery-setup` |\n| Connect my own sending domains | `connect-domains` |\n| Review or order sending domains | `domain-selection` |\n| Inbox limits, display names, signatures, reply forwarding | `inbox-configuration` |\n| How many domains and inboxes I need | `infra-planning` |\n| Set up a new workspace | `setup-workspace` |\n| Sign up from the agent, with no workspace yet | `onboarding-signup` |\n| Company, offer and voice files in Knowledge | `knowledge-setup` |\n| Edit the skills in Knowledge > Skills | `skill-editor` |\n| Target accounts: add, research, map who buys, plan touches | `accounts` |\n| A one-page brief on an account before a call | `account-brief` |\n| Hiring, funding, job changes, website visits or replies that start outreach | `signals` |\n| Outreach around a conference or trade show | `event-outbound` |\n| A job opening turned into a candidate campaign | `role-intake` |\n| Someone\'s social profiles and recent posts | `social-data` |\n| Build, test and run a workflow, as a file or in the app | `workflows` |\n| Build or edit a Studio template | `studio-template` |\n| Fill a Studio page for an account or a candidate | `studio-asset` |\n| Prep for a call, then follow it up | `meeting-prep-and-followup` |\n| A MEDDIC summary of a call | `meddic-summary` |\n| The objections raised on a call | `objection-log` |\n| The next-steps email after a call | `next-step-email` |\n| The handoff to the AE after a call | `handoff-to-ae` |\n| Open deals by stage, and the stuck ones | `pipeline-review` |\n| The weekly or monthly results report | `report` |\n| The person asks for the start interview | `kenso-start` |\n\n**CLI or MCP.** Use the CLI for work from a file, or on more than about 50 records: imports, updates, exports and workflow runs. The kenso-cli skill has those commands; `kenso agent setup` installs it beside this one. For one record or a question, the MCP is fine.\n\n**What to offer.** Look first:\n\n```bash\nkenso campaigns list --limit 5\n```\n\nA workspace with campaigns: offer "Diagnose my best and worst campaign" (`campaign-diagnosis`) and "Triage today\'s replies" (`reply-handling`). A new workspace: offer the starter menu.\n\n1. Count my market: how many companies and people match my ICP?\n2. Check my sending setup and tell me what to fix before I launch.\n3. Draft a campaign for my company from my website and show it to me before anything is sent.\n4. Tell me what you want to get done.\n\nThey lead to `tam-builder`, `delivery-setup` and `create-campaign`; for the fourth, find the skill in the table or run `kenso discover` with the person\'s words.\n\n## 4. Workspace\n\nName the workspace before the first change, and again whenever it changes. A yes that does not name the workspace is not a yes: ask again, with its name. Under a coding agent, every command that is not a read prints `workspace: <id> (<source>)` on stderr: stop when it is not the workspace the person approved. A `kenso.json` in a folder holds that folder\'s workspace.\n\n## 5. Spend\n\nThese rules hold in every Kenso skill.\n\n- A bounded request ("find emails for these 200 people") covers that scope and nothing wider. An open one ("find me leads") needs a row count and a budget from the person first.\n- Sample first. When a paid step covers more than 25 records, or the estimate\'s `credits.needed` is over 10, run 3 to 5 records first, show the result and the projected cost of the rest, and ask before the rest. These four numbers are thresholds of this contract, not prices.\n - A workflow samples on the full ids file, never on a separate file of a few ids, which the full run would start again: `kenso workflows run` with a `--max-credits` that covers 3 to 5 records starts only those. After the yes, run the same command with only `--max-credits` changed: it stops with `already_started`, and its `next` runs only the records the sample did not start.\n - Any other paid batch: sample with a file of 3 to 5 rows, then run the rest from a file without them.\n- Prices come from a `--dry-run`, `kenso credits quote` or `kenso credits rate-card`, never from memory or from a skill.\n- `Effect: write.` or `Effect: send.` in a command\'s help is not proof that it is free: not every route that charges is marked, and `kenso workflows run` is a send that charges for its steps. The dry run or `kenso credits quote` is the authority.\n- Ask once, with one approval block, and wait for the yes:\n\n```text\nPlan: <what will run>\nRecords: <how many, and from where>\nEstimate: <needed> of <available> available credits (from the dry run)\nCap: --max-credits <the cap you will set>\nReply yes to run it.\n```\n\n- On `kenso workflows run`, always set `--max-credits` to the cap in the approval block.\n- Out of credits (`sufficient: false` in the plan, or a run that stops because the credits ran out): stop, show what finished, and give the billing link, https://app.ken.so/<workspace id>/settings/billing. Never retry in a loop.\n\n```bash\nkenso credits quote --kind leads --count 200\nkenso credits rate-card --action email_found\n```\n\n## 6. Sends\n\nSends, launches, CRM writes and schedule changes need a yes that names the campaign or the record set ("launch campaign 812", "update these 40 deals in the CRM"). A yes to a plan is not a yes to send. A delete, archive or remove runs with `--yes` only after the person said yes to that delete.\n\n## 7. Workflows, signals and tools\n\n- A **workflow** is a saved set of steps that runs on each record (an account, a person, a lead), started by hand, on a schedule or by a signal. The `workflows` skill builds one; its file loop is `kenso skill show workflows --reference files.md`.\n- A **signal** is an event that starts a workflow: hiring, funding, a job change, a website visit, a reply. `kenso signals types` lists them; the `signals` skill watches for them.\n- A **tool** is one command you run yourself (`kenso discover` finds it) or one MCP operation.\n\nThe first run of a workflow template is five commands: `init --template`, `push`, `test`, `push --publish --expected-hash` with the hash `test` printed, and `run`. Check the file after every edit, and dry-run the run before the paid one:\n\n```bash\nkenso workflow-templates list\nkenso workflows init qualify --template <templateKey>\nkenso workflows push qualify.workflow.json\nkenso workflows check qualify.workflow.json --mode publish\nkenso workflows test qualify.workflow.json --record account:<accountId>\nkenso workflows push qualify.workflow.json --publish --expected-hash <definitionHash>\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits <cap> --dry-run\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits <cap> --wait --out results.csv --yes\n```\n\n## 8. Your own agent plan: kenso work\n\nWhere your workspace has it, `kenso work` runs Kenso AI steps on your own Claude or Codex plan at 0 Kenso AI credits. Check with `kenso work status`: it lists what waits for your agent, and answers `not_found` when the workspace does not have it yet. When most of an estimate is AI steps, name this to the person as an option before they approve.\n\n```bash\nkenso work status\n```\n\n## 9. The final reply\n\nEnd every job with this reply, in this order:\n\n```text\nOutcome: <what ran, on how many records, what it produced>\nMisses: <count and reason for each kind of miss, or none>\nLinks: <the app page> and <the results file>\nCredits spent: <from the run summary\'s creditsCharged, or kenso credits usage --run <runId>>\nNext: <the one next step you recommend>\n```\n\n## No Kenso account yet\n\nThese steps run on the Kenso MCP server, which signs in with a Kenso account. If the user has none, send them to https://app.ken.so/get-started to create one, then sign in when the agent asks.\n';
|
|
9874
9962
|
}
|
|
9875
9963
|
});
|
|
9876
9964
|
|
|
@@ -9878,7 +9966,7 @@ var init_SKILL = __esm({
|
|
|
9878
9966
|
var SKILL_default2;
|
|
9879
9967
|
var init_SKILL2 = __esm({
|
|
9880
9968
|
"skill/kenso-cli/SKILL.md"() {
|
|
9881
|
-
SKILL_default2 = '---\nname: kenso-cli\ndescription: The Kenso CLI (kenso) for work from a file (of any size, even a few ids) or over about 50 records - import, update, remove (delete), pause, tag or export leads, import CRM accounts and people, edit Studio templates as local files and fill them, run an API operation per file row, resume an interrupted run, write the Kenso AI work a workspace gave to its own coding agent (My agent, with kenso work run, or work pull and submit with subagents), sign in with a key from a variable (pipe it to kenso auth login --with-key, no check first). For records listed in the message (under about 50), one record or a question, use the Kenso MCP.\n---\n\n1. Every write runs first with `--dry-run`; apply with the plan\'s `next` (a delete, archive or remove applies with `--yes`). `--yes` at once only to continue an interrupted run or apply what the person confirmed. A command with no dry run refuses `--dry-run` (exit 2, nothing ran): read its `--help`, then run it without.\n2. Many rows: one command on the file as it is (`--file`, `--ids`, `--each`). Run kenso only: no python, awk or shell tests, not even on a file or variable.\n3. Any output\'s `next` is the command to run; errors are JSON on stderr. `--force` only with the person\'s OK.\n4. Ids are flags: `--campaign-id 812` (or `--campaign 812`, the same flag). `--workspace <id>`; by name `kenso workspace list --search acme`. `--json` is `-o json`; `--query` takes JMESPath (there is no `--jq`). Other commands: `kenso --help`; `kenso api <METHOD> <path>` only when none fits.\n\n```bash\nkenso contacts import --campaign 812 --file leads.csv --dry-run # skips leads already in; --map \'{"Pain": "customVariables.pain_point", "Notes": null}\'; over 200 MB --server-import\nkenso contacts update --file edits.csv --match id --dry-run # also one lead; or --match email --campaign 812\nkenso contacts remove --ids ids.txt --dry-run # also pause, resume, restore; over 1,000: --confirm <count>\nkenso contacts remove --where \'{"campaignIds": [812], "filters": [{"conditions": {"field": "ContactCompany.Name", "operator": 2, "value": "acme"}}]}\' --dry-run # also pause, resume; 2 = contains; no search first\nkenso contacts tag --tag 31 --ids ids.txt --dry-run # tag, restore: --ids only, so first kenso contacts list --campaign-id 812 --all -o ids > ids.txt\nkenso contact-imports create --source campaign --source-campaign-id 10601 --campaign-id 812 --dry-run # copy another campaign\'s leads in\nkenso contacts export --campaign 812 --out leads.csv # a segment: kenso contact-exports create --segment-id 55\nkenso runs resume <runId> # an interrupted run; terminal lost: kenso runs list finds it. A changed file is a new run\nkenso accounts import --file accounts.csv --dry-run # companies; a file of people: kenso people import --file people.csv\nkenso studio push 12 --dir ./tpl # to preview local edits push first (draft; live needs --publish), then studio preview 12\nkenso studio fill 12 --accounts ids.txt --dry-run # or --campaign 10546 --contacts leads.csv\nkenso opportunities update --each rows.csv --dry-run # any API command on a file of rows (CSV or JSONL; keys fill flags and body). One record: kenso campaigns update --campaign-id 812 --name Q4 --dry-run\nkenso mcp call list_skills # only to list Ken\'s skills\nkenso logs tail --status 4xx,5xx --since 10m # stream the workspace\'s failed API calls, one line each; Ctrl-C stops (exit 4 = not on for the workspace yet)\nkenso connect inbox --provider google # also calendar, crm, github, linkedin ...: hand the printed link to the person (only they can sign in), it waits and prints the connection\nkenso onboarding-builds events --build-id obd_2x --until done,error # live streams: one JSON line per event, reconnects itself\n```\n\nCharges: follow the kenso skill\'s spend rules;
|
|
9969
|
+
SKILL_default2 = '---\nname: kenso-cli\ndescription: The Kenso CLI (kenso) for work from a file (of any size, even a few ids) or over about 50 records - import, update, remove (delete), pause, tag or export leads, import CRM accounts and people, edit Studio templates as local files and fill them, run an API operation per file row, resume an interrupted run, write the Kenso AI work a workspace gave to its own coding agent (My agent, with kenso work run, or work pull and submit with subagents), sign in with a key from a variable (pipe it to kenso auth login --with-key, no check first). For records listed in the message (under about 50), one record or a question, use the Kenso MCP.\n---\n\n1. Every write runs first with `--dry-run`; apply with the plan\'s `next` (a delete, archive or remove applies with `--yes`). `--yes` at once only to continue an interrupted run or apply what the person confirmed. A command with no dry run refuses `--dry-run` (exit 2, nothing ran): read its `--help`, then run it without.\n2. Many rows: one command on the file as it is (`--file`, `--ids`, `--each`). Run kenso only: no python, awk or shell tests, not even on a file or variable.\n3. Any output\'s `next` is the command to run; errors are JSON on stderr. `--force` only with the person\'s OK.\n4. Ids are flags: `--campaign-id 812` (or `--campaign 812`, the same flag). `--workspace <id>`; by name `kenso workspace list --search acme`. `--json` is `-o json`; `--query` takes JMESPath (there is no `--jq`). Other commands: `kenso --help`; `kenso api <METHOD> <path>` only when none fits.\n\n```bash\nkenso contacts import --campaign 812 --file leads.csv --dry-run # skips leads already in; --map \'{"Pain": "customVariables.pain_point", "Notes": null}\'; over 200 MB --server-import\nkenso contacts update --file edits.csv --match id --dry-run # also one lead; or --match email --campaign 812\nkenso contacts remove --ids ids.txt --dry-run # also pause, resume, restore; over 1,000: --confirm <count>\nkenso contacts remove --where \'{"campaignIds": [812], "filters": [{"conditions": {"field": "ContactCompany.Name", "operator": 2, "value": "acme"}}]}\' --dry-run # also pause, resume; 2 = contains; no search first\nkenso contacts tag --tag 31 --ids ids.txt --dry-run # tag, restore: --ids only, so first kenso contacts list --campaign-id 812 --all -o ids > ids.txt\nkenso contact-imports create --source campaign --source-campaign-id 10601 --campaign-id 812 --dry-run # copy another campaign\'s leads in\nkenso contacts export --campaign 812 --out leads.csv # a segment: kenso contact-exports create --segment-id 55\nkenso runs resume <runId> # an interrupted run; terminal lost: kenso runs list finds it. A changed file is a new run\nkenso accounts import --file accounts.csv --dry-run # companies; a file of people: kenso people import --file people.csv\nkenso studio push 12 --dir ./tpl # to preview local edits push first (draft; live needs --publish), then studio preview 12\nkenso studio fill 12 --accounts ids.txt --dry-run # or --campaign 10546 --contacts leads.csv\nkenso opportunities update --each rows.csv --dry-run # any API command on a file of rows (CSV or JSONL; keys fill flags and body). One record: kenso campaigns update --campaign-id 812 --name Q4 --dry-run\nkenso mcp call list_skills # only to list Ken\'s skills\nkenso logs tail --status 4xx,5xx --since 10m # stream the workspace\'s failed API calls, one line each; Ctrl-C stops (exit 4 = not on for the workspace yet)\nkenso connect inbox --provider google # also calendar, crm, github, linkedin ...: hand the printed link to the person (only they can sign in), it waits and prints the connection\nkenso onboarding-builds events --build-id obd_2x --until done,error # live streams: one JSON line per event, reconnects itself\n```\n\nCharges: follow the kenso skill\'s spend rules; the dry run of a `spend` command (one call or an `--each` file) and of `kenso workflows run` prints `credits` (`needed`, `available`, `sufficient`; `null` where it cannot tell, and an unknown `needed` is never free). `pinned_by_user`: with the person\'s OK, rerun with `--overwrite-pinned`. Workflows: `kenso docs workflows` first; secrets only as `{{secrets.NAME}}`. Key: `KENSO_API_KEY`, or pipe a variable, no check: `printf \'%s\' "$KEY" | kenso auth login --with-key`; never in a flag, output or file.\n\n## Work (beta): My agent\n\nA workspace can set a kind of Kenso AI work (personalization, qualification, segmentation, rewriting, meeting brief, call brief, workflow prompt) to My agent in Settings > AI work: then it waits for the person\'s own coding agent, at 0 Kenso AI credits. The `kenso work` commands take no `--dry-run`. Never read the items\' text into the chat: the files carry it.\n\n```bash\nkenso work status # what waits, per kind\nkenso work run --agent claude # does it all: claims, runs headless agents, submits; stops when the queue is empty. Other agents need --allow-unconfined; exit 6 = the plan\'s usage limit\nkenso work pull --files 4 --per-file 10 # by hand: prints the work file paths, never the items\nkenso work submit <dir>/*.answers.json # pull\'s next; exit 5 = some answers rejected (see each <claimId>.results.json)\nkenso work release <claimId> # give back work you will not finish\n```\n\nBy hand in a chat: run `kenso work pull`, then give each work file to its own subagent with only its path ("Read this work file and write its answers file as its rules say"), then run pull\'s `next`. More: `kenso docs work`.\n\n## Setup\n\n`kenso` missing: `curl -fsSL https://ken.so/install.sh | sh` (macOS or Linux, no Node needed) or `npm i -g kenso` (Node 22 or newer), or run a command as `npx -y kenso@latest <command>`. Then sign in: `kenso login --no-wait` prints a link and a code for the person to open and approve, then `kenso auth wait` saves the key. Then `kenso doctor`. `kenso agent setup -y` installs this skill and the Kenso MCP server (`https://mcp.ken.so/mcp`) for the agent; the person signs in to the MCP once in the agent.\n\n## No Kenso account yet\n\nThe CLI signs in with a Kenso API key. If the user has no Kenso account, send them to https://app.ken.so/get-started to create one, then create a key in Kenso at Settings > Integrations > API keys.\n';
|
|
9882
9970
|
}
|
|
9883
9971
|
});
|
|
9884
9972
|
|
|
@@ -10022,10 +10110,14 @@ var init_shipped = __esm({
|
|
|
10022
10110
|
"8e79d18098e6ed3b79c3bce771a46180b50e9ed1b741e64ffcb301601282eb12",
|
|
10023
10111
|
"fcac2e80b3d818394465a491bad232025d1c201515ef7fb778e4aa51669b3e61",
|
|
10024
10112
|
"42fa3f163ab9aa70260040b443830c57dc7926e935a557c40896038e8817b088",
|
|
10025
|
-
"b34e186f56f36b509bffa0dea2ee78b09e91654b90a659d6665563df4fa88f76"
|
|
10113
|
+
"b34e186f56f36b509bffa0dea2ee78b09e91654b90a659d6665563df4fa88f76",
|
|
10114
|
+
"df7d86e0af12727cf15cf0620f26ef4fe9aac63f0180f3594e4d357cf14b40d2",
|
|
10115
|
+
"812bb97591cefa7eb23596105ce63dfd382c0bd4c68e8b5d179775e9b72e927a"
|
|
10026
10116
|
],
|
|
10027
10117
|
kenso: [
|
|
10028
|
-
"6fb333a826726d51ba2ea3927745f843343490c8aa9098e5da682d24172323f7"
|
|
10118
|
+
"6fb333a826726d51ba2ea3927745f843343490c8aa9098e5da682d24172323f7",
|
|
10119
|
+
"7d88215cf4e6eb7aaeb28d22839fc3006c57a0491e12dde86db7623b635d6f90",
|
|
10120
|
+
"875c8ed2738ecdc963377be449c21f40c623a0750baf361d3e51b22818cf8e9d"
|
|
10029
10121
|
]
|
|
10030
10122
|
};
|
|
10031
10123
|
}
|
|
@@ -11334,7 +11426,7 @@ var status_exports = {};
|
|
|
11334
11426
|
__export(status_exports, {
|
|
11335
11427
|
default: () => status_default
|
|
11336
11428
|
});
|
|
11337
|
-
var EXPIRY_WARNING_DAYS,
|
|
11429
|
+
var EXPIRY_WARNING_DAYS, DAY_MS2, command11, status_default;
|
|
11338
11430
|
var init_status = __esm({
|
|
11339
11431
|
"src/commands/auth/status.ts"() {
|
|
11340
11432
|
"use strict";
|
|
@@ -11344,7 +11436,7 @@ var init_status = __esm({
|
|
|
11344
11436
|
init_exit_codes();
|
|
11345
11437
|
init_http();
|
|
11346
11438
|
EXPIRY_WARNING_DAYS = 14;
|
|
11347
|
-
|
|
11439
|
+
DAY_MS2 = 24 * 60 * 60 * 1e3;
|
|
11348
11440
|
command11 = {
|
|
11349
11441
|
resource: "auth",
|
|
11350
11442
|
action: "status",
|
|
@@ -11403,8 +11495,8 @@ var init_status = __esm({
|
|
|
11403
11495
|
}
|
|
11404
11496
|
if (keyExpiresAt) {
|
|
11405
11497
|
const left = Date.parse(keyExpiresAt) - Date.now();
|
|
11406
|
-
if (!Number.isNaN(left) && left < EXPIRY_WARNING_DAYS *
|
|
11407
|
-
const days = Math.max(0, Math.ceil(left /
|
|
11498
|
+
if (!Number.isNaN(left) && left < EXPIRY_WARNING_DAYS * DAY_MS2) {
|
|
11499
|
+
const days = Math.max(0, Math.ceil(left / DAY_MS2));
|
|
11408
11500
|
ctx.output.warn(
|
|
11409
11501
|
`The API key expires ${keyExpiresAt} (in ${days} day${days === 1 ? "" : "s"}). Create a new one at Settings > Integrations > API keys, then run kenso auth login --with-key.`
|
|
11410
11502
|
);
|
|
@@ -12850,7 +12942,7 @@ var EMAIL_PATTERN, PROFILE_URL, SALES_PATH, IN_SLUG, SALES_NAVIGATOR_ID, MESSAGE
|
|
|
12850
12942
|
var init_import_rows = __esm({
|
|
12851
12943
|
"src/commands/contacts/import-rows.ts"() {
|
|
12852
12944
|
"use strict";
|
|
12853
|
-
|
|
12945
|
+
init_common2();
|
|
12854
12946
|
init_mapping();
|
|
12855
12947
|
EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
12856
12948
|
PROFILE_URL = /^\s*([a-z][a-z0-9+.-]*:\/\/)?\/*[^/?#\s]*linkedin[^/?#\s]*\/+([^/?#]{2}([-_][^/?#]{2})?\/+)?(in|pub)\/+[^/?#\s]/i;
|
|
@@ -12964,7 +13056,7 @@ var init_import_send = __esm({
|
|
|
12964
13056
|
init_errors();
|
|
12965
13057
|
init_exit_codes();
|
|
12966
13058
|
init_http();
|
|
12967
|
-
|
|
13059
|
+
init_common2();
|
|
12968
13060
|
GATEWAY_TIMEOUT_MS = 12e4;
|
|
12969
13061
|
RESEND_MARGIN_MS = 1e4;
|
|
12970
13062
|
LIMIT_REACHED_HINT = "Raise the campaign or plan contact limit, then run the same command again to continue.";
|
|
@@ -13075,7 +13167,7 @@ var init_server_import = __esm({
|
|
|
13075
13167
|
init_exit_codes();
|
|
13076
13168
|
init_http();
|
|
13077
13169
|
init_wait();
|
|
13078
|
-
|
|
13170
|
+
init_common2();
|
|
13079
13171
|
init_normalize();
|
|
13080
13172
|
SERVER_IMPORT_NOTE = "Per-row results are not available with --server-import.";
|
|
13081
13173
|
DEFAULT_TIMEOUT = "30m";
|
|
@@ -13144,7 +13236,7 @@ var init_import2 = __esm({
|
|
|
13144
13236
|
init_exit_codes();
|
|
13145
13237
|
init_http();
|
|
13146
13238
|
init_input();
|
|
13147
|
-
|
|
13239
|
+
init_common2();
|
|
13148
13240
|
init_import_rows();
|
|
13149
13241
|
init_import_send();
|
|
13150
13242
|
init_mapping();
|
|
@@ -13362,7 +13454,7 @@ var init_update = __esm({
|
|
|
13362
13454
|
init_errors();
|
|
13363
13455
|
init_http();
|
|
13364
13456
|
init_input();
|
|
13365
|
-
|
|
13457
|
+
init_common2();
|
|
13366
13458
|
init_mapping();
|
|
13367
13459
|
COMMAND3 = "kenso contacts update";
|
|
13368
13460
|
CHUNK_SIZE3 = 1e3;
|
|
@@ -13750,7 +13842,7 @@ var init_bulk_ids = __esm({
|
|
|
13750
13842
|
init_http();
|
|
13751
13843
|
init_input();
|
|
13752
13844
|
init_bulk_store();
|
|
13753
|
-
|
|
13845
|
+
init_common2();
|
|
13754
13846
|
init_import_send();
|
|
13755
13847
|
CHUNK_SIZE4 = 1e3;
|
|
13756
13848
|
SEARCH_PAGE = 200;
|
|
@@ -13876,7 +13968,7 @@ var init_tag = __esm({
|
|
|
13876
13968
|
init_errors();
|
|
13877
13969
|
init_http();
|
|
13878
13970
|
init_bulk_ids();
|
|
13879
|
-
|
|
13971
|
+
init_common2();
|
|
13880
13972
|
CHUNK_SIZE5 = 250;
|
|
13881
13973
|
DEFAULT_CONCURRENCY3 = 4;
|
|
13882
13974
|
ENTITY_TYPE = "contact";
|
|
@@ -13944,7 +14036,7 @@ var init_export = __esm({
|
|
|
13944
14036
|
init_http();
|
|
13945
14037
|
init_transfer();
|
|
13946
14038
|
init_wait();
|
|
13947
|
-
|
|
14039
|
+
init_common2();
|
|
13948
14040
|
COMMAND4 = "kenso contacts export";
|
|
13949
14041
|
JOB_TYPE = "contact_export";
|
|
13950
14042
|
DEFAULT_TIMEOUT2 = "30m";
|
|
@@ -14032,57 +14124,6 @@ var init_contacts = __esm({
|
|
|
14032
14124
|
}
|
|
14033
14125
|
});
|
|
14034
14126
|
|
|
14035
|
-
// src/commands/credits/common.ts
|
|
14036
|
-
function toCredits(millicredits) {
|
|
14037
|
-
return typeof millicredits === "number" && Number.isFinite(millicredits) ? Math.round(millicredits) / 1e3 : void 0;
|
|
14038
|
-
}
|
|
14039
|
-
function positiveFlag(flags, name) {
|
|
14040
|
-
const raw = flags[name];
|
|
14041
|
-
if (raw === void 0) return void 0;
|
|
14042
|
-
const text4 = String(raw).trim();
|
|
14043
|
-
if (!/^\d+$/.test(text4) || Number(text4) < 1 || !Number.isSafeInteger(Number(text4))) {
|
|
14044
|
-
throw usageError(`--${name} must be a positive whole number, not "${text4}".`, { field: name });
|
|
14045
|
-
}
|
|
14046
|
-
return Number(text4);
|
|
14047
|
-
}
|
|
14048
|
-
function instantFlag(flags, name) {
|
|
14049
|
-
const raw = flags[name];
|
|
14050
|
-
if (typeof raw !== "string") return void 0;
|
|
14051
|
-
const text4 = raw.trim();
|
|
14052
|
-
const back = /^(\d+)([dh])$/.exec(text4);
|
|
14053
|
-
if (back) return new Date(Date.now() - Number(back[1]) * (back[2] === "d" ? DAY_MS2 : DAY_MS2 / 24)).toISOString();
|
|
14054
|
-
const day = /^\d{4}-\d{2}-\d{2}$/.test(text4);
|
|
14055
|
-
const ms = Date.parse(day ? `${text4}T00:00:00Z` : text4);
|
|
14056
|
-
if (Number.isNaN(ms)) {
|
|
14057
|
-
throw usageError(`--${name} "${text4}" is not a date.`, { field: name, hint: "Use 7d, 12h, 2026-11-01 or 2026-11-01T09:00:00Z." });
|
|
14058
|
-
}
|
|
14059
|
-
return new Date(day && name === "until" ? ms + DAY_MS2 - 1 : ms).toISOString();
|
|
14060
|
-
}
|
|
14061
|
-
async function readAvailable(ctx) {
|
|
14062
|
-
try {
|
|
14063
|
-
const res = await ctx.client.request({ method: "GET", path: "/v1/credits", signal: ctx.signal });
|
|
14064
|
-
const available = unwrap(res.body)?.availableMillicredits;
|
|
14065
|
-
return { available: typeof available === "number" ? available : void 0 };
|
|
14066
|
-
} catch (err) {
|
|
14067
|
-
if (err instanceof KensoError && (err.exitCode === ExitCode.Auth || err.exitCode === ExitCode.Interrupted)) throw err;
|
|
14068
|
-
ctx.output.warn(`Could not read the available credits: ${err instanceof Error ? err.message : String(err)}`);
|
|
14069
|
-
return { estimateError: err instanceof KensoError ? { code: err.code, message: err.message } : { message: String(err) } };
|
|
14070
|
-
}
|
|
14071
|
-
}
|
|
14072
|
-
function estimateFailed(error) {
|
|
14073
|
-
return new KensoError({ code: error.code ?? "estimate_failed", message: error.message, exitCode: ExitCode.Error });
|
|
14074
|
-
}
|
|
14075
|
-
var DAY_MS2;
|
|
14076
|
-
var init_common3 = __esm({
|
|
14077
|
-
"src/commands/credits/common.ts"() {
|
|
14078
|
-
"use strict";
|
|
14079
|
-
init_errors();
|
|
14080
|
-
init_exit_codes();
|
|
14081
|
-
init_http();
|
|
14082
|
-
DAY_MS2 = 864e5;
|
|
14083
|
-
}
|
|
14084
|
-
});
|
|
14085
|
-
|
|
14086
14127
|
// src/commands/credits/balance.ts
|
|
14087
14128
|
var balance_exports = {};
|
|
14088
14129
|
__export(balance_exports, {
|
|
@@ -14094,7 +14135,7 @@ var init_balance = __esm({
|
|
|
14094
14135
|
"use strict";
|
|
14095
14136
|
init_exit_codes();
|
|
14096
14137
|
init_http();
|
|
14097
|
-
|
|
14138
|
+
init_common();
|
|
14098
14139
|
command24 = {
|
|
14099
14140
|
resource: "credits",
|
|
14100
14141
|
action: "balance",
|
|
@@ -14135,7 +14176,7 @@ var init_limit = __esm({
|
|
|
14135
14176
|
"use strict";
|
|
14136
14177
|
init_exit_codes();
|
|
14137
14178
|
init_http();
|
|
14138
|
-
|
|
14179
|
+
init_common();
|
|
14139
14180
|
command25 = {
|
|
14140
14181
|
resource: "credits",
|
|
14141
14182
|
action: "limit",
|
|
@@ -14247,7 +14288,7 @@ var init_quote = __esm({
|
|
|
14247
14288
|
init_exit_codes();
|
|
14248
14289
|
init_input();
|
|
14249
14290
|
init_columns();
|
|
14250
|
-
|
|
14291
|
+
init_common();
|
|
14251
14292
|
KINDS2 = ["campaign", "build", "infra", "accounts", "leads", "places"];
|
|
14252
14293
|
COUNT_FIELD = { campaign: "targetLeads", accounts: "accountCount", leads: "leadCount", places: "pages" };
|
|
14253
14294
|
command26 = {
|
|
@@ -14304,7 +14345,7 @@ var init_rate_card2 = __esm({
|
|
|
14304
14345
|
init_exit_codes();
|
|
14305
14346
|
init_rate_card();
|
|
14306
14347
|
init_columns();
|
|
14307
|
-
|
|
14348
|
+
init_common();
|
|
14308
14349
|
command27 = {
|
|
14309
14350
|
resource: "credits",
|
|
14310
14351
|
action: "rate-card",
|
|
@@ -14349,7 +14390,7 @@ var init_savings = __esm({
|
|
|
14349
14390
|
"use strict";
|
|
14350
14391
|
init_exit_codes();
|
|
14351
14392
|
init_http();
|
|
14352
|
-
|
|
14393
|
+
init_common();
|
|
14353
14394
|
command28 = {
|
|
14354
14395
|
resource: "credits",
|
|
14355
14396
|
action: "savings",
|
|
@@ -14394,7 +14435,7 @@ var init_usage = __esm({
|
|
|
14394
14435
|
init_exit_codes();
|
|
14395
14436
|
init_http();
|
|
14396
14437
|
init_columns();
|
|
14397
|
-
|
|
14438
|
+
init_common();
|
|
14398
14439
|
LEDGER_FLAGS = ["run", "workflow", "campaign", "action", "since", "until", "all"];
|
|
14399
14440
|
command29 = {
|
|
14400
14441
|
resource: "credits",
|
|
@@ -14664,7 +14705,7 @@ function detailOf(entry, cards) {
|
|
|
14664
14705
|
lines: lines.map((line) => ({ ...line, price: priceLine(line, cards) })),
|
|
14665
14706
|
...text4 ? { text: text4 } : {},
|
|
14666
14707
|
rateCard: { source: cards[0]?.source ?? "bundled", versions: cards.map((card) => card.version) }
|
|
14667
|
-
} : effectOf(entry) === "spend" ? { lines: [], ...text4 ? { text: text4 } : {}, rateCard: null } : null;
|
|
14708
|
+
} : text4 || effectOf(entry) === "spend" ? { lines: [], ...text4 ? { text: text4 } : {}, rateCard: null } : null;
|
|
14668
14709
|
}
|
|
14669
14710
|
return out;
|
|
14670
14711
|
}
|
|
@@ -14954,7 +14995,7 @@ async function candidates() {
|
|
|
14954
14995
|
for (const load2 of Object.values(area)) {
|
|
14955
14996
|
const spec = await load2();
|
|
14956
14997
|
const entry = specEntry(spec);
|
|
14957
|
-
if (entry) out.push(candidate(entry, spec.cost ? void 0 : spec.doc?.cost));
|
|
14998
|
+
if (entry) out.push({ ...candidate(entry, spec.cost ? void 0 : spec.doc?.cost), handWritten: true });
|
|
14958
14999
|
}
|
|
14959
15000
|
}
|
|
14960
15001
|
const hasSkillShow = handWritten.skill?.show !== void 0;
|
|
@@ -14988,10 +15029,12 @@ function rank(all, query, kind) {
|
|
|
14988
15029
|
const a = score(c, have);
|
|
14989
15030
|
const b = score(c, need);
|
|
14990
15031
|
if (a.points + b.points === 0) continue;
|
|
14991
|
-
|
|
15032
|
+
const inId = new Set(termsOf(c.entry.id));
|
|
15033
|
+
const named = [.../* @__PURE__ */ new Set([...have, ...need])].filter((token) => inId.has(token)).length;
|
|
15034
|
+
out.push({ candidate: c, both: arrow < 0 || a.points > 0 && b.points > 0, matched: a.matched + b.matched, points: a.points + b.points, named });
|
|
14992
15035
|
}
|
|
14993
15036
|
return out.sort(
|
|
14994
|
-
(x, y) => Number(y.both) - Number(x.both) || y.matched - x.matched || y.points - x.points || x.candidate.terms.size - y.candidate.terms.size || x.candidate.entry.id.localeCompare(y.candidate.entry.id)
|
|
15037
|
+
(x, y) => Number(y.both) - Number(x.both) || y.matched - x.matched || y.points - x.points || Number(y.candidate.handWritten === true) - Number(x.candidate.handWritten === true) || y.named - x.named || x.candidate.terms.size - y.candidate.terms.size || x.candidate.entry.id.localeCompare(y.candidate.entry.id)
|
|
14995
15038
|
);
|
|
14996
15039
|
}
|
|
14997
15040
|
function parseKind(value) {
|
|
@@ -15246,7 +15289,7 @@ var init_doctor = __esm({
|
|
|
15246
15289
|
effect: "read",
|
|
15247
15290
|
doc: {
|
|
15248
15291
|
when: "first in a new session, and after an error you cannot explain: it checks Node, the config, the API and the key",
|
|
15249
|
-
next: "kenso auth login when key_valid fails, else kenso describe for the command map"
|
|
15292
|
+
next: "kenso auth login when key_valid fails (under an agent, kenso login --no-wait), else kenso describe for the command map"
|
|
15250
15293
|
},
|
|
15251
15294
|
description: "Prints the version, Node, platform, config location, profile, key source, API URL, workspace and detected agent, plus the checks node_version, config_permissions, api_reachable, key_valid, skill_installed, skill_current and mcp_registered; each failed check carries the next command that fixes it. The skill and MCP checks read the detected agent's files (every agent found on this machine when none is detected) and make no request. next is the first failed check's next; when every check passes, starters lists four requests to start with. Exits 0 when the first four checks pass, 3 when the key check fails, else 1: the skill and MCP checks never change the exit code.",
|
|
15252
15295
|
flags: {},
|
|
@@ -15254,6 +15297,7 @@ var init_doctor = __esm({
|
|
|
15254
15297
|
operationIds: ["me.get"],
|
|
15255
15298
|
async run(ctx) {
|
|
15256
15299
|
const checks = [withNext(nodeCheck(), INSTALL_PAGE), withNext(configCheck(ctx.env), `chmod 600 ${configPath(ctx.env)}`)];
|
|
15300
|
+
const login = ctx.agent ? "kenso login --no-wait" : "kenso auth login";
|
|
15257
15301
|
const started = Date.now();
|
|
15258
15302
|
let reachable;
|
|
15259
15303
|
let keyValid;
|
|
@@ -15277,20 +15321,20 @@ var init_doctor = __esm({
|
|
|
15277
15321
|
const ms = Date.now() - started;
|
|
15278
15322
|
if (err.httpStatus === void 0) {
|
|
15279
15323
|
reachable = { name: "api_reachable", ok: false, detail: `${err.message} (${ms} ms)` };
|
|
15280
|
-
keyValid = { name: "key_valid", ok: false, detail: ctx.auth.apiKey ? "not checked: the API is unreachable" :
|
|
15324
|
+
keyValid = { name: "key_valid", ok: false, detail: ctx.auth.apiKey ? "not checked: the API is unreachable" : `no API key: run ${login}` };
|
|
15281
15325
|
} else {
|
|
15282
15326
|
reachable = { name: "api_reachable", ok: err.httpStatus < 500, detail: `${ctx.auth.apiUrl} answered ${err.httpStatus} in ${ms} ms` };
|
|
15283
15327
|
if (!ctx.auth.apiKey) {
|
|
15284
|
-
keyValid = { name: "key_valid", ok: false, detail:
|
|
15328
|
+
keyValid = { name: "key_valid", ok: false, detail: `no API key: run ${login}` };
|
|
15285
15329
|
} else if (err.httpStatus === 401 || err.httpStatus === 403) {
|
|
15286
15330
|
keyFailed = true;
|
|
15287
|
-
keyValid = { name: "key_valid", ok: false, detail: `the key was rejected (${err.httpStatus}): run
|
|
15331
|
+
keyValid = { name: "key_valid", ok: false, detail: `the key was rejected (${err.httpStatus}): run ${login}` };
|
|
15288
15332
|
} else {
|
|
15289
15333
|
keyValid = { name: "key_valid", ok: false, detail: `not checked: ${err.message}` };
|
|
15290
15334
|
}
|
|
15291
15335
|
}
|
|
15292
15336
|
}
|
|
15293
|
-
checks.push(withNext(reachable, "kenso doctor --verbose"), withNext(keyValid,
|
|
15337
|
+
checks.push(withNext(reachable, "kenso doctor --verbose"), withNext(keyValid, login));
|
|
15294
15338
|
const exitCode = checks.every((c) => c.ok) ? ExitCode.Ok : keyFailed ? ExitCode.Auth : ExitCode.Error;
|
|
15295
15339
|
checks.push(...await agentChecks(ctx));
|
|
15296
15340
|
const allPass = checks.every((c) => c.ok);
|
|
@@ -16779,7 +16823,7 @@ var init_import5 = __esm({
|
|
|
16779
16823
|
init_estimate();
|
|
16780
16824
|
init_http();
|
|
16781
16825
|
init_rate_card();
|
|
16782
|
-
|
|
16826
|
+
init_common();
|
|
16783
16827
|
init_columns();
|
|
16784
16828
|
COMMAND5 = "people import";
|
|
16785
16829
|
CHUNK_SIZE6 = 200;
|
|
@@ -16947,7 +16991,7 @@ var init_merge2 = __esm({
|
|
|
16947
16991
|
init_errors();
|
|
16948
16992
|
init_exit_codes();
|
|
16949
16993
|
init_http();
|
|
16950
|
-
|
|
16994
|
+
init_common2();
|
|
16951
16995
|
command47 = {
|
|
16952
16996
|
resource: "people",
|
|
16953
16997
|
action: "merge",
|
|
@@ -19089,7 +19133,7 @@ var init_fill = __esm({
|
|
|
19089
19133
|
init_estimate();
|
|
19090
19134
|
init_exit_codes();
|
|
19091
19135
|
init_http();
|
|
19092
|
-
|
|
19136
|
+
init_common();
|
|
19093
19137
|
init_columns();
|
|
19094
19138
|
init_common4();
|
|
19095
19139
|
init_fill_runs();
|
|
@@ -19952,7 +19996,7 @@ var init_status3 = __esm({
|
|
|
19952
19996
|
"use strict";
|
|
19953
19997
|
init_exit_codes();
|
|
19954
19998
|
init_http();
|
|
19955
|
-
|
|
19999
|
+
init_common3();
|
|
19956
20000
|
command73 = {
|
|
19957
20001
|
resource: "work",
|
|
19958
20002
|
action: "status",
|
|
@@ -20370,7 +20414,7 @@ var init_pull2 = __esm({
|
|
|
20370
20414
|
"use strict";
|
|
20371
20415
|
init_exit_codes();
|
|
20372
20416
|
init_files();
|
|
20373
|
-
|
|
20417
|
+
init_common3();
|
|
20374
20418
|
init_folder3();
|
|
20375
20419
|
MAX_FILES = 100;
|
|
20376
20420
|
command74 = {
|
|
@@ -20581,7 +20625,7 @@ var init_answers = __esm({
|
|
|
20581
20625
|
init_errors();
|
|
20582
20626
|
init_http();
|
|
20583
20627
|
init_files();
|
|
20584
|
-
|
|
20628
|
+
init_common3();
|
|
20585
20629
|
MAX_ANSWERS_PER_CALL = 50;
|
|
20586
20630
|
SUBMIT_ROUNDS = 3;
|
|
20587
20631
|
STATUSES3 = /* @__PURE__ */ new Set(["accepted", "rejected", "expired", "duplicate"]);
|
|
@@ -20602,7 +20646,7 @@ var init_submit = __esm({
|
|
|
20602
20646
|
init_exit_codes();
|
|
20603
20647
|
init_files();
|
|
20604
20648
|
init_answers();
|
|
20605
|
-
|
|
20649
|
+
init_common3();
|
|
20606
20650
|
command75 = {
|
|
20607
20651
|
resource: "work",
|
|
20608
20652
|
action: "submit",
|
|
@@ -20664,7 +20708,7 @@ var init_release = __esm({
|
|
|
20664
20708
|
init_errors();
|
|
20665
20709
|
init_exit_codes();
|
|
20666
20710
|
init_files();
|
|
20667
|
-
|
|
20711
|
+
init_common3();
|
|
20668
20712
|
CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
20669
20713
|
command76 = {
|
|
20670
20714
|
resource: "work",
|
|
@@ -21944,7 +21988,7 @@ var init_agent3 = __esm({
|
|
|
21944
21988
|
init_exit_codes();
|
|
21945
21989
|
init_adapters();
|
|
21946
21990
|
init_job();
|
|
21947
|
-
|
|
21991
|
+
init_common3();
|
|
21948
21992
|
AGENT_NAMES = {
|
|
21949
21993
|
claude: "Claude Code",
|
|
21950
21994
|
codex: "Codex",
|
|
@@ -22050,7 +22094,7 @@ var init_box = __esm({
|
|
|
22050
22094
|
init_input();
|
|
22051
22095
|
init_agent_user();
|
|
22052
22096
|
init_guide();
|
|
22053
|
-
|
|
22097
|
+
init_common3();
|
|
22054
22098
|
BOX_FLAGS = {
|
|
22055
22099
|
"token-stdin": {
|
|
22056
22100
|
type: "boolean",
|
|
@@ -22129,7 +22173,7 @@ var init_run3 = __esm({
|
|
|
22129
22173
|
init_agent3();
|
|
22130
22174
|
init_answers();
|
|
22131
22175
|
init_box();
|
|
22132
|
-
|
|
22176
|
+
init_common3();
|
|
22133
22177
|
init_folder3();
|
|
22134
22178
|
init_stop();
|
|
22135
22179
|
FAILURES_IN_A_ROW = 3;
|
|
@@ -23656,7 +23700,7 @@ var init_run_input = __esm({
|
|
|
23656
23700
|
init_exit_codes();
|
|
23657
23701
|
init_http();
|
|
23658
23702
|
init_input();
|
|
23659
|
-
|
|
23703
|
+
init_common2();
|
|
23660
23704
|
init_columns();
|
|
23661
23705
|
init_import5();
|
|
23662
23706
|
RECORD_TYPES3 = ["account", "person", "lead", "place"];
|