Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

developing-the-cli

БесплатноБез исполняемых скриптовНе проверен

Changes PostHog's command line in this repo, which ships as two CLIs that must stay in step: posthog-cli, the Rust CLI in `cli/`, and hog, its TypeScript…

PostHogот PostHog★ 41 278 звёзд на GitHub

Об этом скилле

Developing the CLI

PostHog has two command lines in this repo:

CLI Folder Language Status
posthog-cli cli/ Rust Published. Customers and the SDK build integrations run it today
hog hog/ TypeScript, Bun The successor, published as hog on npm, Homebrew and the install script. See hog/README.md

hog hands the file work of hog error-tracking to hog-worker, a Rust program in hog/worker/ that ships next to the hog binary.

Both stay in use until every caller moves to hog, so both must behave the same.

Change both CLIs

A change to one CLI is REQUIRED to land in the other one, in the same PR. This covers features, bug fixes, error handling, new flags, and security fixes. A fix that lands only in cli/ leaves the bug in hog, and the reverse ships a hog that posthog-cli users never get.

The only exceptions are commands that exist on one side:

  • hog-only commands, such as hog setup, hog api, hog ci and hog auth migrate, have no Rust counterpart.
  • The migration guide lists the posthog-cli commands that don't come to hog. A change to those touches only cli/. The guide lives in contents/docs/cli/migrating.mdx in PostHog/posthog.com.

Symbol code is copied, not shared. A file in hog/worker/src/ that copies posthog-cli code names its cli/ source files in its first comment. A change to one of those cli/ files must land in the matching hog/worker/src/ file in the same PR, the reverse too, and hog/test/parity/ must pass. A crate that decides a written byte, such as sourcemap or posthog-symbol-data, is pinned in hog/worker/Cargo.toml to its version in cli/Cargo.lock, and hog/test/parity/worker-pins.test.ts fails until both sides match. Raise both together.

When a change does not apply to the other CLI, say why in the PR description, for example "hog prints only the error message, which never contains the URL". Reviewers: a PR that touches cli/src/ or hog/src/ without the other side, and without that sentence, is incomplete.

Find the matching code

Port the behavior, not the code. The two CLIs are laid out differently. The one exception is the symbol code in hog/worker/, which is copied.

  1. Map the command with the commands table in the migration guide (sourcemap upload becomes error-tracking upload, and so on).

  2. Find the hog side with the layout table in hog/AGENTS.md. Common pairs:

    posthog-cli hog
    cli/src/api/symbol_sets.rs (upload protocol) hog/src/error-tracking/upload.ts
    cli/src/sourcemaps/, debug_symbols/, dsym/, proguard/ (reading, rewriting and packing files) hog/worker/src/, copied
    The flags, skips, warnings and output of those commands hog/src/error-tracking/run.ts, pairs.ts, native.ts
    cli/src/release/, cli/src/utils/git.rs hog/src/error-tracking/release.ts, git.ts
    cli/src/login.rs hog/src/commands/auth/, hog/src/posthog/
    cli/src/experimental/ hog/src/commands/query/, endpoints/, schema/
  3. Check how the runtimes differ before copying a fix. For example, reqwest puts the request URL in its error text, while Bun's fetch keeps it off error.message, so a redaction needed in Rust may not be needed in hog. Verify such a difference, then name it in the PR.

Follow each side's rules

  • hog: read hog/AGENTS.md before the first edit. It holds the command, output, error and typed-boundary rules, and the rules for hog-worker and its protocol.
  • Uploads: hog must send the same bytes, content hashes and requests as posthog-cli, or re-uploads fail with content_hash_mismatch. Read hog/test/parity/README.md before changing anything that reaches an upload. When a Rust change alters what posthog-cli uploads, regenerate the goldens from the new binary as that README describes, and review the diff.
  • Releases: every user-visible c
Полный SKILL.md на GitHub

Установить developing-the-cli в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл developing-the-cli?

Changes PostHog's command line in this repo, which ships as two CLIs that must stay in step: posthog-cli, the Rust CLI in `cli/`, and hog, its TypeScript successor in `hog/`. Use before writing, fixing, or reviewing code under `cli/` or `hog/`, including symbol and sourcemap uploads, dSYM, Hermes and ProGuard handling, releases, login and credentials, query, endpoints, and schema commands, or a security fix in either CLI. Carries the rule that every change lands in both CLIs, how to find the matching code on the other side, the upload parity goldens, and the test and release steps for each. Trigger terms: posthog-cli, hog CLI, cli/, hog/, cargo, bun, symbol_sets.rs, upload.ts, parity golden, sampo changeset, port to hog.

Как установить скилл developing-the-cli?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл developing-the-cli запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить developing-the-cli с