open-index/open-npm huggingface dataset:
npm package: @tailchi/cli
Description: CLI for tailing tailchi flows in real-time.
Latest version: 0.3.2

# @tailchi/cli

CLI for tailing tailchi flows in real-time.

## Installation

```bash
npm install -g @tailchi/cli
```

## Usage

```bash
# Tail the default events file
tailchi tail

# Tail a specific file
tailchi tail .hounddog/events.jsonl

# Tail from the beginning
tailchi tail --from-start

# Custom clock daemon port
tailchi tail --clock-port 8888
```

## Output

```
🥋 tailchi
clock daemon: http://localhost:9999/clock
watching: .hounddog/events.jsonl

┌──────────────────────────────────────────────────────────┐
│ Flow get-users started                                   │
├──────────────────────────────────────────────────────────┤
│ 👤 usr.button.click                              +0ms
│ 📤 out.http.sent url=http://localhost:4000/api   +3ms
│ 📥 in.http.received GET path=/api/users          +5ms
│ 💾 db.findMany table=User                        +0ms
│ 💾 db.findMany.done table=User (12ms)           +12ms
│ 📤 out.http.responded 200 (15ms)                 +3ms
│ 📥 in.http.response 200 (23ms)                   +5ms
└──────────────────────────────────────────────────────────┘
```

## Clock Daemon

The CLI automatically starts a clock daemon on port 9999. Services can sync to this for accurate cross-service timing:

```typescript
configureHounddog({
  service: 'api',
  clockDaemon: 'http://localhost:9999',
});
```

## Icons

| Icon | Label | Meaning |
|------|-------|---------|
| 👤 | usr | User interaction |
| 📤 | out | Outgoing HTTP |
| 📥 | in | Incoming HTTP |
| 💾 | db | Database |
| 🔧 | wrk | Generic work |
| 📬 | que | Queue/Job |
| 📦 | cch | Cache |
| 🔐 | ath | Auth |
| ❌ | err | Error |
| 💬 | inf | Info |
npm package: @tailchi/fetch
Description: Browser fetch instrumentation for tailchi. Automatically traces all fetch requests.
Latest version: 0.3.0

# @tailchi/fetch

Browser fetch instrumentation for tailchi. Automatically traces all fetch requests.

## Installation

```bash
npm install @tailchi/core @tailchi/fetch
```

## Usage

```typescript
import { configureHounddog } from '@tailchi/core';
import { enableHoundFetch } from '@tailchi/fetch';

// Configure core first
configureHounddog({
  service: 'web',
  sink: {
    kind: 'http',
    endpoint: 'http://localhost:4000/__hound/events',
  },
});

// Patch global fetch
enableHoundFetch();

// All fetch calls are now instrumented
await fetch('/api/users');
```

## Events Emitted

For each fetch request:

- `http.sent` - Request initiated
- `http.response` - Response received (with status and duration)

## Flow Propagation

The instrumented fetch automatically:
- Propagates flow IDs via the `x-hound-flow` header
- Creates a new flow if none exists
- Skips internal `/__hound/events` requests

## Example Output

```
│ 📤 out.http.sent url=http://localhost:4000/api/users +0ms
│ 📥 in.http.response 200 (45ms) url=http://localhost:4000/api/users +45ms
```
npm package: @tailchi/prisma
Description: Prisma instrumentation for tailchi. Traces all database queries with table names and timing.
Latest version: 0.3.0

# @tailchi/prisma

Prisma instrumentation for tailchi. Traces all database queries with table names and timing.

## Installation

```bash
npm install @tailchi/core @tailchi/prisma @prisma/client
```

## Usage

```typescript
import { PrismaClient } from '@prisma/client';
import { instrumentPrisma } from '@tailchi/prisma';

// Wrap Prisma client (enable query logging for SQL capture)
export const prisma = instrumentPrisma(
  new PrismaClient({
    log: [{ emit: 'event', level: 'query' }],
  }),
);

// All queries are now instrumented
const users = await prisma.user.findMany();
```

## Events Emitted

For each query:

- `db.<operation>` - Query started (e.g., `db.findMany`)
- `db.<operation>.done` - Query completed (with table, duration)

## Example Output

```
│ 💾 db.findMany table=User +0ms
│ 💾 db.findMany.done table=User (12ms) +12ms
```

## Supported Operations

All Prisma model operations are traced:
- `findMany`, `findUnique`, `findFirst`
- `create`, `createMany`
- `update`, `updateMany`
- `delete`, `deleteMany`
- `upsert`
- `count`, `aggregate`, `groupBy`

## SQL Capture

To capture SQL queries (stored in event attrs), configure Prisma with query logging:

```typescript
new PrismaClient({
  log: [{ emit: 'event', level: 'query' }],
})
```

Without this, you still get table name and timing, just not the raw SQL.