Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(agent): rename the harness hog command to hogness (#124304)

Rafael Audibert2f1c38ea4b8c
diff --git a/packages/agent/packages/harness/README.md b/packages/agent/packages/harness/README.md
index af6efaf2902e..9e6756422009 100644
--- a/packages/agent/packages/harness/README.md
+++ b/packages/agent/packages/harness/README.md
@@ -7,12 +7,12 @@ It adds the PostHog LLM provider and the extensions in `src/extensions/` while k
## CLI
```bash
-hog
-hog /login
-hog -p "Fix the tests" --model posthog/claude-opus-4-8
+hogness
+hogness /login
+hogness -p "Fix the tests" --model posthog/claude-opus-4-8
```
-`harness` is an alias for `hog`.
+`harness` is an alias for `hogness`.
## Runtime
@@ -39,7 +39,7 @@ RPC is Pi's JSONL protocol over stdin/stdout. Harness does not define another pr
## Authentication
-Run `hog /login`, or pass a PostHog personal API key:
+Run `hogness /login`, or pass a PostHog personal API key:
```ts
const runtime = await createHarnessRuntime({ apiKey: "pha_…" });
diff --git a/packages/agent/packages/harness/package.json b/packages/agent/packages/harness/package.json
index 42a1d29869ae..7f8338356a4c 100644
--- a/packages/agent/packages/harness/package.json
+++ b/packages/agent/packages/harness/package.json
@@ -5,7 +5,7 @@
"type": "module",
"bin": {
"harness": "dist/cli.js",
- "hog": "dist/cli.js"
+ "hogness": "dist/cli.js"
},
"exports": {
".": {
@@ -44,9 +44,9 @@
"types": "./dist/extensions/task-system-prompt/index.d.ts",
"import": "./dist/extensions/task-system-prompt/index.js"
},
- "./extensions/hog-branding": {
- "types": "./dist/extensions/hog-branding/index.d.ts",
- "import": "./dist/extensions/hog-branding/index.js"
+ "./extensions/hogness-branding": {
+ "types": "./dist/extensions/hogness-branding/index.d.ts",
+ "import": "./dist/extensions/hogness-branding/index.js"
},
"./extensions/posthog-provider": {
"types": "./dist/extensions/posthog-provider/index.d.ts",
diff --git a/packages/agent/packages/harness/src/cli.ts b/packages/agent/packages/harness/src/cli.ts
index 1d8bb4581ca7..4b8515ee9d35 100644
--- a/packages/agent/packages/harness/src/cli.ts
+++ b/packages/agent/packages/harness/src/cli.ts
@@ -1,17 +1,17 @@
#!/usr/bin/env node
import {
- formatHogBrandBanner,
- installHogBrandEnv,
+ formatHognessBrandBanner,
+ installHognessBrandEnv,
isHelpRequest,
-} from "./extensions/hog-branding/brand-env";
+} from "./extensions/hogness-branding/brand-env";
// Must run — and finish running — before `@earendil-works/pi-coding-agent`
-// is evaluated, so pi picks up "hog" branding when its config module first
-// evaluates. `installHogBrandEnv` itself only touches Node builtins, so
+// is evaluated, so pi picks up "hogness" branding when its config module first
+// evaluates. `installHognessBrandEnv` itself only touches Node builtins, so
// this static import carries no ordering risk; everything below that
// touches pi-coding-agent (directly or transitively through the extension
// registry) is loaded dynamically instead of via a static import — see
-// `./extensions/hog-branding/brand-env` for why a static
+// `./extensions/hogness-branding/brand-env` for why a static
// import here wouldn't reliably run first once bundled, and why the extension
// registry below is imported by a *computed* (non-literal) specifier: a
// literal dynamic import is statically inlinable by a bundler. A specifier the
@@ -19,7 +19,7 @@ import {
// `dist/extensions/registry.js`.
import type * as ExtensionRegistry from "./extensions/registry";
-installHogBrandEnv();
+installHognessBrandEnv();
const { main, VERSION } = await import("@earendil-works/pi-coding-agent");
const extensionRegistryUrl = new URL(
@@ -33,7 +33,7 @@ const { harnessExtensionFiles }: typeof ExtensionRegistry = await import(
// pi generates its own `--help` text (see `cli/args.js`'s `printHelp()`)
// from `APP_NAME` alone, with no tagline — print ours first.
if (isHelpRequest(process.argv.slice(2))) {
- console.log(`${formatHogBrandBanner(VERSION)}\n`);
+ console.log(`${formatHognessBrandBanner(VERSION)}\n`);
}
// Load every harness extension by file path (rather than via
diff --git a/packages/agent/packages/harness/src/extensions/entrypoints.ts b/packages/agent/packages/harness/src/extensions/entrypoints.ts
index 6d0409ad736a..a551d52f2e38 100644
--- a/packages/agent/packages/harness/src/extensions/entrypoints.ts
+++ b/packages/agent/packages/harness/src/extensions/entrypoints.ts
@@ -1,5 +1,5 @@
export const HARNESS_EXTENSION_ENTRYPOINTS = {
- "hog-branding": "hog-branding/index",
+ "hogness-branding": "hogness-branding/index",
"posthog-provider": "posthog-provider/index",
"product-engineer": "product-engineer/index",
"current-work": "current-work/extension",
diff --git a/packages/agent/packages/harness/src/extensions/hog-branding/brand-env.ts b/packages/agent/packages/harness/src/extensions/hogness-branding/brand-env.ts
similarity index 78%
rename from packages/agent/packages/harness/src/extensions/hog-branding/brand-env.ts
rename to packages/agent/packages/harness/src/extensions/hogness-branding/brand-env.ts
index a1d72a017fc0..83539c57d102 100644
--- a/packages/agent/packages/harness/src/extensions/hog-branding/brand-env.ts
+++ b/packages/agent/packages/harness/src/extensions/hogness-branding/brand-env.ts
@@ -1,7 +1,7 @@
/**
- * Makes pi itself answer to "hog" instead of "pi": `--help`/usage text, the
+ * Makes pi itself answer to "hogness" instead of "pi": `--help`/usage text, the
* default startup banner, slash-command descriptions, generated env var
- * names (`HOG_CODING_AGENT_DIR` instead of `PI_CODING_AGENT_DIR`), and
+ * names (`HOGNESS_CODING_AGENT_DIR` instead of `PI_CODING_AGENT_DIR`), and
* error messages all derive from `@earendil-works/pi-coding-agent`'s
* `APP_NAME`/`APP_TITLE`/`CONFIG_DIR_NAME` constants (see its
* `config.js`), which are themselves read from a `piConfig: { name,
@@ -18,7 +18,7 @@
* compiled-binary caveat below) the standalone binary alike.
*
* This module materializes a small directory containing a `package.json`
- * with `piConfig: { name: "hog" }`, symlinks *every other entry* of the
+ * with `piConfig: { name: "hogness" }`, symlinks *every other entry* of the
* real pi package root into it (`dist/`, `docs/`, `examples/`,
* `README.md`, …) — `getPackageDir()` isn't only used for docs/README/
* examples paths; pi also loads runtime assets relative to it (e.g.
@@ -28,11 +28,11 @@
* `PACKAGE_NAME` (used for self-update checks) and `VERSION` (shown in the
* startup header) stay accurate.
*
- * `installHogBrandEnv()` must be *called* (not just imported — see below)
+ * `installHognessBrandEnv()` must be *called* (not just imported — see below)
* before `@earendil-works/pi-coding-agent` is evaluated, because
* `APP_NAME`/`APP_TITLE`/`CONFIG_DIR_NAME` are read from `PI_PACKAGE_DIR` at
- * module-evaluation time, not lazily. `cli.ts`, `bin/hog.ts`, and
- * `runtime.ts` call it before dynamically importing
+ * module-evaluation time, not lazily. `cli.ts` and `runtime.ts`
+ * call it before dynamically importing
* `@earendil-works/pi-coding-agent` or any local module that transitively
* imports the SDK.
*
@@ -45,14 +45,14 @@
* originally-separate files into one output module, collapsing the file
* boundary that ordering relied on. A real `await import(...)`, by
* contrast, is never hoisted ahead of preceding synchronous statements, so
- * it reliably runs after `installHogBrandEnv()` regardless of bundling.
+ * it reliably runs after `installHognessBrandEnv()` regardless of bundling.
*
- * Deliberately keeps `configDir: ".pi"` (not `.hog`) so existing pi
+ * Deliberately keeps `configDir: ".pi"` (not `.hogness`) so existing pi
* credentials, sessions, and MCP auth on disk keep working unchanged for
* anyone who has both installed.
*
- * Best-effort: inside the standalone `bun build --compile` binary (see
- * `bin/hog.ts`) there is no real `node_modules` tree to resolve
+ * Best-effort: inside a standalone `bun build --compile` binary there is
+ * no real `node_modules` tree to resolve
* `@earendil-works/pi-coding-agent`'s package root against — the same
* limitation that excludes the `subagent` extension from that binary — so
* failures here are swallowed and Pi falls back to its
@@ -71,11 +71,11 @@ import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
-export const HOG_APP_NAME = "hog";
-export const HOG_BRAND_TAGLINE = "A Pi distribution by PostHog";
+export const HOGNESS_APP_NAME = "hogness";
+export const HOGNESS_BRAND_TAGLINE = "A Pi distribution by PostHog";
// Keep pi's own on-disk config dir name so existing pi credentials,
// sessions, and MCP auth continue to work unchanged.
-export const HOG_CONFIG_DIR_NAME = ".pi";
+export const HOGNESS_CONFIG_DIR_NAME = ".pi";
// Undefined = not attempted yet; null = attempted and failed (fall back to
// pi's own naming); string = ready to use.
@@ -114,11 +114,11 @@ function linkIfMissing(target: string, linkPath: string): void {
* inside the compiled binary, where `@earendil-works/pi-coding-agent`
* can't be resolved against a real `node_modules` tree).
*/
-export function hogBrandManifestDir(): string | null {
+export function hognessBrandManifestDir(): string | null {
if (cachedManifestDir !== undefined) return cachedManifestDir;
try {
const real = resolveRealPiPackage();
- const manifestDir = join(tmpdir(), "posthog-hog-brand");
+ const manifestDir = join(tmpdir(), "posthog-hogness-brand");
mkdirSync(manifestDir, { recursive: true });
writeFileSync(
join(manifestDir, "package.json"),
@@ -126,7 +126,10 @@ export function hogBrandManifestDir(): string | null {
{
name: real.name,
version: real.version,
- piConfig: { name: HOG_APP_NAME, configDir: HOG_CONFIG_DIR_NAME },
+ piConfig: {
+ name: HOGNESS_APP_NAME,
+ configDir: HOGNESS_CONFIG_DIR_NAME,
+ },
},
null,
2,
@@ -146,28 +149,28 @@ export function hogBrandManifestDir(): string | null {
/**
* Side effect: sets `process.env.PI_PACKAGE_DIR` for the current process,
* in place, so that pi's config module — imported right after this one —
- * picks up "hog" branding when it first evaluates.
+ * picks up "hogness" branding when it first evaluates.
*/
-export function installHogBrandEnv(): void {
+export function installHognessBrandEnv(): void {
if (process.env.PI_PACKAGE_DIR) return;
- const dir = hogBrandManifestDir();
+ const dir = hognessBrandManifestDir();
if (dir) process.env.PI_PACKAGE_DIR = dir;
}
/**
- * One-line brand banner (`hog (A Pi distribution by PostHog) vX.Y.Z`),
+ * One-line brand banner (`hogness (A Pi distribution by PostHog) vX.Y.Z`),
* matching the TUI header's `brandLine()` in `./extension.ts` but as plain
* text — for non-interactive surfaces like `--help` output, which pi
* generates itself (see `cli/args.js`'s `printHelp()`) and only rebrands
* as far as `APP_NAME`/`APP_TITLE` go, with no tagline of its own.
*/
-export function formatHogBrandBanner(version: string): string {
- return `${HOG_APP_NAME} (${HOG_BRAND_TAGLINE}) v${version}`;
+export function formatHognessBrandBanner(version: string): string {
+ return `${HOGNESS_APP_NAME} (${HOGNESS_BRAND_TAGLINE}) v${version}`;
}
/** Whether `argv` (e.g. `process.argv.slice(2)`) requests pi's own
- * `--help`/`-h` usage text, which `cli.ts`/`bin/hog.ts` prefix with
- * `formatHogBrandBanner()` before delegating to pi's `main()`. */
+ * `--help`/`-h` usage text, which `cli.ts` prefixes with
+ * `formatHognessBrandBanner()` before delegating to pi's `main()`. */
export function isHelpRequest(argv: string[]): boolean {
return argv.includes("--help") || argv.includes("-h");
}
diff --git a/packages/agent/packages/harness/src/extensions/hog-branding/extension.test.ts b/packages/agent/packages/harness/src/extensions/hogness-branding/extension.test.ts
similarity index 87%
rename from packages/agent/packages/harness/src/extensions/hog-branding/extension.test.ts
rename to packages/agent/packages/harness/src/extensions/hogness-branding/extension.test.ts
index 1e39bcf89984..a2b70045856a 100644
--- a/packages/agent/packages/harness/src/extensions/hog-branding/extension.test.ts
+++ b/packages/agent/packages/harness/src/extensions/hogness-branding/extension.test.ts
@@ -7,7 +7,7 @@ import type {
} from "@earendil-works/pi-coding-agent";
import { initTheme } from "@earendil-works/pi-coding-agent";
import { describe, expect, it, vi } from "vitest";
-import { createHogBrandingExtension } from "./extension";
+import { createHognessBrandingExtension } from "./extension";
// `keyHint`/`keyText`/`rawKeyHint` read the app's active keybindings and
// current theme through internal singletons initialized by the TUI runtime
@@ -62,12 +62,12 @@ function fakeCtx(options: {
} as unknown as ExtensionContext;
}
-describe("createHogBrandingExtension", () => {
+describe("createHognessBrandingExtension", () => {
it("registers a session_start handler that sets a custom header in TUI mode", async () => {
const { pi, handlers } = fakePi();
const setHeader = vi.fn();
- const extension = createHogBrandingExtension({ version: "9.9.9" });
+ const extension = createHognessBrandingExtension({ version: "9.9.9" });
await extension(pi);
expect(pi.on).toHaveBeenCalledWith("session_start", expect.any(Function));
@@ -89,7 +89,7 @@ describe("createHogBrandingExtension", () => {
const { pi, handlers } = fakePi();
const setHeader = vi.fn();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
const ctx = fakeCtx({ mode: "print", setHeader });
@@ -102,7 +102,7 @@ describe("createHogBrandingExtension", () => {
const { pi, handlers } = fakePi();
const setHeader = vi.fn();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
const ctx = fakeCtx({ mode: "tui", setHeader });
@@ -127,7 +127,7 @@ describe("createHogBrandingExtension", () => {
const { pi, handlers } = fakePi();
const setHeader = vi.fn();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
const ctx = fakeCtx({ mode: "tui", setHeader });
@@ -148,7 +148,7 @@ describe("createHogBrandingExtension", () => {
it("sets a Hog-branded terminal title on session_start, with and without a session name", async () => {
const { pi, handlers } = fakePi();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
const setTitleNoName = vi.fn();
@@ -156,7 +156,7 @@ describe("createHogBrandingExtension", () => {
{} as SessionStartEvent,
fakeCtx({ cwd: "/home/user/my-project", setTitle: setTitleNoName }),
);
- expect(setTitleNoName).toHaveBeenCalledWith("hog - my-project");
+ expect(setTitleNoName).toHaveBeenCalledWith("hogness - my-project");
const setTitleWithName = vi.fn();
await handlers.session_start[0]?.(
@@ -167,13 +167,15 @@ describe("createHogBrandingExtension", () => {
setTitle: setTitleWithName,
}),
);
- expect(setTitleWithName).toHaveBeenCalledWith("hog - fix-bug - my-project");
+ expect(setTitleWithName).toHaveBeenCalledWith(
+ "hogness - fix-bug - my-project",
+ );
});
it("updates the terminal title on session_info_changed", async () => {
const { pi, handlers } = fakePi();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
expect(pi.on).toHaveBeenCalledWith(
@@ -194,14 +196,14 @@ describe("createHogBrandingExtension", () => {
}),
);
- expect(setTitle).toHaveBeenCalledWith("hog - renamed - my-project");
+ expect(setTitle).toHaveBeenCalledWith("hogness - renamed - my-project");
});
it("re-applies the branded title on the next tick to win the race against pi's own updateTerminalTitle()", async () => {
vi.useFakeTimers();
try {
const { pi, handlers } = fakePi();
- const extension = createHogBrandingExtension();
+ const extension = createHognessBrandingExtension();
await extension(pi);
const setTitle = vi.fn();
@@ -210,7 +212,7 @@ describe("createHogBrandingExtension", () => {
// Set immediately...
expect(setTitle).toHaveBeenCalledTimes(1);
- expect(setTitle).toHaveBeenLastCalledWith("hog - my-project");
+ expect(setTitle).toHaveBeenLastCalledWith("hogness - my-project");
// Simulate pi's own interactive-mode stomping the title synchronously
// right after our handler resolves, as it does in practice.
@@ -219,7 +221,7 @@ describe("createHogBrandingExtension", () => {
// ...and re-applied on the next tick, winning the race.
vi.runAllTimers();
- expect(setTitle).toHaveBeenLastCalledWith("hog - my-project");
+ expect(setTitle).toHaveBeenLastCalledWith("hogness - my-project");
} finally {
vi.useRealTimers();
}
diff --git a/packages/agent/packages/harness/src/extensions/hog-branding/extension.ts b/packages/agent/packages/harness/src/extensions/hogness-branding/extension.ts
similarity index 94%
rename from packages/agent/packages/harness/src/extensions/hog-branding/extension.ts
rename to packages/agent/packages/harness/src/extensions/hogness-branding/extension.ts
index ceca62a257da..70e4b6da1ada 100644
--- a/packages/agent/packages/harness/src/extensions/hog-branding/extension.ts
+++ b/packages/agent/packages/harness/src/extensions/hogness-branding/extension.ts
@@ -13,11 +13,11 @@ import {
} from "@earendil-works/pi-coding-agent";
import type { Component } from "@earendil-works/pi-tui";
import {
- HOG_APP_NAME as BRAND_NAME,
- HOG_BRAND_TAGLINE as BRAND_TAGLINE,
+ HOGNESS_APP_NAME as BRAND_NAME,
+ HOGNESS_BRAND_TAGLINE as BRAND_TAGLINE,
} from "./brand-env";
-export interface HogBrandingOptions {
+export interface HognessBrandingOptions {
/** Override the version string shown in the header (defaults to the pi package version). */
version?: string;
}
@@ -110,8 +110,8 @@ function setBrandedTitle(ctx: ExtensionContext): void {
setTimeout(() => ctx.ui.setTitle(title), 0);
}
-export function createHogBrandingExtension(
- options: HogBrandingOptions = {},
+export function createHognessBrandingExtension(
+ options: HognessBrandingOptions = {},
): ExtensionFactory {
return async (pi: ExtensionAPI) => {
pi.on("session_start", async (_event, ctx) => {
@@ -128,5 +128,5 @@ export function createHogBrandingExtension(
}
export default function hogBranding(pi: ExtensionAPI): void | Promise<void> {
- return createHogBrandingExtension()(pi);
+ return createHognessBrandingExtension()(pi);
}
diff --git a/packages/agent/packages/harness/src/extensions/hog-branding/index.ts b/packages/agent/packages/harness/src/extensions/hogness-branding/index.ts
similarity index 73%
rename from packages/agent/packages/harness/src/extensions/hog-branding/index.ts
rename to packages/agent/packages/harness/src/extensions/hogness-branding/index.ts
index 909b3b8d7362..121e0012fa7a 100644
--- a/packages/agent/packages/harness/src/extensions/hog-branding/index.ts
+++ b/packages/agent/packages/harness/src/extensions/hogness-branding/index.ts
@@ -3,7 +3,7 @@
// pi's startup banner derives an extension's display name from its file
// path: a trailing `index.ts`/`index.js` segment is dropped in favor of the
// parent directory name, so loading this file (instead of `./extension.ts`
-// directly) makes the extension show as `hog-branding` instead of
-// `hog-branding/extension.js`. `./extension.ts` remains the real
+// directly) makes the extension show as `hogness-branding` instead of
+// `hogness-branding/extension.js`. `./extension.ts` remains the real
// implementation per the convention in `../README.md`.
export { default } from "./extension";
diff --git a/packages/agent/packages/harness/src/extensions/registry.ts b/packages/agent/packages/harness/src/extensions/registry.ts
index 957edea69136..4c7cb4a67314 100644
--- a/packages/agent/packages/harness/src/extensions/registry.ts
+++ b/packages/agent/packages/harness/src/extensions/registry.ts
@@ -8,8 +8,8 @@ import {
HARNESS_EXTENSION_ENTRYPOINTS,
type HarnessExtensionName,
} from "./entrypoints";
-import type { HogBrandingOptions } from "./hog-branding/extension";
-import { createHogBrandingExtension } from "./hog-branding/extension";
+import type { HognessBrandingOptions } from "./hogness-branding/extension";
+import { createHognessBrandingExtension } from "./hogness-branding/extension";
import type { McpConfig } from "./mcp/config";
import { createMcpExtension } from "./mcp/extension";
import { createOrchestrationExtension } from "./orchestration/extension";
@@ -22,7 +22,7 @@ import { createRtkExtension } from "./rtk/extension";
import { createWebAccessExtension } from "./web-access/extension";
export type HarnessExtensionOptions = PosthogProviderOptions &
- HogBrandingOptions &
+ HognessBrandingOptions &
PosthogMcpPolicyOptions & {
runtimeMcpServers?: McpConfig["mcpServers"];
};
@@ -33,7 +33,7 @@ interface HarnessExtension {
}
const EXTENSIONS: HarnessExtension[] = [
- { name: "hog-branding", create: createHogBrandingExtension },
+ { name: "hogness-branding", create: createHognessBrandingExtension },
{ name: "posthog-provider", create: createPosthogProviderExtension },
{ name: "product-engineer", create: () => createProductEngineerExtension() },
{ name: "current-work", create: () => createCurrentWorkExtension() },
diff --git a/packages/agent/packages/harness/src/runtime.test.ts b/packages/agent/packages/harness/src/runtime.test.ts
index 1917962108e4..0f846e5feb5e 100644
--- a/packages/agent/packages/harness/src/runtime.test.ts
+++ b/packages/agent/packages/harness/src/runtime.test.ts
@@ -54,7 +54,7 @@ describe("createHarnessRuntime", () => {
.extensions.map((extension) => extension.path);
expect(extensionPaths).toEqual(
expect.arrayContaining([
- "<inline:hog-branding>",
+ "<inline:hogness-branding>",
"<inline:posthog-provider>",
"<inline:current-work>",
"<inline:web-access>",
diff --git a/packages/agent/packages/harness/src/runtime.ts b/packages/agent/packages/harness/src/runtime.ts
index 961f9e845e4a..3d806b019547 100644
--- a/packages/agent/packages/harness/src/runtime.ts
+++ b/packages/agent/packages/harness/src/runtime.ts
@@ -11,7 +11,7 @@ import type {
CreateAgentSessionRuntimeFactory,
CreateAgentSessionServicesOptions,
} from "@earendil-works/pi-coding-agent";
-import { installHogBrandEnv } from "./extensions/hog-branding/brand-env";
+import { installHognessBrandEnv } from "./extensions/hogness-branding/brand-env";
import {
POSTHOG_PROVIDER_NAME,
type PosthogOAuthCredentials,
@@ -79,7 +79,7 @@ export async function createHarnessRuntime(
} = options;
// Pi reads its application branding when the SDK is first evaluated. Keep
// every runtime import below dynamic so this always happens first.
- installHogBrandEnv();
+ installHognessBrandEnv();
const pi = await import("@earendil-works/pi-coding-agent");
const [{ harnessExtensions }, { DEFAULT_MODEL }] = await Promise.all([