@posthog/cli 0.7.27 → 0.7.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/posthog-api-cli.mjs +53 -54
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# posthog-cli
|
|
2
2
|
|
|
3
|
+
## 0.7.28 — 2026-06-18
|
|
4
|
+
|
|
5
|
+
### Patch changes
|
|
6
|
+
|
|
7
|
+
- [f0bb5426d5](https://github.com/PostHog/posthog/commit/f0bb5426d51601a7e39c4d3bcadbe592962ab980) Remove the `posthog-cli api` experimental opt-in and skip unavailable generated tools without warning noise. — Thanks @cvolzer3!
|
|
8
|
+
|
|
3
9
|
## 0.7.27 — 2026-06-18
|
|
4
10
|
|
|
5
11
|
### Patch changes
|
package/lib/posthog-api-cli.mjs
CHANGED
|
@@ -38212,7 +38212,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38212
38212
|
}
|
|
38213
38213
|
},
|
|
38214
38214
|
"llma-evaluation-create": {
|
|
38215
|
-
description: "Create a new
|
|
38215
|
+
description: "Create a new AI observability evaluation. For 'llm_judge' type, provide evaluation_config.prompt and model_configuration (provider + model). For 'hog' type, provide evaluation_config.source (Hog code returning a boolean). For 'sentiment' type, use output_type='sentiment', omit model_configuration, and optionally set evaluation_config.source='user_messages'. When enabled, the evaluation runs automatically on new $ai_generation events. Results appear as '$ai_evaluation' events.",
|
|
38216
38216
|
category: "AI observability",
|
|
38217
38217
|
feature: "llm_analytics",
|
|
38218
38218
|
summary: "Create evaluation",
|
|
@@ -38226,7 +38226,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38226
38226
|
}
|
|
38227
38227
|
},
|
|
38228
38228
|
"llma-evaluation-delete": {
|
|
38229
|
-
description: "Soft-delete an
|
|
38229
|
+
description: "Soft-delete an AI observability evaluation. The evaluation stops running and is hidden from list views. Historical evaluation results ($ai_evaluation events) are preserved.",
|
|
38230
38230
|
category: "AI observability",
|
|
38231
38231
|
feature: "llm_analytics",
|
|
38232
38232
|
summary: "Delete evaluation",
|
|
@@ -38240,7 +38240,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38240
38240
|
}
|
|
38241
38241
|
},
|
|
38242
38242
|
"llma-evaluation-get": {
|
|
38243
|
-
description: "Get a specific
|
|
38243
|
+
description: "Get a specific AI observability evaluation by its UUID. Returns the full evaluation configuration including type, config, output type, enabled status, and model configuration.",
|
|
38244
38244
|
category: "AI observability",
|
|
38245
38245
|
feature: "llm_analytics",
|
|
38246
38246
|
summary: "Get evaluation",
|
|
@@ -38268,7 +38268,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38268
38268
|
}
|
|
38269
38269
|
},
|
|
38270
38270
|
"llma-evaluation-list": {
|
|
38271
|
-
description: "List all
|
|
38271
|
+
description: "List all AI observability evaluations for the current project. Optionally filter by name/description search or enabled status. Evaluations automatically score $ai_generation events for quality, relevance, safety, sentiment, and other criteria. Supported types are 'llm_judge' (LLM scores outputs against a prompt), 'hog' (deterministic Hog code), and 'sentiment' (user-message sentiment analysis). Results are stored as '$ai_evaluation' events.",
|
|
38272
38272
|
category: "AI observability",
|
|
38273
38273
|
feature: "llm_analytics",
|
|
38274
38274
|
summary: "List evaluations",
|
|
@@ -38394,7 +38394,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38394
38394
|
}
|
|
38395
38395
|
},
|
|
38396
38396
|
"llma-evaluation-summary-create": {
|
|
38397
|
-
description: 'Generate an AI-powered summary of
|
|
38397
|
+
description: 'Generate an AI-powered summary of boolean AI observability evaluation results for a given evaluation config. Pass an evaluation_id and an optional filter ("all", "pass", "fail", or "na") to scope which runs are analyzed. Returns an overall assessment, pattern groups for passing, failing, and N/A runs (each with title, description, frequency, and example generation IDs), actionable recommendations, and run statistics. Optionally pass generation_ids to restrict the analysis to specific runs. Results are cached for one hour \u2014 use force_refresh to recompute. Rate-limited; requires AI data processing approval for the organization.',
|
|
38398
38398
|
category: "AI observability",
|
|
38399
38399
|
feature: "llm_analytics",
|
|
38400
38400
|
summary: "Summarize evaluation results",
|
|
@@ -38423,7 +38423,7 @@ Do NOT use this to change lifecycle state \u2014 use the dedicated launch, end,
|
|
|
38423
38423
|
}
|
|
38424
38424
|
},
|
|
38425
38425
|
"llma-evaluation-update": {
|
|
38426
|
-
description: "Update an existing
|
|
38426
|
+
description: "Update an existing AI observability evaluation (partial update). Toggle enabled/disabled, update the evaluation config (prompt, Hog source, or sentiment source), or change the model configuration for llm_judge evaluations.",
|
|
38427
38427
|
category: "AI observability",
|
|
38428
38428
|
feature: "llm_analytics",
|
|
38429
38429
|
summary: "Update evaluation",
|
|
@@ -42379,7 +42379,7 @@ var tool_definitions_default = {
|
|
|
42379
42379
|
}
|
|
42380
42380
|
},
|
|
42381
42381
|
"evaluation-get": {
|
|
42382
|
-
description: "Get a specific AI observability evaluation by its UUID. Returns full details including name, type (llm_judge or
|
|
42382
|
+
description: "Get a specific AI observability evaluation by its UUID. Returns full details including name, type (llm_judge, hog, or sentiment), configuration, conditions, and enabled status.",
|
|
42383
42383
|
category: "AI observability",
|
|
42384
42384
|
feature: "llm_analytics",
|
|
42385
42385
|
summary: "Get a specific evaluation by ID.",
|
|
@@ -42393,7 +42393,7 @@ var tool_definitions_default = {
|
|
|
42393
42393
|
}
|
|
42394
42394
|
},
|
|
42395
42395
|
"evaluation-create": {
|
|
42396
|
-
description: "Create a new AI observability evaluation.
|
|
42396
|
+
description: "Create a new AI observability evaluation. Supported types are 'llm_judge' (LLM scores generations against a prompt), 'hog' (deterministic code returning a boolean), and 'sentiment' (user-message sentiment analysis). For llm_judge evaluations, provide evaluation_config.prompt and model_configuration. For hog evaluations, provide evaluation_config.source. For sentiment evaluations, use output_type='sentiment', omit model_configuration, and optionally set evaluation_config.source='user_messages'.",
|
|
42397
42397
|
category: "AI observability",
|
|
42398
42398
|
feature: "llm_analytics",
|
|
42399
42399
|
summary: "Create a new evaluation.",
|
|
@@ -42937,29 +42937,11 @@ function getToolsForFeatures(options) {
|
|
|
42937
42937
|
return entries.map(([toolName, _2]) => toolName);
|
|
42938
42938
|
}
|
|
42939
42939
|
|
|
42940
|
-
// src/cli/experimental.ts
|
|
42941
|
-
var EXPERIMENTAL_API_ENV = "POSTHOG_CLI_EXPERIMENTAL_API";
|
|
42942
|
-
var ENABLED_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
42943
|
-
function isExperimentalApiEnabled(env3 = process.env) {
|
|
42944
|
-
const value = env3[EXPERIMENTAL_API_ENV];
|
|
42945
|
-
return value ? ENABLED_VALUES.has(value.toLowerCase()) : false;
|
|
42946
|
-
}
|
|
42947
|
-
function requireExperimentalApiEnabled(opts = {}) {
|
|
42948
|
-
if (opts.flagEnabled || isExperimentalApiEnabled(opts.env)) {
|
|
42949
|
-
return;
|
|
42950
|
-
}
|
|
42951
|
-
throw new Error(
|
|
42952
|
-
`The \`posthog-cli api\` command group is experimental. Set ${EXPERIMENTAL_API_ENV}=1 or pass --experimental to use it.`
|
|
42953
|
-
);
|
|
42954
|
-
}
|
|
42955
|
-
|
|
42956
42940
|
// src/cli/agent-help.ts
|
|
42957
42941
|
var AGENT_HELP_HEADER = `# PostHog API guide for agents
|
|
42958
42942
|
|
|
42959
42943
|
\`posthog-cli api\` is the agent-first interface to the PostHog API. It exposes the same tool surface as the PostHog MCP server's \`exec\` tool, so the reference below is the canonical guide for interacting with PostHog. Treat it as instructions to follow, not just documentation.
|
|
42960
42944
|
|
|
42961
|
-
The command group is experimental: pass \`--experimental\` right after \`api\`, or set \`${EXPERIMENTAL_API_ENV}=1\` in the environment.
|
|
42962
|
-
|
|
42963
42945
|
On top of the reference below, the CLI adds:
|
|
42964
42946
|
|
|
42965
42947
|
- \`posthog-cli api call --dry-run <tool> '<json>'\` \u2014 validate input against the tool schema without executing. Use it before any mutation.
|
|
@@ -43011,7 +42993,7 @@ import * as fs from "node:fs/promises";
|
|
|
43011
42993
|
import * as path from "node:path";
|
|
43012
42994
|
|
|
43013
42995
|
// src/cli/agents-md-snippet.md
|
|
43014
|
-
var agents_md_snippet_default = "## PostHog\n\nUse `posthog-cli api` for all PostHog-related queries and operations. You should use `posthog-cli api` over direct MCP tool calls whenever the CLI is available
|
|
42996
|
+
var agents_md_snippet_default = "## PostHog\n\nUse `posthog-cli api` for all PostHog-related data queries and operations. You should use `posthog-cli api` over direct MCP tool calls whenever the CLI is available.\n\nBefore your first PostHog command in a session, run `posthog-cli api --agent-help` and load its full output into your context. It prints the complete agent guide \u2014 command reference, schema drill-down rules, data discovery workflow, and the tool index \u2014 for interacting with PostHog APIs. Treat that output as instructions to follow, not just documentation.\n\nBefore starting a PostHog task, run `posthog-cli api skill list` and check for a skill matching the task. If one matches, install it with `posthog-cli api skill install <skill-id>` (add `--force` to refresh an already-installed skill), then read `.agents/skills/<skill-id>/SKILL.md` and follow it. Skills contain task-specific workflows that individual tools do not.\n";
|
|
43015
42997
|
|
|
43016
42998
|
// src/cli/utils.ts
|
|
43017
42999
|
function errorCode(error48) {
|
|
@@ -55324,6 +55306,7 @@ var EvaluationsCreateParams = /* @__PURE__ */ object({
|
|
|
55324
55306
|
)
|
|
55325
55307
|
});
|
|
55326
55308
|
var evaluationsCreateBodyNameMax = 400;
|
|
55309
|
+
var evaluationsCreateBodyEvaluationConfigThreeSourceDefault = `user_messages`;
|
|
55327
55310
|
var evaluationsCreateBodyOutputConfigAllowsNaDefault = false;
|
|
55328
55311
|
var evaluationsCreateBodyConditionsItemIdMax = 100;
|
|
55329
55312
|
var evaluationsCreateBodyConditionsItemRolloutPercentageDefault = 100;
|
|
@@ -55334,8 +55317,8 @@ var EvaluationsCreateBody = /* @__PURE__ */ object({
|
|
|
55334
55317
|
name: string2().max(evaluationsCreateBodyNameMax).describe("Name of the evaluation."),
|
|
55335
55318
|
description: string2().optional().describe("Optional description of what this evaluation checks."),
|
|
55336
55319
|
enabled: boolean2().optional().describe("Whether the evaluation runs automatically on new $ai_generation events."),
|
|
55337
|
-
evaluation_type: _enum2(["llm_judge", "hog"]).describe("* `llm_judge` - LLM as a judge\n* `hog` - Hog").describe(
|
|
55338
|
-
"'llm_judge' uses an LLM to score outputs against a prompt; 'hog' runs deterministic Hog code.\n\n* `llm_judge` - LLM as a judge\n* `hog` - Hog"
|
|
55320
|
+
evaluation_type: _enum2(["llm_judge", "hog", "sentiment"]).describe("* `llm_judge` - LLM as a judge\n* `hog` - Hog\n* `sentiment` - Sentiment analysis").describe(
|
|
55321
|
+
"'llm_judge' uses an LLM to score outputs against a prompt; 'hog' runs deterministic Hog code; 'sentiment' classifies user-message sentiment.\n\n* `llm_judge` - LLM as a judge\n* `hog` - Hog\n* `sentiment` - Sentiment analysis"
|
|
55339
55322
|
),
|
|
55340
55323
|
evaluation_config: union([
|
|
55341
55324
|
object({
|
|
@@ -55343,9 +55326,16 @@ var EvaluationsCreateBody = /* @__PURE__ */ object({
|
|
|
55343
55326
|
}),
|
|
55344
55327
|
object({
|
|
55345
55328
|
source: string2().min(1).describe("Hog source code. Must return true (pass), false (fail), or null for N/A.")
|
|
55329
|
+
}),
|
|
55330
|
+
object({
|
|
55331
|
+
source: _enum2(["user_messages"]).default(evaluationsCreateBodyEvaluationConfigThreeSourceDefault).describe("Classify sentiment from user messages in the generation input.")
|
|
55346
55332
|
})
|
|
55347
|
-
]).optional().describe(
|
|
55348
|
-
|
|
55333
|
+
]).optional().describe(
|
|
55334
|
+
"Configuration dict. For 'llm_judge': {prompt}; for 'hog': {source}; for 'sentiment': {source: 'user_messages'}."
|
|
55335
|
+
),
|
|
55336
|
+
output_type: _enum2(["boolean", "sentiment"]).describe("* `boolean` - Boolean (Pass/Fail)\n* `sentiment` - Sentiment").describe(
|
|
55337
|
+
"Output format. Use 'boolean' for pass/fail evaluations and 'sentiment' for sentiment analysis.\n\n* `boolean` - Boolean (Pass/Fail)\n* `sentiment` - Sentiment"
|
|
55338
|
+
),
|
|
55349
55339
|
output_config: object({
|
|
55350
55340
|
allows_na: boolean2().default(evaluationsCreateBodyOutputConfigAllowsNaDefault).describe("Whether the evaluation can return N/A for non-applicable generations.")
|
|
55351
55341
|
}).optional().describe("Output config. For 'boolean' output_type: {allows_na} to permit N/A results."),
|
|
@@ -55396,6 +55386,7 @@ var EvaluationsPartialUpdateParams = /* @__PURE__ */ object({
|
|
|
55396
55386
|
)
|
|
55397
55387
|
});
|
|
55398
55388
|
var evaluationsPartialUpdateBodyNameMax = 400;
|
|
55389
|
+
var evaluationsPartialUpdateBodyEvaluationConfigThreeSourceDefault = `user_messages`;
|
|
55399
55390
|
var evaluationsPartialUpdateBodyOutputConfigAllowsNaDefault = false;
|
|
55400
55391
|
var evaluationsPartialUpdateBodyConditionsItemIdMax = 100;
|
|
55401
55392
|
var evaluationsPartialUpdateBodyConditionsItemRolloutPercentageDefault = 100;
|
|
@@ -55406,8 +55397,8 @@ var EvaluationsPartialUpdateBody = /* @__PURE__ */ object({
|
|
|
55406
55397
|
name: string2().max(evaluationsPartialUpdateBodyNameMax).optional().describe("Name of the evaluation."),
|
|
55407
55398
|
description: string2().optional().describe("Optional description of what this evaluation checks."),
|
|
55408
55399
|
enabled: boolean2().optional().describe("Whether the evaluation runs automatically on new $ai_generation events."),
|
|
55409
|
-
evaluation_type: _enum2(["llm_judge", "hog"]).describe("* `llm_judge` - LLM as a judge\n* `hog` - Hog").optional().describe(
|
|
55410
|
-
"'llm_judge' uses an LLM to score outputs against a prompt; 'hog' runs deterministic Hog code.\n\n* `llm_judge` - LLM as a judge\n* `hog` - Hog"
|
|
55400
|
+
evaluation_type: _enum2(["llm_judge", "hog", "sentiment"]).describe("* `llm_judge` - LLM as a judge\n* `hog` - Hog\n* `sentiment` - Sentiment analysis").optional().describe(
|
|
55401
|
+
"'llm_judge' uses an LLM to score outputs against a prompt; 'hog' runs deterministic Hog code; 'sentiment' classifies user-message sentiment.\n\n* `llm_judge` - LLM as a judge\n* `hog` - Hog\n* `sentiment` - Sentiment analysis"
|
|
55411
55402
|
),
|
|
55412
55403
|
evaluation_config: union([
|
|
55413
55404
|
object({
|
|
@@ -55415,9 +55406,16 @@ var EvaluationsPartialUpdateBody = /* @__PURE__ */ object({
|
|
|
55415
55406
|
}),
|
|
55416
55407
|
object({
|
|
55417
55408
|
source: string2().min(1).describe("Hog source code. Must return true (pass), false (fail), or null for N/A.")
|
|
55409
|
+
}),
|
|
55410
|
+
object({
|
|
55411
|
+
source: _enum2(["user_messages"]).default(evaluationsPartialUpdateBodyEvaluationConfigThreeSourceDefault).describe("Classify sentiment from user messages in the generation input.")
|
|
55418
55412
|
})
|
|
55419
|
-
]).optional().describe(
|
|
55420
|
-
|
|
55413
|
+
]).optional().describe(
|
|
55414
|
+
"Configuration dict. For 'llm_judge': {prompt}; for 'hog': {source}; for 'sentiment': {source: 'user_messages'}."
|
|
55415
|
+
),
|
|
55416
|
+
output_type: _enum2(["boolean", "sentiment"]).describe("* `boolean` - Boolean (Pass/Fail)\n* `sentiment` - Sentiment").optional().describe(
|
|
55417
|
+
"Output format. Use 'boolean' for pass/fail evaluations and 'sentiment' for sentiment analysis.\n\n* `boolean` - Boolean (Pass/Fail)\n* `sentiment` - Sentiment"
|
|
55418
|
+
),
|
|
55421
55419
|
output_config: object({
|
|
55422
55420
|
allows_na: boolean2().default(evaluationsPartialUpdateBodyOutputConfigAllowsNaDefault).describe("Whether the evaluation can return N/A for non-applicable generations.")
|
|
55423
55421
|
}).optional().describe("Output config. For 'boolean' output_type: {allows_na} to permit N/A results."),
|
|
@@ -82570,11 +82568,29 @@ var AssistantTrendsFilter = external_exports.object({
|
|
|
82570
82568
|
"BoxPlot",
|
|
82571
82569
|
"SlopeGraph"
|
|
82572
82570
|
]).describe(
|
|
82573
|
-
"Visualization type. Available values: `ActionsLineGraph` - time-series line chart; most common option, as it shows change over time. `ActionsBar` - time-series bar chart. `ActionsAreaGraph` - time-series area chart. `ActionsLineGraphCumulative` - cumulative time-series line chart; good for cumulative metrics. `BoldNumber` - total value single large number. Use when user explicitly asks for a single output number. You CANNOT use this with breakdown or if the insight has more than one series. `ActionsBarValue` - total value (NOT time-series) bar chart; good for categorical data. `ActionsPie` - total value pie chart; good for visualizing proportions. `ActionsTable` - total value table; good when using breakdown to list users or other entities. `WorldMap` - total value world map; use when breaking down by country name using property `$geoip_country_name`, and only then."
|
|
82571
|
+
"Visualization type. Available values: `ActionsLineGraph` - time-series line chart; most common option, as it shows change over time. `ActionsBar` - time-series bar chart. `ActionsAreaGraph` - time-series area chart. `ActionsLineGraphCumulative` - cumulative time-series line chart; good for cumulative metrics. `BoldNumber` - total value single large number. Use when user explicitly asks for a single output number. You CANNOT use this with breakdown or if the insight has more than one series. `Metric` - single large number with a period-over-period change pill and a sparkline. Like `BoldNumber` but trend-aware; configure it with the `metric*` fields below. Single series, no breakdown. `ActionsBarValue` - total value (NOT time-series) bar chart; good for categorical data. `ActionsPie` - total value pie chart; good for visualizing proportions. `ActionsTable` - total value table; good when using breakdown to list users or other entities. `WorldMap` - total value world map; use when breaking down by country name using property `$geoip_country_name`, and only then."
|
|
82574
82572
|
).default("ActionsLineGraph").optional(),
|
|
82575
82573
|
formulaNodes: external_exports.array(TrendsFormulaNode).describe(
|
|
82576
82574
|
"Use custom formulas to perform mathematical operations like calculating percentages or metrics. Use the following syntax: `A/B`, where `A` and `B` are the names of the series. You can combine math aggregations and formulas. When using a formula, you must:\n- Identify and specify **all** events and actions needed to solve the formula.\n- Carefully review the list of available events and actions to find appropriate entities for each part of the formula.\n- Ensure that you find events and actions corresponding to both the numerator and denominator in ratio calculations. Examples of using math formulas:\n- If you want to calculate the percentage of users who have completed onboarding, you need to find and use events or actions similar to `$identify` and `onboarding complete`, so the formula will be `A / B`, where `A` is `onboarding complete` (unique users) and `B` is `$identify` (unique users)."
|
|
82577
82575
|
).optional(),
|
|
82576
|
+
metricChangeDecreaseColor: external_exports.string().describe(
|
|
82577
|
+
'Only applies when `display` is `Metric`. Hex color (e.g. `#db3707`) for the change pill when the metric went DOWN. Defaults to red (`#db3707`). For a "lower is better" metric (latency, error rate, cost), set this to a green (e.g. `#388600`) so a decrease reads as good.'
|
|
82578
|
+
).optional(),
|
|
82579
|
+
metricChangeIncreaseColor: external_exports.string().describe(
|
|
82580
|
+
'Only applies when `display` is `Metric`. Hex color (e.g. `#388600`) for the change pill when the metric went UP. Defaults to green (`#388600`). For a "lower is better" metric (latency, error rate, cost), set this to a red (e.g. `#db3707`) so an increase reads as bad.'
|
|
82581
|
+
).optional(),
|
|
82582
|
+
metricColorByDirection: external_exports.coerce.boolean().describe(
|
|
82583
|
+
"Only applies when `display` is `Metric`. Color the sparkline under the big number by whether the metric increased or decreased over the period (using the increase/decrease line colors)."
|
|
82584
|
+
).default(false).optional(),
|
|
82585
|
+
metricLineDecreaseColor: external_exports.string().describe(
|
|
82586
|
+
'Only applies when `display` is `Metric` and `metricColorByDirection` is `true`. Hex color for the sparkline when the metric went DOWN. Defaults to red (`#db3707`). Flip to a green for a "lower is better" metric.'
|
|
82587
|
+
).optional(),
|
|
82588
|
+
metricLineIncreaseColor: external_exports.string().describe(
|
|
82589
|
+
'Only applies when `display` is `Metric` and `metricColorByDirection` is `true`. Hex color for the sparkline when the metric went UP. Defaults to green (`#388600`). Flip to a red for a "lower is better" metric.'
|
|
82590
|
+
).optional(),
|
|
82591
|
+
metricShowChange: external_exports.coerce.boolean().describe(
|
|
82592
|
+
"Only applies when `display` is `Metric`. Show the change pill next to the big number \u2014 the percentage change from the first to the last point of the series over the selected date range."
|
|
82593
|
+
).default(true).optional(),
|
|
82578
82594
|
showAlertThresholdLines: external_exports.coerce.boolean().describe("Whether to show alert threshold lines on the chart.").default(false).optional(),
|
|
82579
82595
|
showLabelsOnSeries: external_exports.coerce.boolean().describe("Whether to show labels on each series.").default(false).optional(),
|
|
82580
82596
|
showLegend: external_exports.coerce.boolean().describe("Whether to show the legend describing series and breakdowns.").default(false).optional(),
|
|
@@ -100075,7 +100091,6 @@ var TOOL_MAP = {
|
|
|
100075
100091
|
};
|
|
100076
100092
|
|
|
100077
100093
|
// src/cli/tools.ts
|
|
100078
|
-
var warnedSkippedTools = /* @__PURE__ */ new Set();
|
|
100079
100094
|
function materializeTool(name, factory, definition) {
|
|
100080
100095
|
return {
|
|
100081
100096
|
...factory(),
|
|
@@ -100085,16 +100100,6 @@ function materializeTool(name, factory, definition) {
|
|
|
100085
100100
|
annotations: definition.annotations
|
|
100086
100101
|
};
|
|
100087
100102
|
}
|
|
100088
|
-
function warnSkippedTool(name, reason) {
|
|
100089
|
-
const detail = reason instanceof Error ? reason.message : String(reason);
|
|
100090
|
-
const warningKey = `${name}:${detail}`;
|
|
100091
|
-
if (warnedSkippedTools.has(warningKey)) {
|
|
100092
|
-
return;
|
|
100093
|
-
}
|
|
100094
|
-
warnedSkippedTools.add(warningKey);
|
|
100095
|
-
process.stderr.write(`Warning: Skipping PostHog API tool "${name}": ${detail}
|
|
100096
|
-
`);
|
|
100097
|
-
}
|
|
100098
100103
|
function getCliTools(options = {}) {
|
|
100099
100104
|
const factories = {
|
|
100100
100105
|
...TOOL_MAP,
|
|
@@ -100107,14 +100112,12 @@ function getCliTools(options = {}) {
|
|
|
100107
100112
|
for (const name of names) {
|
|
100108
100113
|
const factory = factories[name];
|
|
100109
100114
|
if (!factory) {
|
|
100110
|
-
warnSkippedTool(name, "no implementation factory was registered");
|
|
100111
100115
|
continue;
|
|
100112
100116
|
}
|
|
100113
100117
|
try {
|
|
100114
100118
|
const definition = getToolDefinition(name);
|
|
100115
100119
|
tools.push(materializeTool(name, () => factory(), definition));
|
|
100116
|
-
} catch
|
|
100117
|
-
warnSkippedTool(name, error48);
|
|
100120
|
+
} catch {
|
|
100118
100121
|
continue;
|
|
100119
100122
|
}
|
|
100120
100123
|
}
|
|
@@ -100132,7 +100135,6 @@ function usage() {
|
|
|
100132
100135
|
return `PostHog agent CLI
|
|
100133
100136
|
|
|
100134
100137
|
Usage:
|
|
100135
|
-
posthog-cli api --experimental <command>
|
|
100136
100138
|
posthog-cli api --agent-help
|
|
100137
100139
|
posthog-cli api tools
|
|
100138
100140
|
posthog-cli api search <regex>
|
|
@@ -100143,7 +100145,6 @@ Usage:
|
|
|
100143
100145
|
posthog-cli api skill install [--force] <skill-id>
|
|
100144
100146
|
posthog-cli api agents-md install [--path AGENTS.md]
|
|
100145
100147
|
|
|
100146
|
-
Experimental: set ${EXPERIMENTAL_API_ENV}=1 or pass --experimental to enable this command group.
|
|
100147
100148
|
Destructive tools require --confirm when executed. Use --dry-run before mutations.
|
|
100148
100149
|
Agents: run \`posthog-cli api --agent-help\` and load the output into context before anything else.`;
|
|
100149
100150
|
}
|
|
@@ -100275,7 +100276,6 @@ async function runAgentsMdCommand(args) {
|
|
|
100275
100276
|
}
|
|
100276
100277
|
async function main() {
|
|
100277
100278
|
const args = process.argv.slice(2);
|
|
100278
|
-
const experimental = takeFlag(args, "--experimental");
|
|
100279
100279
|
const command = args.shift();
|
|
100280
100280
|
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
100281
100281
|
process.stdout.write(`${usage()}
|
|
@@ -100287,7 +100287,6 @@ async function main() {
|
|
|
100287
100287
|
`);
|
|
100288
100288
|
return;
|
|
100289
100289
|
}
|
|
100290
|
-
requireExperimentalApiEnabled({ flagEnabled: experimental });
|
|
100291
100290
|
switch (command) {
|
|
100292
100291
|
case "tools":
|
|
100293
100292
|
await runExecCommand("tools");
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"hasInstallScript": true,
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"name": "@posthog/cli",
|
|
22
|
-
"version": "0.7.
|
|
22
|
+
"version": "0.7.28"
|
|
23
23
|
},
|
|
24
24
|
"node_modules/detect-libc": {
|
|
25
25
|
"engines": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"requires": true,
|
|
51
|
-
"version": "0.7.
|
|
51
|
+
"version": "0.7.28"
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"artifactDownloadUrls": [
|
|
3
|
-
"https://github.com/PostHog/posthog/releases/download/posthog-cli/v0.7.
|
|
3
|
+
"https://github.com/PostHog/posthog/releases/download/posthog-cli/v0.7.28"
|
|
4
4
|
],
|
|
5
5
|
"bin": {
|
|
6
6
|
"posthog-cli": "run-posthog-cli.js"
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"zipExt": ".tar.gz"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
"version": "0.7.
|
|
117
|
+
"version": "0.7.28",
|
|
118
118
|
"volta": {
|
|
119
119
|
"node": "18.14.1",
|
|
120
120
|
"npm": "9.5.0"
|