# awake: keep your Mac running with the lid closed
URL: https://crafter.run/en/docs/awake
`@crafter/awake` does the one thing `caffeinate` can't: **keep your Mac running after you close the lid.** One command before you bag the laptop, a launchd-backed timer that restores normal sleep on its own, and `--json` everywhere so your coding agent can drive it.
## Why not caffeinate? [#why-not-caffeinate]
macOS force-sleeps a laptop the moment the lid closes, no matter which assertions are held. The only switch that survives a closed lid is `pmset disablesleep`, which needs root and ships with zero guardrails. awake wraps exactly that switch with the ergonomics it deserves.
| | caffeinate | @crafter/awake |
| ----------------------------- | ---------- | ---------------- |
| Prevent idle sleep | Yes | Yes |
| Survive a closed lid | No | Yes |
| Auto-off timer | No | Yes (default 1h) |
| Visible state in the menu bar | No | Yes |
| JSON output for agents | No | Every command |
## Install [#install]
```bash
npm i -g @crafter/awake
```
One-time setup, asks for your password once and installs a sudoers rule scoped to exactly two `pmset` commands (nothing else gets elevated, `awake setup --uninstall` removes it):
```bash
awake setup
```
## Usage [#usage]
```bash
awake on # keep the Mac awake for 1 hour (the safe default)
awake on 3h # durations: 30m, 2h, 1h30m, bare numbers are minutes
awake on --forever # no timer, until you turn it off
awake off # restore normal sleep now
awake status # state, timer, battery
```
Close the lid mid-task and the task keeps running. The timer flips everything back by itself and sends a notification when it fires, even after a crash or reboot. `awake status` warns when you are on battery power.
## For agents [#for-agents]
Output is JSON automatically when piped. Errors land on stderr as `{"error": {"code", "message", "hint"}}`. Exit codes: 0 success, 1 error, 3 setup required (a human must run `awake setup` once). The full contract lives in [AGENTS.md](https://github.com/crafter-station/awake/blob/main/AGENTS.md).
```bash
awake on 2h --json # before a long unattended task
awake status --json # {"data":{"enabled":true,"remaining_seconds":7080,...}}
awake off --json # done early, restore normal sleep
```
## Commands [#commands]
| Command | Description |
| --------------------- | ----------------------------------------------------------------- |
| `awake on [duration]` | Keep the Mac awake (default 1h, re-running reschedules the timer) |
| `awake off` | Restore normal sleep (idempotent) |
| `awake status` | Current state, timer, battery |
| `awake setup` | One-time passwordless authorization (`--check`, `--uninstall`) |
## Menu bar app [#menu-bar-app]
A SwiftUI companion (macOS 13+) with one-click durations and a live countdown next to the clock. Same repo, same CLI underneath: `./mac/build-app.sh`.
## Links [#links]
* [Website](https://awake.crafter.run)
* [GitHub](https://github.com/crafter-station/awake)
* [npm](https://www.npmjs.com/package/@crafter/awake)
---
# Crafter Station Docs
URL: https://crafter.run/en/docs
Crafter Station builds open source developer tools. Every tool here is installable from npm, works with `npx`/`bunx` without a global install, and is designed to be usable by both humans and AI coding agents.
## Install anything, instantly [#install-anything-instantly]
Every CLI works without installation:
```bash
npx @crafter/trx recording.mp4
npx @crafter/mermaid-cli diagram.mmd
bunx @crafter/skillkit scan
```
## Source code [#source-code]
All tools are MIT licensed and developed in the open at [github.com/crafter-station](https://github.com/crafter-station).
---
# Render Mermaid diagrams without a browser
URL: https://crafter.run/en/docs/mermaid
`@crafter/mermaid` is a Mermaid rendering engine built from scratch: it parses, lays out, and renders Mermaid diagrams in **30.5KB (min+gzip)** with **zero dependencies** and a **synchronous API**. No headless browser, no 2MB bundle.
| | mermaid.js | @crafter/mermaid |
| ------------ | ---------- | ---------------- |
| Bundle | \~2MB | 30.5KB gzipped |
| Dependencies | 50+ | Zero |
| API | Async | Sync |
## Install [#install]
```bash
bun add @crafter/mermaid
```
## Quick start [#quick-start]
```ts
import { render } from "@crafter/mermaid"
const svg = render(`
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Success]
B -->|No| D[Failure]
`)
document.getElementById("diagram").innerHTML = svg
```
## The suite [#the-suite]
The umbrella package re-exports a set of small, focused packages. Use them individually when you only need one stage of the pipeline:
| Package | Size | What it does |
| --------------------------- | ------ | ----------------------- |
| `@crafter/mermaid` | \<1KB | Umbrella package |
| `@crafter/mermaid-parser` | \~8KB | Mermaid text to AST |
| `@crafter/mermaid-layout` | \~14KB | AST to positioned graph |
| `@crafter/mermaid-renderer` | \~17KB | Positioned graph to SVG |
| `@crafter/mermaid-themes` | \~2KB | 30 theme presets |
| `@crafter/mermaid-cli` | \<1KB | Terminal renderer |
| `@crafter/mermaid-player` | \~3KB | Step-through animation |
## Render from the terminal [#render-from-the-terminal]
```bash
npx @crafter/mermaid-cli diagram.mmd
```
## Links [#links]
* [GitHub](https://github.com/crafter-station/mermaid)
* [npm](https://www.npmjs.com/package/@crafter/mermaid)
---
# neon-cli: Neon usage and billing from the terminal
URL: https://crafter.run/en/docs/neon-cli
`@crafter/neon-cli` answers the one question the Neon dashboard won't: **where is my money going, by project, right now?** A colored, sortable, per-project breakdown of compute hours, storage, and egress, in the terminal in \~200ms, with `--json` for agents.
## Why not neonctl? [#why-not-neonctl]
The official `neonctl` is great for resource management but does not expose the consumption history endpoint. This CLI hits the same v2 consumption endpoint Neon uses for billing (`/consumption_history/v2/projects`), so the numbers match your invoice, and `neon invoice` proves it down to the cent.
| | neonctl | @crafter/neon-cli |
| ------------------------------- | ------- | --------------------------------- |
| Projects, branches, endpoints | Yes | Read-only (writes on the roadmap) |
| Per-project consumption history | No | Yes |
| Invoice reconciliation | No | Yes |
| JSON output for agents | Partial | Every command |
## Install [#install]
```bash
npm i -g @crafter/neon-cli
```
Or run one-shot without installing:
```bash
npx @crafter/neon-cli usage --json
```
## Auth [#auth]
Get an API key at [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys), then:
```bash
neon auth login # prompts for the key, stores it at ~/.neon/config.json (mode 0600)
# or
export NEON_API_KEY=napi_... # env var always wins
```
## Usage [#usage]
```bash
neon usage # this month, daily, all projects
neon usage --last 24h --granularity hourly # last 24 hours, hourly buckets
neon usage --project shy-darkness-12345 # one project + per-bucket chart
neon usage --org org_abc123 # scope to one org
neon usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Granularity limits (per Neon's API): `hourly` covers the last 168 hours, `daily` the last 60 days, `monthly` the last year.
## Commands [#commands]
| Command | Description |
| --------------- | ---------------------------------------------------------- |
| `neon usage` | Per-project consumption history (compute, storage, egress) |
| `neon billing` | Current-period running totals |
| `neon invoice` | Reconcile your bill against the API, to the cent |
| `neon projects` | List projects |
| `neon orgs` | List organizations |
| `neon auth` | login / status / whoami / logout |
## Links [#links]
* [GitHub](https://github.com/crafter-station/neon-cli)
* [npm](https://www.npmjs.com/package/@crafter/neon-cli)
---
# skillkit: observability for AI agent skills
URL: https://crafter.run/en/docs/skillkit
AI coding agents load skills into their context window on every session. More skills means less room for your actual code. `skillkit` answers which skills you actually use, whether they help, and what they cost, with usage analytics, conflict detection, cost analysis, and context budget monitoring. Everything runs locally on your machine.
## Prerequisites [#prerequisites]
skillkit requires [Bun](https://bun.sh) as its runtime (native SQLite and fast TypeScript execution):
```bash
curl -fsSL https://bun.sh/install | bash
```
## Quick start [#quick-start]
No install needed:
```bash
bunx @crafter/skillkit scan
bunx @crafter/skillkit stats
bunx @crafter/skillkit health
```
Or install globally:
```bash
bun add -g @crafter/skillkit
skillkit scan
```
`npm i -g` also works if Bun is installed, since the bin entry uses Bun as its runtime.
## Commands [#commands]
| Command | Description |
| -------------------------------- | ----------------------------------------------------- |
| `skillkit scan` | Discover installed skills and index session data |
| `skillkit list` | List installed skills with size and context budget |
| `skillkit stats` | Usage analytics with sparklines (last 30 days) |
| `skillkit health` | Health check: unused skills, context budget, DB |
| `skillkit prune` | Remove unused skills to reclaim context budget |
| `skillkit burn` | Subscription burn rate analysis (cost, models, daily) |
| `skillkit conflicts` | Test skills for trigger collisions |
| `skillkit coverage ` | Analyze dead weight in a skill |
| `skillkit trace ` | Run and record a skill execution trace |
## skill-creator vs skillkit [#skill-creator-vs-skillkit]
Anthropic's [skill-creator](https://github.com/anthropics/skill-creator) handles skill authoring and evaluation. skillkit handles production observability. No overlap.
## Links [#links]
* [GitHub](https://github.com/crafter-station/skillkit)
* [npm](https://www.npmjs.com/package/@crafter/skillkit)
* Install skills via [skills.sh](https://skills.sh): `npx skills add `
---
# trx: transcribe audio and video from the CLI
URL: https://crafter.run/en/docs/trx
`trx` downloads media with yt-dlp, cleans audio with ffmpeg, and transcribes it using a local Whisper model. It outputs `.wav`, `.srt`, `.txt`, and JSON, and it is designed for AI agents first: JSON output, dry-run validation, field filtering, and runtime schema introspection.
## Install [#install]
```bash
bun add -g @crafter/trx
trx init
```
## Quick start [#quick-start]
Transcribe a local file:
```bash
trx recording.mp4
```
Transcribe from a URL (YouTube and anything yt-dlp supports):
```bash
trx "https://youtube.com/watch?v=..."
```
## Agent-friendly usage [#agent-friendly-usage]
Machine-readable output, designed to be called from scripts and AI agents:
```bash
# JSON output
trx transcribe video.mp4 --output json
# Only the text field
trx transcribe video.mp4 --fields text --output json
# Validate without executing
trx transcribe video.mp4 --dry-run --output json
# Inspect the command schema at runtime
trx schema transcribe
```
## Language support [#language-support]
```bash
trx transcribe video.mp4 --language es
```
## Model sizes [#model-sizes]
Whisper models range from tiny (75MB) to large (3GB). Pick the size that fits your accuracy and speed needs during `trx init`.
## Links [#links]
* [GitHub](https://github.com/crafter-station/trx)
* [npm](https://www.npmjs.com/package/@crafter/trx)
---
# Check your Neon Postgres usage from the terminal
URL: https://crafter.run/en/docs/guides/neon-usage-terminal
```bash
npx @crafter/neon-cli usage --last 24h --granularity hourly
```
That prints a colored, sortable, per-project breakdown of compute hours, storage, and egress for the last 24 hours, sourced from the same v2 consumption endpoint Neon uses for billing, so the numbers match your invoice.
```
usage by project
PROJECT ID COMPUTE ROOT BR CHILD BR EGRESS
──────────────── ──────────────────────────── ───────── ─────── ──────── ──────
maca.sh red-firefly-70089523 0.25 CU·h 43.4 KB 0 B 173 KB
devphotos tiny-sky-12271004 0.00 CU·h 42.8 KB 0 B 0 B
```
## Setup [#setup]
Get an API key at [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys):
```bash
export NEON_API_KEY=napi_...
# or store it: npx @crafter/neon-cli auth login
```
## Drill into one project [#drill-into-one-project]
```bash
npx @crafter/neon-cli usage --project shy-darkness-12345
```
## Where is my money going this month? [#where-is-my-money-going-this-month]
```bash
npx @crafter/neon-cli billing # current-period running totals
npx @crafter/neon-cli invoice # reconcile against your bill, to the cent
```
## JSON for agents and CI [#json-for-agents-and-ci]
```bash
npx @crafter/neon-cli usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Note: the official `neonctl` doesn't expose consumption history at all. Full comparison: [neon-cli docs](/en/docs/neon-cli).
---
# Render a Mermaid diagram from the CLI
URL: https://crafter.run/en/docs/guides/render-mermaid-cli
```bash
npx @crafter/mermaid-cli diagram.mmd
```
That renders the diagram in your terminal with ANSI colors and Unicode box drawing. No headless browser, no Chromium download: the whole engine is 30.5KB.
## From stdin [#from-stdin]
```bash
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cli
```
## Pick a theme [#pick-a-theme]
```bash
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 available
```
## Options [#options]
| Flag | Description |
| ---------------- | ------------------------------------- |
| `--theme ` | Theme name (default: `one-hunter`) |
| `--width ` | Terminal width (default: auto-detect) |
| `--compact` | Compact spacing |
| `--list-themes` | List all 30 themes |
## Install permanently [#install-permanently]
```bash
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmd
```
## How is this different from @mermaid-js/mermaid-cli? [#how-is-this-different-from-mermaid-jsmermaid-cli]
The official `@mermaid-js/mermaid-cli` renders by launching a headless Chromium via Puppeteer, a heavyweight install that doesn't work in many CI/sandbox environments. `@crafter/mermaid-cli` uses [@crafter/mermaid](/en/docs/mermaid), a from-scratch rendering engine with zero dependencies and a synchronous API, so it runs anywhere Node runs, instantly.
Need SVG output instead of terminal rendering? Use the library directly:
```ts
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")
```
---
# Transcribe a YouTube video from the command line
URL: https://crafter.run/en/docs/guides/transcribe-youtube-cli
```bash
npx @crafter/trx "https://youtube.com/watch?v=dQw4w9WgXcQ"
```
That downloads the video's audio with yt-dlp, cleans it with ffmpeg, and transcribes it with a local Whisper model. You get `.txt`, `.srt`, `.wav`, and JSON outputs. Everything runs on your machine: free, private, no API key.
First run? Initialize once to pick a Whisper model size (tiny 75MB to large 3GB):
```bash
npx @crafter/trx init
```
trx requires [Bun](https://bun.sh) as its runtime.
## Local files work the same way [#local-files-work-the-same-way]
```bash
npx @crafter/trx recording.mp4
```
## Get just the text, as JSON [#get-just-the-text-as-json]
```bash
npx @crafter/trx transcribe video.mp4 --fields text --output json
```
## Other languages [#other-languages]
```bash
npx @crafter/trx transcribe video.mp4 --language es
```
## For scripts and AI agents [#for-scripts-and-ai-agents]
`trx` is agent-first: JSON output, dry-run validation, and runtime schema introspection.
```bash
npx @crafter/trx transcribe video.mp4 --dry-run --output json # validate without executing
npx @crafter/trx schema transcribe # inspect the command schema
```
Full reference: [trx docs](/en/docs/trx).
---
# awake: mantén tu Mac funcionando con la tapa cerrada
URL: https://crafter.run/es/docs/awake
`@crafter/awake` hace lo único que `caffeinate` no puede: **mantener tu Mac funcionando después de cerrar la tapa.** Un comando antes de guardar el portátil en la mochila, un temporizador respaldado por launchd que restaura el sueño normal por sí solo, y `--json` en todas partes para que tu agente de código pueda usarlo.
## ¿Por qué no caffeinate? [#por-qué-no-caffeinate]
macOS fuerza el sueño del portátil en el momento en que se cierra la tapa, sin importar qué assertions estén activas. El único interruptor que sobrevive a una tapa cerrada es `pmset disablesleep`, que requiere root y no trae ninguna protección. awake envuelve exactamente ese interruptor con la ergonomía que merece.
| | caffeinate | @crafter/awake |
| ---------------------------------- | ---------- | ------------------- |
| Evitar el sueño por inactividad | Sí | Sí |
| Sobrevivir a la tapa cerrada | No | Sí |
| Temporizador de auto-apagado | No | Sí (1h por defecto) |
| Estado visible en la barra de menú | No | Sí |
| Salida JSON para agentes | No | Todos los comandos |
## Instalación [#instalación]
```bash
npm i -g @crafter/awake
```
Configuración única, pide tu contraseña una vez e instala una regla de sudoers limitada a exactamente dos comandos `pmset` (nada más se eleva, `awake setup --uninstall` la elimina):
```bash
awake setup
```
## Uso [#uso]
```bash
awake on # mantener el Mac despierto 1 hora (el valor seguro por defecto)
awake on 3h # duraciones: 30m, 2h, 1h30m, números sueltos son minutos
awake on --forever # sin temporizador, hasta que lo apagues
awake off # restaurar el sueño normal ahora
awake status # estado, temporizador, batería
```
Cierra la tapa a mitad de una tarea y la tarea sigue corriendo. El temporizador lo restaura todo por sí solo y envía una notificación cuando se dispara, incluso tras un crash o reinicio. `awake status` avisa cuando estás con batería.
## Para agentes [#para-agentes]
La salida es JSON automáticamente cuando se canaliza. Los errores llegan a stderr como `{"error": {"code", "message", "hint"}}`. Códigos de salida: 0 éxito, 1 error, 3 requiere configuración (un humano debe ejecutar `awake setup` una vez). El contrato completo vive en [AGENTS.md](https://github.com/crafter-station/awake/blob/main/AGENTS.md).
```bash
awake on 2h --json # antes de una tarea larga sin supervisión
awake status --json # {"data":{"enabled":true,"remaining_seconds":7080,...}}
awake off --json # terminaste antes, restaurar el sueño normal
```
## Comandos [#comandos]
| Comando | Descripción |
| --------------------- | ---------------------------------------------------------------------------------- |
| `awake on [duración]` | Mantener el Mac despierto (1h por defecto, re-ejecutar reprograma el temporizador) |
| `awake off` | Restaurar el sueño normal (idempotente) |
| `awake status` | Estado actual, temporizador, batería |
| `awake setup` | Autorización única sin contraseña (`--check`, `--uninstall`) |
## App de barra de menú [#app-de-barra-de-menú]
Una compañera en SwiftUI (macOS 13+) con duraciones de un clic y cuenta regresiva en vivo junto al reloj. Mismo repo, misma CLI por debajo: `./mac/build-app.sh`.
## Enlaces [#enlaces]
* [Sitio web](https://awake.crafter.run)
* [GitHub](https://github.com/crafter-station/awake)
* [npm](https://www.npmjs.com/package/@crafter/awake)
---
# Documentación de Crafter Station
URL: https://crafter.run/es/docs
Crafter Station construye herramientas open source para developers. Todas las herramientas se instalan desde npm, funcionan con `npx`/`bunx` sin instalación global, y están diseñadas para ser usadas tanto por humanos como por agentes de IA.
## Instala cualquier herramienta, al instante [#instala-cualquier-herramienta-al-instante]
Todas las CLIs funcionan sin instalación:
```bash
npx @crafter/trx recording.mp4
npx @crafter/mermaid-cli diagram.mmd
bunx @crafter/skillkit scan
```
## Código fuente [#código-fuente]
Todas las herramientas tienen licencia MIT y se desarrollan en abierto en [github.com/crafter-station](https://github.com/crafter-station).
---
# Renderiza diagramas Mermaid sin navegador
URL: https://crafter.run/es/docs/mermaid
`@crafter/mermaid` es un motor de renderizado Mermaid construido desde cero: parsea, distribuye y renderiza diagramas Mermaid en **30.5KB (min+gzip)** con **cero dependencias** y una **API síncrona**. Sin headless browser, sin bundle de 2MB.
| | mermaid.js | @crafter/mermaid |
| ------------ | ---------- | ---------------- |
| Bundle | \~2MB | 30.5KB gzipped |
| Dependencias | 50+ | Cero |
| API | Async | Sync |
## Instalación [#instalación]
```bash
bun add @crafter/mermaid
```
## Inicio rápido [#inicio-rápido]
```ts
import { render } from "@crafter/mermaid"
const svg = render(`
graph TD
A[Inicio] --> B{Decisión}
B -->|Sí| C[Éxito]
B -->|No| D[Fallo]
`)
document.getElementById("diagram").innerHTML = svg
```
## La suite [#la-suite]
El paquete umbrella reexporta un conjunto de paquetes pequeños y enfocados. Úsalos individualmente cuando solo necesites una etapa del pipeline:
| Paquete | Tamaño | Qué hace |
| --------------------------- | ------ | ------------------------ |
| `@crafter/mermaid` | \<1KB | Paquete umbrella |
| `@crafter/mermaid-parser` | \~8KB | Texto Mermaid a AST |
| `@crafter/mermaid-layout` | \~14KB | AST a grafo posicionado |
| `@crafter/mermaid-renderer` | \~17KB | Grafo posicionado a SVG |
| `@crafter/mermaid-themes` | \~2KB | 30 temas predefinidos |
| `@crafter/mermaid-cli` | \<1KB | Renderizador de terminal |
| `@crafter/mermaid-player` | \~3KB | Animación paso a paso |
## Renderiza desde la terminal [#renderiza-desde-la-terminal]
```bash
npx @crafter/mermaid-cli diagram.mmd
```
## Enlaces [#enlaces]
* [GitHub](https://github.com/crafter-station/mermaid)
* [npm](https://www.npmjs.com/package/@crafter/mermaid)
---
# neon-cli: consumo y facturación de Neon desde la terminal
URL: https://crafter.run/es/docs/neon-cli
`@crafter/neon-cli` responde la pregunta que el dashboard de Neon no responde: **¿a dónde se está yendo mi dinero, por proyecto, ahora mismo?** Un desglose por proyecto, con colores y ordenable, de horas de cómputo, almacenamiento y egress, en la terminal en \~200ms, con `--json` para agentes.
## ¿Por qué no neonctl? [#por-qué-no-neonctl]
El `neonctl` oficial es excelente para gestionar recursos, pero no expone el endpoint de historial de consumo. Esta CLI consulta el mismo endpoint v2 de consumo que Neon usa para facturar (`/consumption_history/v2/projects`), así que los números coinciden con tu factura, y `neon invoice` lo comprueba hasta el centavo.
| | neonctl | @crafter/neon-cli |
| --------------------------------- | ------- | --------------------------------------- |
| Proyectos, branches, endpoints | Sí | Solo lectura (escrituras en el roadmap) |
| Historial de consumo por proyecto | No | Sí |
| Conciliación de facturas | No | Sí |
| Salida JSON para agentes | Parcial | Todos los comandos |
## Instalación [#instalación]
```bash
npm i -g @crafter/neon-cli
```
O ejecútala una sola vez sin instalar:
```bash
npx @crafter/neon-cli usage --json
```
## Autenticación [#autenticación]
Consigue una API key en [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys), y luego:
```bash
neon auth login # prompts for the key, stores it at ~/.neon/config.json (mode 0600)
# or
export NEON_API_KEY=napi_... # env var always wins
```
## Uso [#uso]
```bash
neon usage # this month, daily, all projects
neon usage --last 24h --granularity hourly # last 24 hours, hourly buckets
neon usage --project shy-darkness-12345 # one project + per-bucket chart
neon usage --org org_abc123 # scope to one org
neon usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Límites de granularidad (según la API de Neon): `hourly` cubre las últimas 168 horas, `daily` los últimos 60 días, `monthly` el último año.
## Comandos [#comandos]
| Comando | Descripción |
| --------------- | ------------------------------------------------------------------- |
| `neon usage` | Historial de consumo por proyecto (cómputo, almacenamiento, egress) |
| `neon billing` | Totales acumulados del período actual |
| `neon invoice` | Concilia tu factura contra la API, hasta el centavo |
| `neon projects` | Lista los proyectos |
| `neon orgs` | Lista las organizaciones |
| `neon auth` | login / status / whoami / logout |
## Enlaces [#enlaces]
* [GitHub](https://github.com/crafter-station/neon-cli)
* [npm](https://www.npmjs.com/package/@crafter/neon-cli)
---
# skillkit: observabilidad para skills de agentes de IA
URL: https://crafter.run/es/docs/skillkit
Los agentes de código cargan skills en su ventana de contexto en cada sesión. Más skills significa menos espacio para tu código. `skillkit` responde qué skills usas realmente, si ayudan y cuánto cuestan, con analítica de uso, detección de conflictos, análisis de costos y monitoreo del presupuesto de contexto. Todo corre localmente en tu máquina.
## Prerequisitos [#prerequisitos]
skillkit requiere [Bun](https://bun.sh) como runtime (SQLite nativo y ejecución rápida de TypeScript):
```bash
curl -fsSL https://bun.sh/install | bash
```
## Inicio rápido [#inicio-rápido]
Sin instalación:
```bash
bunx @crafter/skillkit scan
bunx @crafter/skillkit stats
bunx @crafter/skillkit health
```
O instala globalmente:
```bash
bun add -g @crafter/skillkit
skillkit scan
```
`npm i -g` también funciona si Bun está instalado, ya que el bin usa Bun como runtime.
## Comandos [#comandos]
| Comando | Descripción |
| -------------------------------- | ----------------------------------------------------- |
| `skillkit scan` | Descubre skills instaladas e indexa datos de sesiones |
| `skillkit list` | Lista skills con tamaño y presupuesto de contexto |
| `skillkit stats` | Analítica de uso con sparklines (últimos 30 días) |
| `skillkit health` | Chequeo de salud: skills sin uso, presupuesto, DB |
| `skillkit prune` | Elimina skills sin uso para recuperar contexto |
| `skillkit burn` | Análisis de burn rate de suscripción (costo, modelos) |
| `skillkit conflicts` | Prueba colisiones de triggers entre skills |
| `skillkit coverage ` | Analiza peso muerto en una skill |
| `skillkit trace ` | Ejecuta y graba el trace de una skill |
## skill-creator vs skillkit [#skill-creator-vs-skillkit]
El [skill-creator](https://github.com/anthropics/skill-creator) de Anthropic cubre la creación y evaluación de skills. skillkit cubre la observabilidad en producción. Sin superposición.
## Enlaces [#enlaces]
* [GitHub](https://github.com/crafter-station/skillkit)
* [npm](https://www.npmjs.com/package/@crafter/skillkit)
* Instala skills vía [skills.sh](https://skills.sh): `npx skills add `
---
# trx: transcribe audio y video desde la CLI
URL: https://crafter.run/es/docs/trx
`trx` descarga medios con yt-dlp, limpia el audio con ffmpeg y lo transcribe usando un modelo Whisper local. Genera `.wav`, `.srt`, `.txt` y JSON, y está diseñado primero para agentes de IA: salida JSON, validación dry-run, filtrado de campos e introspección de schemas en runtime.
## Instalación [#instalación]
```bash
bun add -g @crafter/trx
trx init
```
## Inicio rápido [#inicio-rápido]
Transcribe un archivo local:
```bash
trx recording.mp4
```
Transcribe desde una URL (YouTube y todo lo que soporte yt-dlp):
```bash
trx "https://youtube.com/watch?v=..."
```
## Uso para agentes [#uso-para-agentes]
Salida legible por máquinas, diseñada para scripts y agentes de IA:
```bash
# Salida JSON
trx transcribe video.mp4 --output json
# Solo el campo de texto
trx transcribe video.mp4 --fields text --output json
# Validar sin ejecutar
trx transcribe video.mp4 --dry-run --output json
# Inspeccionar el schema del comando en runtime
trx schema transcribe
```
## Idiomas [#idiomas]
```bash
trx transcribe video.mp4 --language es
```
## Tamaños de modelo [#tamaños-de-modelo]
Los modelos Whisper van desde tiny (75MB) hasta large (3GB). Elige el tamaño según tu necesidad de precisión y velocidad durante `trx init`.
## Enlaces [#enlaces]
* [GitHub](https://github.com/crafter-station/trx)
* [npm](https://www.npmjs.com/package/@crafter/trx)
---
# Revisa tu consumo de Neon Postgres desde la terminal
URL: https://crafter.run/es/docs/guides/neon-usage-terminal
```bash
npx @crafter/neon-cli usage --last 24h --granularity hourly
```
Eso imprime un desglose por proyecto, con colores y ordenable, de horas de cómputo, almacenamiento y egress de las últimas 24 horas, obtenido del mismo endpoint v2 de consumo que Neon usa para facturar, así que los números coinciden con tu factura.
```
usage by project
PROJECT ID COMPUTE ROOT BR CHILD BR EGRESS
──────────────── ──────────────────────────── ───────── ─────── ──────── ──────
maca.sh red-firefly-70089523 0.25 CU·h 43.4 KB 0 B 173 KB
devphotos tiny-sky-12271004 0.00 CU·h 42.8 KB 0 B 0 B
```
## Configuración [#configuración]
Consigue una API key en [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys):
```bash
export NEON_API_KEY=napi_...
# or store it: npx @crafter/neon-cli auth login
```
## Analiza un proyecto en detalle [#analiza-un-proyecto-en-detalle]
```bash
npx @crafter/neon-cli usage --project shy-darkness-12345
```
## ¿A dónde se está yendo mi dinero este mes? [#a-dónde-se-está-yendo-mi-dinero-este-mes]
```bash
npx @crafter/neon-cli billing # current-period running totals
npx @crafter/neon-cli invoice # reconcile against your bill, to the cent
```
## JSON para agentes y CI [#json-para-agentes-y-ci]
```bash
npx @crafter/neon-cli usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Nota: el `neonctl` oficial no expone el historial de consumo en absoluto. Comparación completa: [docs de neon-cli](/es/docs/neon-cli).
---
# Renderiza un diagrama Mermaid desde la CLI
URL: https://crafter.run/es/docs/guides/render-mermaid-cli
```bash
npx @crafter/mermaid-cli diagram.mmd
```
Eso renderiza el diagrama en tu terminal con colores ANSI y cajas Unicode. Sin navegador headless, sin descargar Chromium: el motor completo pesa 30.5KB.
## Desde stdin [#desde-stdin]
```bash
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cli
```
## Elige un tema [#elige-un-tema]
```bash
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 available
```
## Opciones [#opciones]
| Flag | Descripción |
| ---------------- | -------------------------------------------------------- |
| `--theme ` | Nombre del tema (por defecto: `one-hunter`) |
| `--width ` | Ancho de la terminal (por defecto: detección automática) |
| `--compact` | Espaciado compacto |
| `--list-themes` | Lista los 30 temas |
## Instálala de forma permanente [#instálala-de-forma-permanente]
```bash
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmd
```
## ¿En qué se diferencia de @mermaid-js/mermaid-cli? [#en-qué-se-diferencia-de-mermaid-jsmermaid-cli]
La `@mermaid-js/mermaid-cli` oficial renderiza lanzando un Chromium headless vía Puppeteer, una instalación pesada que no funciona en muchos entornos de CI o sandbox. `@crafter/mermaid-cli` usa [@crafter/mermaid](/es/docs/mermaid), un motor de renderizado escrito desde cero, con cero dependencias y una API síncrona, así que corre donde sea que corra Node, al instante.
¿Necesitas salida SVG en lugar de renderizado en terminal? Usa la librería directamente:
```ts
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")
```
---
# Transcribe un video de YouTube desde la línea de comandos
URL: https://crafter.run/es/docs/guides/transcribe-youtube-cli
```bash
npx @crafter/trx "https://youtube.com/watch?v=dQw4w9WgXcQ"
```
Eso descarga el audio del video con yt-dlp, lo limpia con ffmpeg y lo transcribe con un modelo Whisper local. Obtienes salidas en `.txt`, `.srt`, `.wav` y JSON. Todo corre en tu máquina: gratis, privado, sin API key.
¿Primera vez? Inicializa una sola vez para elegir el tamaño del modelo Whisper (desde tiny con 75MB hasta large con 3GB):
```bash
npx @crafter/trx init
```
trx requiere [Bun](https://bun.sh) como runtime.
## Los archivos locales funcionan igual [#los-archivos-locales-funcionan-igual]
```bash
npx @crafter/trx recording.mp4
```
## Obtén solo el texto, como JSON [#obtén-solo-el-texto-como-json]
```bash
npx @crafter/trx transcribe video.mp4 --fields text --output json
```
## Otros idiomas [#otros-idiomas]
```bash
npx @crafter/trx transcribe video.mp4 --language es
```
## Para scripts y agentes de IA [#para-scripts-y-agentes-de-ia]
`trx` es agent-first: salida JSON, validación dry-run e introspección de schemas en runtime.
```bash
npx @crafter/trx transcribe video.mp4 --dry-run --output json # validate without executing
npx @crafter/trx schema transcribe # inspect the command schema
```
Referencia completa: [docs de trx](/es/docs/trx).
---
# awake: mantenha seu Mac rodando com a tampa fechada
URL: https://crafter.run/pt/docs/awake
`@crafter/awake` faz a única coisa que o `caffeinate` não consegue: **manter seu Mac rodando depois de fechar a tampa.** Um comando antes de guardar o notebook na mochila, um timer apoiado no launchd que restaura o sono normal sozinho, e `--json` em tudo para o seu agente de código poder usá-lo.
## Por que não caffeinate? [#por-que-não-caffeinate]
O macOS força o sono do notebook no momento em que a tampa fecha, não importa quais assertions estejam ativas. O único interruptor que sobrevive à tampa fechada é o `pmset disablesleep`, que exige root e vem sem nenhuma proteção. O awake embrulha exatamente esse interruptor com a ergonomia que ele merece.
| | caffeinate | @crafter/awake |
| -------------------------------- | ---------- | ------------------- |
| Evitar sono por inatividade | Sim | Sim |
| Sobreviver à tampa fechada | Não | Sim |
| Timer de auto-desligamento | Não | Sim (1h por padrão) |
| Estado visível na barra de menus | Não | Sim |
| Saída JSON para agentes | Não | Todos os comandos |
## Instalação [#instalação]
```bash
npm i -g @crafter/awake
```
Configuração única, pede sua senha uma vez e instala uma regra de sudoers limitada a exatamente dois comandos `pmset` (nada mais é elevado, `awake setup --uninstall` remove):
```bash
awake setup
```
## Uso [#uso]
```bash
awake on # manter o Mac acordado por 1 hora (o padrão seguro)
awake on 3h # durações: 30m, 2h, 1h30m, números soltos são minutos
awake on --forever # sem timer, até você desligar
awake off # restaurar o sono normal agora
awake status # estado, timer, bateria
```
Feche a tampa no meio de uma tarefa e a tarefa continua rodando. O timer restaura tudo sozinho e envia uma notificação quando dispara, mesmo depois de um crash ou reinício. `awake status` avisa quando você está na bateria.
## Para agentes [#para-agentes]
A saída é JSON automaticamente quando canalizada. Erros chegam no stderr como `{"error": {"code", "message", "hint"}}`. Códigos de saída: 0 sucesso, 1 erro, 3 requer configuração (um humano precisa rodar `awake setup` uma vez). O contrato completo vive em [AGENTS.md](https://github.com/crafter-station/awake/blob/main/AGENTS.md).
```bash
awake on 2h --json # antes de uma tarefa longa sem supervisão
awake status --json # {"data":{"enabled":true,"remaining_seconds":7080,...}}
awake off --json # terminou antes, restaurar o sono normal
```
## Comandos [#comandos]
| Comando | Descrição |
| -------------------- | ----------------------------------------------------------------------- |
| `awake on [duração]` | Manter o Mac acordado (1h por padrão, rodar de novo reprograma o timer) |
| `awake off` | Restaurar o sono normal (idempotente) |
| `awake status` | Estado atual, timer, bateria |
| `awake setup` | Autorização única sem senha (`--check`, `--uninstall`) |
## App de barra de menus [#app-de-barra-de-menus]
Uma companheira em SwiftUI (macOS 13+) com durações de um clique e contagem regressiva ao vivo ao lado do relógio. Mesmo repo, mesma CLI por baixo: `./mac/build-app.sh`.
## Links [#links]
* [Site](https://awake.crafter.run)
* [GitHub](https://github.com/crafter-station/awake)
* [npm](https://www.npmjs.com/package/@crafter/awake)
---
# Documentação da Crafter Station
URL: https://crafter.run/pt/docs
A Crafter Station constrói ferramentas open source para desenvolvedores. Todas as ferramentas são instaláveis via npm, funcionam com `npx`/`bunx` sem instalação global, e são projetadas para serem usadas por humanos e por agentes de IA.
## Instale qualquer ferramenta, instantaneamente [#instale-qualquer-ferramenta-instantaneamente]
Todas as CLIs funcionam sem instalação:
```bash
npx @crafter/trx recording.mp4
npx @crafter/mermaid-cli diagram.mmd
bunx @crafter/skillkit scan
```
## Código fonte [#código-fonte]
Todas as ferramentas têm licença MIT e são desenvolvidas abertamente em [github.com/crafter-station](https://github.com/crafter-station).
---
# Renderize diagramas Mermaid sem navegador
URL: https://crafter.run/pt/docs/mermaid
`@crafter/mermaid` é um motor de renderização Mermaid construído do zero: parseia, posiciona e renderiza diagramas Mermaid em **30.5KB (min+gzip)** com **zero dependências** e uma **API síncrona**. Sem headless browser, sem bundle de 2MB.
| | mermaid.js | @crafter/mermaid |
| ------------ | ---------- | ---------------- |
| Bundle | \~2MB | 30.5KB gzipped |
| Dependências | 50+ | Zero |
| API | Async | Sync |
## Instalação [#instalação]
```bash
bun add @crafter/mermaid
```
## Início rápido [#início-rápido]
```ts
import { render } from "@crafter/mermaid"
const svg = render(`
graph TD
A[Início] --> B{Decisão}
B -->|Sim| C[Sucesso]
B -->|Não| D[Falha]
`)
document.getElementById("diagram").innerHTML = svg
```
## A suíte [#a-suíte]
O pacote umbrella reexporta um conjunto de pacotes pequenos e focados. Use-os individualmente quando precisar de apenas uma etapa do pipeline:
| Pacote | Tamanho | O que faz |
| --------------------------- | ------- | -------------------------- |
| `@crafter/mermaid` | \<1KB | Pacote umbrella |
| `@crafter/mermaid-parser` | \~8KB | Texto Mermaid para AST |
| `@crafter/mermaid-layout` | \~14KB | AST para grafo posicionado |
| `@crafter/mermaid-renderer` | \~17KB | Grafo posicionado para SVG |
| `@crafter/mermaid-themes` | \~2KB | 30 temas predefinidos |
| `@crafter/mermaid-cli` | \<1KB | Renderizador de terminal |
| `@crafter/mermaid-player` | \~3KB | Animação passo a passo |
## Renderize pelo terminal [#renderize-pelo-terminal]
```bash
npx @crafter/mermaid-cli diagram.mmd
```
## Links [#links]
* [GitHub](https://github.com/crafter-station/mermaid)
* [npm](https://www.npmjs.com/package/@crafter/mermaid)
---
# neon-cli: consumo e faturamento do Neon pelo terminal
URL: https://crafter.run/pt/docs/neon-cli
`@crafter/neon-cli` responde a pergunta que o dashboard do Neon não responde: **para onde está indo meu dinheiro, por projeto, agora mesmo?** Um detalhamento por projeto, colorido e ordenável, de horas de compute, armazenamento e egress, no terminal em \~200ms, com `--json` para agentes.
## Por que não o neonctl? [#por-que-não-o-neonctl]
O `neonctl` oficial é ótimo para gerenciar recursos, mas não expõe o endpoint de histórico de consumo. Esta CLI consulta o mesmo endpoint v2 de consumo que o Neon usa para faturamento (`/consumption_history/v2/projects`), então os números batem com sua fatura, e `neon invoice` prova isso até o centavo.
| | neonctl | @crafter/neon-cli |
| -------------------------------- | ------- | ------------------------------------- |
| Projetos, branches, endpoints | Sim | Somente leitura (escritas no roadmap) |
| Histórico de consumo por projeto | Não | Sim |
| Conciliação de faturas | Não | Sim |
| Saída JSON para agentes | Parcial | Todos os comandos |
## Instalação [#instalação]
```bash
npm i -g @crafter/neon-cli
```
Ou execute uma única vez sem instalar:
```bash
npx @crafter/neon-cli usage --json
```
## Autenticação [#autenticação]
Pegue uma API key em [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys) e depois:
```bash
neon auth login # prompts for the key, stores it at ~/.neon/config.json (mode 0600)
# or
export NEON_API_KEY=napi_... # env var always wins
```
## Uso [#uso]
```bash
neon usage # this month, daily, all projects
neon usage --last 24h --granularity hourly # last 24 hours, hourly buckets
neon usage --project shy-darkness-12345 # one project + per-bucket chart
neon usage --org org_abc123 # scope to one org
neon usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Limites de granularidade (conforme a API do Neon): `hourly` cobre as últimas 168 horas, `daily` os últimos 60 dias, `monthly` o último ano.
## Comandos [#comandos]
| Comando | Descrição |
| --------------- | ----------------------------------------------------------------- |
| `neon usage` | Histórico de consumo por projeto (compute, armazenamento, egress) |
| `neon billing` | Totais acumulados do período atual |
| `neon invoice` | Concilia sua fatura contra a API, até o centavo |
| `neon projects` | Lista os projetos |
| `neon orgs` | Lista as organizações |
| `neon auth` | login / status / whoami / logout |
## Links [#links]
* [GitHub](https://github.com/crafter-station/neon-cli)
* [npm](https://www.npmjs.com/package/@crafter/neon-cli)
---
# skillkit: observabilidade para skills de agentes de IA
URL: https://crafter.run/pt/docs/skillkit
Agentes de código carregam skills na janela de contexto em cada sessão. Mais skills significa menos espaço para o seu código. `skillkit` responde quais skills você realmente usa, se elas ajudam e quanto custam, com análise de uso, detecção de conflitos, análise de custos e monitoramento do orçamento de contexto. Tudo roda localmente na sua máquina.
## Pré-requisitos [#pré-requisitos]
skillkit requer [Bun](https://bun.sh) como runtime (SQLite nativo e execução rápida de TypeScript):
```bash
curl -fsSL https://bun.sh/install | bash
```
## Início rápido [#início-rápido]
Sem instalação:
```bash
bunx @crafter/skillkit scan
bunx @crafter/skillkit stats
bunx @crafter/skillkit health
```
Ou instale globalmente:
```bash
bun add -g @crafter/skillkit
skillkit scan
```
`npm i -g` também funciona se o Bun estiver instalado, já que o bin usa Bun como runtime.
## Comandos [#comandos]
| Comando | Descrição |
| -------------------------------- | ---------------------------------------------------- |
| `skillkit scan` | Descobre skills instaladas e indexa dados de sessões |
| `skillkit list` | Lista skills com tamanho e orçamento de contexto |
| `skillkit stats` | Análise de uso com sparklines (últimos 30 dias) |
| `skillkit health` | Checagem de saúde: skills sem uso, orçamento, DB |
| `skillkit prune` | Remove skills sem uso para recuperar contexto |
| `skillkit burn` | Análise de burn rate da assinatura (custo, modelos) |
| `skillkit conflicts` | Testa colisões de triggers entre skills |
| `skillkit coverage ` | Analisa peso morto em uma skill |
| `skillkit trace ` | Executa e grava o trace de uma skill |
## skill-creator vs skillkit [#skill-creator-vs-skillkit]
O [skill-creator](https://github.com/anthropics/skill-creator) da Anthropic cobre a criação e avaliação de skills. skillkit cobre a observabilidade em produção. Sem sobreposição.
## Links [#links]
* [GitHub](https://github.com/crafter-station/skillkit)
* [npm](https://www.npmjs.com/package/@crafter/skillkit)
* Instale skills via [skills.sh](https://skills.sh): `npx skills add `
---
# trx: transcreva áudio e vídeo pela CLI
URL: https://crafter.run/pt/docs/trx
`trx` baixa mídia com yt-dlp, limpa o áudio com ffmpeg e transcreve usando um modelo Whisper local. Gera `.wav`, `.srt`, `.txt` e JSON, e é projetado primeiro para agentes de IA: saída JSON, validação dry-run, filtragem de campos e introspecção de schemas em runtime.
## Instalação [#instalação]
```bash
bun add -g @crafter/trx
trx init
```
## Início rápido [#início-rápido]
Transcreva um arquivo local:
```bash
trx recording.mp4
```
Transcreva de uma URL (YouTube e tudo que o yt-dlp suporta):
```bash
trx "https://youtube.com/watch?v=..."
```
## Uso por agentes [#uso-por-agentes]
Saída legível por máquinas, projetada para scripts e agentes de IA:
```bash
# Saída JSON
trx transcribe video.mp4 --output json
# Apenas o campo de texto
trx transcribe video.mp4 --fields text --output json
# Validar sem executar
trx transcribe video.mp4 --dry-run --output json
# Inspecionar o schema do comando em runtime
trx schema transcribe
```
## Idiomas [#idiomas]
```bash
trx transcribe video.mp4 --language pt
```
## Tamanhos de modelo [#tamanhos-de-modelo]
Os modelos Whisper vão de tiny (75MB) até large (3GB). Escolha o tamanho conforme sua necessidade de precisão e velocidade durante o `trx init`.
## Links [#links]
* [GitHub](https://github.com/crafter-station/trx)
* [npm](https://www.npmjs.com/package/@crafter/trx)
---
# Confira o consumo do Neon Postgres pelo terminal
URL: https://crafter.run/pt/docs/guides/neon-usage-terminal
```bash
npx @crafter/neon-cli usage --last 24h --granularity hourly
```
Isso imprime um detalhamento por projeto, colorido e ordenável, de horas de compute, armazenamento e egress das últimas 24 horas, vindo do mesmo endpoint v2 de consumo que o Neon usa para faturamento, então os números batem com sua fatura.
```
usage by project
PROJECT ID COMPUTE ROOT BR CHILD BR EGRESS
──────────────── ──────────────────────────── ───────── ─────── ──────── ──────
maca.sh red-firefly-70089523 0.25 CU·h 43.4 KB 0 B 173 KB
devphotos tiny-sky-12271004 0.00 CU·h 42.8 KB 0 B 0 B
```
## Configuração [#configuração]
Pegue uma API key em [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys):
```bash
export NEON_API_KEY=napi_...
# or store it: npx @crafter/neon-cli auth login
```
## Explore um projeto em detalhe [#explore-um-projeto-em-detalhe]
```bash
npx @crafter/neon-cli usage --project shy-darkness-12345
```
## Para onde está indo meu dinheiro este mês? [#para-onde-está-indo-meu-dinheiro-este-mês]
```bash
npx @crafter/neon-cli billing # current-period running totals
npx @crafter/neon-cli invoice # reconcile against your bill, to the cent
```
## JSON para agentes e CI [#json-para-agentes-e-ci]
```bash
npx @crafter/neon-cli usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
Nota: o `neonctl` oficial não expõe histórico de consumo de jeito nenhum. Comparação completa: [docs do neon-cli](/pt/docs/neon-cli).
---
# Renderize um diagrama Mermaid pela CLI
URL: https://crafter.run/pt/docs/guides/render-mermaid-cli
```bash
npx @crafter/mermaid-cli diagram.mmd
```
Isso renderiza o diagrama no seu terminal com cores ANSI e caixas Unicode. Sem navegador headless, sem baixar o Chromium: o motor inteiro tem 30.5KB.
## Pelo stdin [#pelo-stdin]
```bash
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cli
```
## Escolha um tema [#escolha-um-tema]
```bash
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 available
```
## Opções [#opções]
| Flag | Descrição |
| ---------------- | ------------------------------------------------- |
| `--theme ` | Nome do tema (padrão: `one-hunter`) |
| `--width ` | Largura do terminal (padrão: detecção automática) |
| `--compact` | Espaçamento compacto |
| `--list-themes` | Lista todos os 30 temas |
## Instale de forma permanente [#instale-de-forma-permanente]
```bash
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmd
```
## Qual a diferença para o @mermaid-js/mermaid-cli? [#qual-a-diferença-para-o-mermaid-jsmermaid-cli]
O `@mermaid-js/mermaid-cli` oficial renderiza abrindo um Chromium headless via Puppeteer, uma instalação pesada que não funciona em muitos ambientes de CI ou sandbox. O `@crafter/mermaid-cli` usa o [@crafter/mermaid](/pt/docs/mermaid), um motor de renderização escrito do zero, com zero dependências e uma API síncrona, então roda em qualquer lugar onde o Node roda, na hora.
Precisa de saída SVG em vez de renderização no terminal? Use a biblioteca diretamente:
```ts
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")
```
---
# Transcreve um vídeo do YouTube pela linha de comando
URL: https://crafter.run/pt/docs/guides/transcribe-youtube-cli
```bash
npx @crafter/trx "https://youtube.com/watch?v=dQw4w9WgXcQ"
```
Isso baixa o áudio do vídeo com yt-dlp, limpa com ffmpeg e transcreve com um modelo Whisper local. Você recebe saídas em `.txt`, `.srt`, `.wav` e JSON. Tudo roda na sua máquina: grátis, privado, sem API key.
Primeira vez? Inicialize uma única vez para escolher o tamanho do modelo Whisper (de tiny com 75MB até large com 3GB):
```bash
npx @crafter/trx init
```
O trx exige o [Bun](https://bun.sh) como runtime.
## Arquivos locais funcionam do mesmo jeito [#arquivos-locais-funcionam-do-mesmo-jeito]
```bash
npx @crafter/trx recording.mp4
```
## Obtenha só o texto, como JSON [#obtenha-só-o-texto-como-json]
```bash
npx @crafter/trx transcribe video.mp4 --fields text --output json
```
## Outros idiomas [#outros-idiomas]
```bash
npx @crafter/trx transcribe video.mp4 --language es
```
## Para scripts e agentes de IA [#para-scripts-e-agentes-de-ia]
`trx` é agent-first: saída JSON, validação dry-run e introspecção de schemas em runtime.
```bash
npx @crafter/trx transcribe video.mp4 --dry-run --output json # validate without executing
npx @crafter/trx schema transcribe # inspect the command schema
```
Referência completa: [docs do trx](/pt/docs/trx).
---
# awake:合上盖子也让 Mac 继续运行
URL: https://crafter.run/zh/docs/awake
`@crafter/awake` 做到了 `caffeinate` 唯一做不到的事:**合上盖子后让 Mac 继续运行。** 把电脑装进包里之前只需一条命令,由 launchd 支撑的定时器会自动恢复正常休眠,所有命令都支持 `--json`,你的编程代理也能直接驱动它。
## 为什么不用 caffeinate? [#为什么不用-caffeinate]
无论持有哪些 assertion,macOS 都会在合盖的一瞬间强制休眠。唯一能在合盖后生效的开关是 `pmset disablesleep`,它需要 root 权限且没有任何防护。awake 正是为这个开关包上了它应有的工程学设计。
| | caffeinate | @crafter/awake |
| ------------- | ---------- | -------------- |
| 阻止闲置休眠 | 是 | 是 |
| 合盖后继续运行 | 否 | 是 |
| 自动关闭定时器 | 否 | 是(默认 1 小时) |
| 菜单栏可见状态 | 否 | 是 |
| 为代理提供 JSON 输出 | 否 | 所有命令 |
## 安装 [#安装]
```bash
npm i -g @crafter/awake
```
一次性设置,只需输入一次密码,安装一条仅限于两条 `pmset` 命令的 sudoers 规则(不会提升其他任何权限,`awake setup --uninstall` 可移除):
```bash
awake setup
```
## 使用 [#使用]
```bash
awake on # 保持 Mac 清醒 1 小时(安全默认值)
awake on 3h # 时长:30m、2h、1h30m,纯数字表示分钟
awake on --forever # 无定时器,直到你手动关闭
awake off # 立即恢复正常休眠
awake status # 状态、定时器、电池
```
任务进行中合上盖子,任务继续运行。定时器会自动恢复一切,并在触发时发送通知,即使经历崩溃或重启也一样。使用电池供电时 `awake status` 会发出警告。
## 面向代理 [#面向代理]
通过管道时输出自动为 JSON。错误以 `{"error": {"code", "message", "hint"}}` 形式写入 stderr。退出码:0 成功,1 错误,3 需要设置(需要人工执行一次 `awake setup`)。完整契约见 [AGENTS.md](https://github.com/crafter-station/awake/blob/main/AGENTS.md)。
```bash
awake on 2h --json # 在长时间无人值守任务之前
awake status --json # {"data":{"enabled":true,"remaining_seconds":7080,...}}
awake off --json # 提前完成,恢复正常休眠
```
## 命令 [#命令]
| 命令 | 说明 |
| --------------- | -------------------------------- |
| `awake on [时长]` | 保持 Mac 清醒(默认 1 小时,重复执行会重置定时器) |
| `awake off` | 恢复正常休眠(幂等) |
| `awake status` | 当前状态、定时器、电池 |
| `awake setup` | 一次性免密授权(`--check`、`--uninstall`) |
## 菜单栏应用 [#菜单栏应用]
SwiftUI 伴侣应用(macOS 13+),一键选择时长,时钟旁实时倒计时。同一个仓库,底层同一个 CLI:`./mac/build-app.sh`。
## 链接 [#链接]
* [网站](https://awake.crafter.run)
* [GitHub](https://github.com/crafter-station/awake)
* [npm](https://www.npmjs.com/package/@crafter/awake)
---
# Crafter Station 文档
URL: https://crafter.run/zh/docs
Crafter Station 构建开源开发者工具。这里的每个工具都可以从 npm 安装,无需全局安装即可通过 `npx`/`bunx` 使用,并且专为人类和 AI 编码代理共同使用而设计。
## 任何工具,即装即用 [#任何工具即装即用]
所有 CLI 无需安装即可运行:
```bash
npx @crafter/trx recording.mp4
npx @crafter/mermaid-cli diagram.mmd
bunx @crafter/skillkit scan
```
## 源代码 [#源代码]
所有工具均采用 MIT 许可证,并在 [github.com/crafter-station](https://github.com/crafter-station) 公开开发。
---
# 无需浏览器渲染 Mermaid 图表
URL: https://crafter.run/zh/docs/mermaid
`@crafter/mermaid` 是一个从零构建的 Mermaid 渲染引擎:以 **30.5KB(min+gzip)** 的体积解析、布局并渲染 Mermaid 图表,**零依赖**、**同步 API**。没有 headless 浏览器,没有 2MB 的大包。
| | mermaid.js | @crafter/mermaid |
| --- | ---------- | ---------------- |
| 包体积 | \~2MB | 30.5KB gzipped |
| 依赖 | 50+ | 零 |
| API | 异步 | 同步 |
## 安装 [#安装]
```bash
bun add @crafter/mermaid
```
## 快速开始 [#快速开始]
```ts
import { render } from "@crafter/mermaid"
const svg = render(`
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Success]
B -->|No| D[Failure]
`)
document.getElementById("diagram").innerHTML = svg
```
## 套件 [#套件]
总包(umbrella package)重新导出一组小而专注的包。当你只需要流水线中的某一环节时,可以单独使用它们:
| 包 | 大小 | 作用 |
| --------------------------- | ------ | --------------- |
| `@crafter/mermaid` | \<1KB | 总包 |
| `@crafter/mermaid-parser` | \~8KB | Mermaid 文本转 AST |
| `@crafter/mermaid-layout` | \~14KB | AST 转已定位图 |
| `@crafter/mermaid-renderer` | \~17KB | 已定位图转 SVG |
| `@crafter/mermaid-themes` | \~2KB | 30 个主题预设 |
| `@crafter/mermaid-cli` | \<1KB | 终端渲染器 |
| `@crafter/mermaid-player` | \~3KB | 步进动画 |
## 在终端中渲染 [#在终端中渲染]
```bash
npx @crafter/mermaid-cli diagram.mmd
```
## 链接 [#链接]
* [GitHub](https://github.com/crafter-station/mermaid)
* [npm](https://www.npmjs.com/package/@crafter/mermaid)
---
# neon-cli:在终端查看 Neon 用量和账单
URL: https://crafter.run/zh/docs/neon-cli
`@crafter/neon-cli` 回答 Neon 控制台不告诉你的那个问题:**我的钱现在正按项目花在哪里?** 它在终端里用约 200ms 给出彩色、可排序、按项目细分的计算小时数、存储和 egress,并为代理提供 `--json`。
## 为什么不用 neonctl? [#为什么不用-neonctl]
官方的 `neonctl` 很适合资源管理,但没有暴露消耗历史 endpoint。这个 CLI 调用的是 Neon 用于计费的同一个 v2 消耗 endpoint(`/consumption_history/v2/projects`),因此数字与你的发票一致,而 `neon invoice` 能把这一点核对到每一分钱。
| | neonctl | @crafter/neon-cli |
| --------------- | ------- | ----------------- |
| 项目、分支、endpoints | 支持 | 只读(写操作在路线图上) |
| 按项目的消耗历史 | 不支持 | 支持 |
| 发票对账 | 不支持 | 支持 |
| 面向代理的 JSON 输出 | 部分支持 | 所有命令 |
## 安装 [#安装]
```bash
npm i -g @crafter/neon-cli
```
或不安装、一次性运行:
```bash
npx @crafter/neon-cli usage --json
```
## 认证 [#认证]
在 [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys) 获取 API key,然后:
```bash
neon auth login # prompts for the key, stores it at ~/.neon/config.json (mode 0600)
# or
export NEON_API_KEY=napi_... # env var always wins
```
## 用法 [#用法]
```bash
neon usage # this month, daily, all projects
neon usage --last 24h --granularity hourly # last 24 hours, hourly buckets
neon usage --project shy-darkness-12345 # one project + per-bucket chart
neon usage --org org_abc123 # scope to one org
neon usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
粒度限制(依据 Neon 的 API):`hourly` 覆盖最近 168 小时,`daily` 覆盖最近 60 天,`monthly` 覆盖最近一年。
## 命令 [#命令]
| 命令 | 说明 |
| --------------- | -------------------------------- |
| `neon usage` | 按项目的消耗历史(计算、存储、egress) |
| `neon billing` | 当前周期的累计总额 |
| `neon invoice` | 将你的账单与 API 对账,精确到分 |
| `neon projects` | 列出项目 |
| `neon orgs` | 列出组织 |
| `neon auth` | login / status / whoami / logout |
## 链接 [#链接]
* [GitHub](https://github.com/crafter-station/neon-cli)
* [npm](https://www.npmjs.com/package/@crafter/neon-cli)
---
# skillkit:AI 代理技能的可观测性工具
URL: https://crafter.run/zh/docs/skillkit
AI 编码代理在每个会话中都会把技能加载进上下文窗口。技能越多,留给实际代码的空间就越少。`skillkit` 回答这些问题:你真正在用哪些技能、它们是否有帮助、成本是多少。它提供使用分析、冲突检测、成本分析和上下文预算监控,一切都在你的本地机器上运行。
## 前置条件 [#前置条件]
skillkit 需要 [Bun](https://bun.sh) 作为运行时(原生 SQLite 和快速的 TypeScript 执行):
```bash
curl -fsSL https://bun.sh/install | bash
```
## 快速开始 [#快速开始]
无需安装:
```bash
bunx @crafter/skillkit scan
bunx @crafter/skillkit stats
bunx @crafter/skillkit health
```
或全局安装:
```bash
bun add -g @crafter/skillkit
skillkit scan
```
如果已安装 Bun,`npm i -g` 也可以使用,因为 bin 入口以 Bun 作为运行时。
## 命令 [#命令]
| 命令 | 说明 |
| -------------------------------- | --------------------- |
| `skillkit scan` | 发现已安装的技能并索引会话数据 |
| `skillkit list` | 列出已安装的技能及其大小和上下文预算 |
| `skillkit stats` | 带迷你趋势图的使用分析(最近 30 天) |
| `skillkit health` | 健康检查:未使用的技能、上下文预算、数据库 |
| `skillkit prune` | 删除未使用的技能,回收上下文预算 |
| `skillkit burn` | 订阅消耗速率分析(成本、模型、按日) |
| `skillkit conflicts` | 测试技能之间的触发冲突 |
| `skillkit coverage ` | 分析技能中的冗余内容 |
| `skillkit trace ` | 运行并记录一次技能执行跟踪 |
## skill-creator 与 skillkit 的区别 [#skill-creator-与-skillkit-的区别]
Anthropic 的 [skill-creator](https://github.com/anthropics/skill-creator) 负责技能的编写与评估。skillkit 负责生产环境的可观测性。两者没有重叠。
## 链接 [#链接]
* [GitHub](https://github.com/crafter-station/skillkit)
* [npm](https://www.npmjs.com/package/@crafter/skillkit)
* 通过 [skills.sh](https://skills.sh) 安装技能:`npx skills add `
---
# trx:在命令行中转录音频和视频
URL: https://crafter.run/zh/docs/trx
`trx` 使用 yt-dlp 下载媒体,用 ffmpeg 清理音频,再用本地 Whisper 模型进行转录。它输出 `.wav`、`.srt`、`.txt` 和 JSON,并且优先为 AI 代理设计:JSON 输出、dry-run 验证、字段过滤和运行时 schema 自省。
## 安装 [#安装]
```bash
bun add -g @crafter/trx
trx init
```
## 快速开始 [#快速开始]
转录本地文件:
```bash
trx recording.mp4
```
从 URL 转录(支持 YouTube 以及 yt-dlp 支持的一切):
```bash
trx "https://youtube.com/watch?v=..."
```
## 面向代理的用法 [#面向代理的用法]
机器可读的输出,专为脚本和 AI 代理调用而设计:
```bash
# JSON output
trx transcribe video.mp4 --output json
# Only the text field
trx transcribe video.mp4 --fields text --output json
# Validate without executing
trx transcribe video.mp4 --dry-run --output json
# Inspect the command schema at runtime
trx schema transcribe
```
## 语言支持 [#语言支持]
```bash
trx transcribe video.mp4 --language es
```
## 模型大小 [#模型大小]
Whisper 模型从 tiny(75MB)到 large(3GB)不等。在 `trx init` 时根据你对准确度和速度的需求选择合适的大小。
## 链接 [#链接]
* [GitHub](https://github.com/crafter-station/trx)
* [npm](https://www.npmjs.com/package/@crafter/trx)
---
# 在终端查看 Neon Postgres 用量
URL: https://crafter.run/zh/docs/guides/neon-usage-terminal
```bash
npx @crafter/neon-cli usage --last 24h --granularity hourly
```
这条命令会打印最近 24 小时按项目细分的计算小时数、存储和 egress,彩色且可排序。数据来自 Neon 用于计费的同一个 v2 消耗 endpoint,因此数字与你的发票一致。
```
usage by project
PROJECT ID COMPUTE ROOT BR CHILD BR EGRESS
──────────────── ──────────────────────────── ───────── ─────── ──────── ──────
maca.sh red-firefly-70089523 0.25 CU·h 43.4 KB 0 B 173 KB
devphotos tiny-sky-12271004 0.00 CU·h 42.8 KB 0 B 0 B
```
## 设置 [#设置]
在 [console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys) 获取 API key:
```bash
export NEON_API_KEY=napi_...
# or store it: npx @crafter/neon-cli auth login
```
## 深入单个项目 [#深入单个项目]
```bash
npx @crafter/neon-cli usage --project shy-darkness-12345
```
## 这个月我的钱花到哪里去了? [#这个月我的钱花到哪里去了]
```bash
npx @crafter/neon-cli billing # current-period running totals
npx @crafter/neon-cli invoice # reconcile against your bill, to the cent
```
## 面向代理和 CI 的 JSON [#面向代理和-ci-的-json]
```bash
npx @crafter/neon-cli usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
注意:官方的 `neonctl` 完全不提供消耗历史。完整对比:[neon-cli 文档](/zh/docs/neon-cli)。
---
# 在命令行中渲染 Mermaid 图表
URL: https://crafter.run/zh/docs/guides/render-mermaid-cli
```bash
npx @crafter/mermaid-cli diagram.mmd
```
这条命令会用 ANSI 颜色和 Unicode 制表符在你的终端里渲染图表。没有 headless 浏览器,不用下载 Chromium:整个引擎只有 30.5KB。
## 从 stdin 读取 [#从-stdin-读取]
```bash
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cli
```
## 选择主题 [#选择主题]
```bash
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 available
```
## 选项 [#选项]
| 参数 | 说明 |
| ---------------- | --------------------- |
| `--theme ` | 主题名称(默认:`one-hunter`) |
| `--width ` | 终端宽度(默认:自动检测) |
| `--compact` | 紧凑间距 |
| `--list-themes` | 列出全部 30 个主题 |
## 永久安装 [#永久安装]
```bash
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmd
```
## 与 @mermaid-js/mermaid-cli 有何不同? [#与-mermaid-jsmermaid-cli-有何不同]
官方的 `@mermaid-js/mermaid-cli` 通过 Puppeteer 启动 headless Chromium 来渲染,安装笨重,而且在许多 CI/沙箱环境中无法运行。`@crafter/mermaid-cli` 使用 [@crafter/mermaid](/zh/docs/mermaid),一个从零构建、零依赖、同步 API 的渲染引擎,因此它能在任何可以运行 Node 的地方即刻运行。
需要 SVG 输出而不是终端渲染?直接使用这个库:
```ts
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")
```
---
# 在命令行中转录 YouTube 视频
URL: https://crafter.run/zh/docs/guides/transcribe-youtube-cli
```bash
npx @crafter/trx "https://youtube.com/watch?v=dQw4w9WgXcQ"
```
这条命令会用 yt-dlp 下载视频的音频,用 ffmpeg 清理,再用本地 Whisper 模型转录。你会得到 `.txt`、`.srt`、`.wav` 和 JSON 输出。一切都在你的机器上运行:免费、私密、无需 API key。
第一次运行?先初始化一次,选择 Whisper 模型大小(从 tiny 75MB 到 large 3GB):
```bash
npx @crafter/trx init
```
trx 需要 [Bun](https://bun.sh) 作为运行时。
## 本地文件的用法完全相同 [#本地文件的用法完全相同]
```bash
npx @crafter/trx recording.mp4
```
## 只要文本,以 JSON 输出 [#只要文本以-json-输出]
```bash
npx @crafter/trx transcribe video.mp4 --fields text --output json
```
## 其他语言 [#其他语言]
```bash
npx @crafter/trx transcribe video.mp4 --language es
```
## 用于脚本和 AI 代理 [#用于脚本和-ai-代理]
`trx` 是 agent-first 的:JSON 输出、dry-run 验证和运行时 schema 自省。
```bash
npx @crafter/trx transcribe video.mp4 --dry-run --output json # validate without executing
npx @crafter/trx schema transcribe # inspect the command schema
```
完整参考:[trx 文档](/zh/docs/trx)。
---
# awake:フタを閉じてもMacを動かし続ける
URL: https://crafter.run/ja/docs/awake
`@crafter/awake` は `caffeinate` にできない唯一のことをやります:**フタを閉じた後もMacを動かし続けること。** ノートPCをバッグに入れる前にコマンド1つ、launchdに支えられたタイマーが自動で通常のスリープに戻し、すべてのコマンドが `--json` 対応なのでコーディングエージェントからも操作できます。
## なぜcaffeinateではないのか? [#なぜcaffeinateではないのか]
macOSはどんなassertionが保持されていても、フタが閉じた瞬間に強制スリープします。フタを閉じても生き残る唯一のスイッチが `pmset disablesleep` で、root権限が必要な上にガードレールが一切ありません。awakeはまさにそのスイッチを、あるべきエルゴノミクスで包みます。
| | caffeinate | @crafter/awake |
| -------------- | ---------- | -------------- |
| アイドルスリープの防止 | はい | はい |
| フタを閉じても動作 | いいえ | はい |
| 自動オフタイマー | いいえ | はい(デフォルト1時間) |
| メニューバーでの状態表示 | いいえ | はい |
| エージェント向けJSON出力 | いいえ | 全コマンド |
## インストール [#インストール]
```bash
npm i -g @crafter/awake
```
初回のみのセットアップ。パスワードを一度だけ求め、正確に2つの `pmset` コマンドに限定したsudoersルールをインストールします(他は一切昇格されず、`awake setup --uninstall` で削除できます):
```bash
awake setup
```
## 使い方 [#使い方]
```bash
awake on # Macを1時間起こしておく(安全なデフォルト)
awake on 3h # 時間指定:30m、2h、1h30m、数字だけなら分
awake on --forever # タイマーなし、手動でオフにするまで
awake off # 今すぐ通常のスリープに戻す
awake status # 状態、タイマー、バッテリー
```
タスクの途中でフタを閉じても、タスクは動き続けます。タイマーが自動ですべてを元に戻し、発火時には通知を送ります。クラッシュや再起動の後でも同様です。バッテリー駆動時は `awake status` が警告します。
## エージェント向け [#エージェント向け]
パイプ時は自動的にJSON出力になります。エラーはstderrに `{"error": {"code", "message", "hint"}}` として出力。終了コード:0 成功、1 エラー、3 セットアップが必要(人間が一度 `awake setup` を実行する必要があります)。完全なコントラクトは [AGENTS.md](https://github.com/crafter-station/awake/blob/main/AGENTS.md) にあります。
```bash
awake on 2h --json # 長時間の無人タスクの前に
awake status --json # {"data":{"enabled":true,"remaining_seconds":7080,...}}
awake off --json # 早く終わったら通常のスリープに戻す
```
## コマンド [#コマンド]
| コマンド | 説明 |
| --------------- | --------------------------------------- |
| `awake on [時間]` | Macを起こしておく(デフォルト1時間、再実行でタイマーを再設定) |
| `awake off` | 通常のスリープに戻す(冪等) |
| `awake status` | 現在の状態、タイマー、バッテリー |
| `awake setup` | 初回のみのパスワードレス認可(`--check`、`--uninstall`) |
## メニューバーアプリ [#メニューバーアプリ]
SwiftUI製のコンパニオン(macOS 13+)。ワンクリックで時間を選べ、時計の隣にライブカウントダウンを表示。同じリポジトリ、同じCLIが土台です:`./mac/build-app.sh`。
## リンク [#リンク]
* [ウェブサイト](https://awake.crafter.run)
* [GitHub](https://github.com/crafter-station/awake)
* [npm](https://www.npmjs.com/package/@crafter/awake)
---
# Crafter Station ドキュメント
URL: https://crafter.run/ja/docs
Crafter Station はオープンソースの開発者ツールを開発しています。ここにあるツールはすべて npm からインストールでき、グローバルインストールなしで `npx`/`bunx` から実行でき、人間と AI コーディングエージェントの両方が使えるように設計されています。
## どのツールもすぐに使える [#どのツールもすぐに使える]
すべての CLI はインストール不要で動作します:
```bash
npx @crafter/trx recording.mp4
npx @crafter/mermaid-cli diagram.mmd
bunx @crafter/skillkit scan
```
## ソースコード [#ソースコード]
すべてのツールは MIT ライセンスで、[github.com/crafter-station](https://github.com/crafter-station) にてオープンに開発されています。
---
# ブラウザなしで Mermaid 図をレンダリングする
URL: https://crafter.run/ja/docs/mermaid
`@crafter/mermaid` はゼロから構築された Mermaid レンダリングエンジンです。**30.5KB(min+gzip)**、**依存ゼロ**、**同期 API** で Mermaid 図のパース、レイアウト、レンダリングを行います。ヘッドレスブラウザも 2MB のバンドルも不要です。
| | mermaid.js | @crafter/mermaid |
| ---- | ---------- | ---------------- |
| バンドル | \~2MB | 30.5KB gzipped |
| 依存関係 | 50+ | ゼロ |
| API | 非同期 | 同期 |
## インストール [#インストール]
```bash
bun add @crafter/mermaid
```
## クイックスタート [#クイックスタート]
```ts
import { render } from "@crafter/mermaid"
const svg = render(`
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Success]
B -->|No| D[Failure]
`)
document.getElementById("diagram").innerHTML = svg
```
## パッケージ構成 [#パッケージ構成]
アンブレラパッケージは、小さく焦点を絞ったパッケージ群を再エクスポートしています。パイプラインの一部だけが必要な場合は、個別に利用できます:
| パッケージ | サイズ | 役割 |
| --------------------------- | ------ | -------------------- |
| `@crafter/mermaid` | \<1KB | アンブレラパッケージ |
| `@crafter/mermaid-parser` | \~8KB | Mermaid テキストから AST へ |
| `@crafter/mermaid-layout` | \~14KB | AST から配置済みグラフへ |
| `@crafter/mermaid-renderer` | \~17KB | 配置済みグラフから SVG へ |
| `@crafter/mermaid-themes` | \~2KB | 30 種類のテーマプリセット |
| `@crafter/mermaid-cli` | \<1KB | ターミナルレンダラー |
| `@crafter/mermaid-player` | \~3KB | ステップ実行アニメーション |
## ターミナルからレンダリング [#ターミナルからレンダリング]
```bash
npx @crafter/mermaid-cli diagram.mmd
```
## リンク [#リンク]
* [GitHub](https://github.com/crafter-station/mermaid)
* [npm](https://www.npmjs.com/package/@crafter/mermaid)
---
# neon-cli: ターミナルで Neon の使用量と請求を確認する
URL: https://crafter.run/ja/docs/neon-cli
`@crafter/neon-cli` は、Neon のダッシュボードが答えてくれない問い、**いま、どのプロジェクトにいくら使っているのか?** に答えます。コンピュート時間、ストレージ、egress のプロジェクト別内訳を、色付きでソート可能な形式で約 200ms でターミナルに表示し、エージェント向けに `--json` も備えています。
## なぜ neonctl ではないのか? [#なぜ-neonctl-ではないのか]
公式の `neonctl` はリソース管理には優れていますが、消費履歴のエンドポイントを公開していません。この CLI は Neon が請求に使うのと同じ v2 消費エンドポイント(`/consumption_history/v2/projects`)を呼び出すため、数値はインボイスと一致し、`neon invoice` はそれをセント単位で検証します。
| | neonctl | @crafter/neon-cli |
| ------------------- | ------- | -------------------- |
| プロジェクト、ブランチ、エンドポイント | あり | 読み取り専用(書き込みはロードマップ上) |
| プロジェクト別の消費履歴 | なし | あり |
| インボイスの照合 | なし | あり |
| エージェント向け JSON 出力 | 一部 | 全コマンド |
## インストール [#インストール]
```bash
npm i -g @crafter/neon-cli
```
インストールせずに単発で実行することもできます:
```bash
npx @crafter/neon-cli usage --json
```
## 認証 [#認証]
[console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys) で API キーを取得し、次を実行します:
```bash
neon auth login # prompts for the key, stores it at ~/.neon/config.json (mode 0600)
# or
export NEON_API_KEY=napi_... # env var always wins
```
## 使い方 [#使い方]
```bash
neon usage # this month, daily, all projects
neon usage --last 24h --granularity hourly # last 24 hours, hourly buckets
neon usage --project shy-darkness-12345 # one project + per-bucket chart
neon usage --org org_abc123 # scope to one org
neon usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
グラニュラリティの制限(Neon の API 準拠):`hourly` は直近 168 時間、`daily` は直近 60 日、`monthly` は直近 1 年をカバーします。
## コマンド [#コマンド]
| コマンド | 説明 |
| --------------- | --------------------------------- |
| `neon usage` | プロジェクト別の消費履歴(コンピュート、ストレージ、egress) |
| `neon billing` | 現在の請求期間の累計 |
| `neon invoice` | 請求を API と照合し、セント単位で確認 |
| `neon projects` | プロジェクトの一覧表示 |
| `neon orgs` | 組織の一覧表示 |
| `neon auth` | login / status / whoami / logout |
## リンク [#リンク]
* [GitHub](https://github.com/crafter-station/neon-cli)
* [npm](https://www.npmjs.com/package/@crafter/neon-cli)
---
# skillkit: AI エージェントスキルの可観測性ツール
URL: https://crafter.run/ja/docs/skillkit
AI コーディングエージェントは、セッションのたびにスキルをコンテキストウィンドウに読み込みます。スキルが増えるほど、実際のコードに使える領域は減ります。`skillkit` は、どのスキルを実際に使っているのか、役に立っているのか、コストはいくらか、という問いに答えます。使用状況の分析、競合の検出、コスト分析、コンテキストバジェットの監視を備え、すべてローカルマシン上で動作します。
## 前提条件 [#前提条件]
skillkit はランタイムとして [Bun](https://bun.sh) を必要とします(ネイティブ SQLite と高速な TypeScript 実行のため):
```bash
curl -fsSL https://bun.sh/install | bash
```
## クイックスタート [#クイックスタート]
インストール不要で実行できます:
```bash
bunx @crafter/skillkit scan
bunx @crafter/skillkit stats
bunx @crafter/skillkit health
```
またはグローバルにインストールします:
```bash
bun add -g @crafter/skillkit
skillkit scan
```
bin エントリが Bun をランタイムとして使うため、Bun がインストールされていれば `npm i -g` でも動作します。
## コマンド [#コマンド]
| コマンド | 説明 |
| -------------------------------- | ---------------------------------- |
| `skillkit scan` | インストール済みスキルの検出とセッションデータのインデックス化 |
| `skillkit list` | インストール済みスキルをサイズとコンテキストバジェット付きで一覧表示 |
| `skillkit stats` | スパークライン付きの使用状況分析(直近 30 日) |
| `skillkit health` | ヘルスチェック:未使用スキル、コンテキストバジェット、DB |
| `skillkit prune` | 未使用スキルを削除してコンテキストバジェットを取り戻す |
| `skillkit burn` | サブスクリプションのバーンレート分析(コスト、モデル、日次) |
| `skillkit conflicts` | スキルのトリガー衝突をテスト |
| `skillkit coverage ` | スキル内のデッドウェイトを分析 |
| `skillkit trace ` | スキルの実行トレースを実行・記録 |
## skill-creator と skillkit の違い [#skill-creator-と-skillkit-の違い]
Anthropic の [skill-creator](https://github.com/anthropics/skill-creator) はスキルの作成と評価を担います。skillkit は本番運用の可観測性を担います。役割の重複はありません。
## リンク [#リンク]
* [GitHub](https://github.com/crafter-station/skillkit)
* [npm](https://www.npmjs.com/package/@crafter/skillkit)
* スキルのインストールは [skills.sh](https://skills.sh) から:`npx skills add `
---
# trx: CLI で音声・動画を文字起こしする
URL: https://crafter.run/ja/docs/trx
`trx` は yt-dlp でメディアをダウンロードし、ffmpeg で音声をクリーンアップし、ローカルの Whisper モデルで文字起こしします。`.wav`、`.srt`、`.txt`、JSON を出力し、AI エージェントを第一に考えて設計されています。JSON 出力、dry-run 検証、フィールドのフィルタリング、実行時のスキーマイントロスペクションを備えています。
## インストール [#インストール]
```bash
bun add -g @crafter/trx
trx init
```
## クイックスタート [#クイックスタート]
ローカルファイルの文字起こし:
```bash
trx recording.mp4
```
URL からの文字起こし(YouTube および yt-dlp が対応するすべてのサイト):
```bash
trx "https://youtube.com/watch?v=..."
```
## エージェント向けの使い方 [#エージェント向けの使い方]
スクリプトや AI エージェントから呼び出すために設計された、機械可読な出力です:
```bash
# JSON output
trx transcribe video.mp4 --output json
# Only the text field
trx transcribe video.mp4 --fields text --output json
# Validate without executing
trx transcribe video.mp4 --dry-run --output json
# Inspect the command schema at runtime
trx schema transcribe
```
## 言語サポート [#言語サポート]
```bash
trx transcribe video.mp4 --language es
```
## モデルサイズ [#モデルサイズ]
Whisper モデルは tiny(75MB)から large(3GB)まであります。`trx init` の際に、必要な精度と速度に合ったサイズを選んでください。
## リンク [#リンク]
* [GitHub](https://github.com/crafter-station/trx)
* [npm](https://www.npmjs.com/package/@crafter/trx)
---
# ターミナルで Neon Postgres の使用量を確認する
URL: https://crafter.run/ja/docs/guides/neon-usage-terminal
```bash
npx @crafter/neon-cli usage --last 24h --granularity hourly
```
このコマンドは、直近 24 時間のコンピュート時間、ストレージ、egress のプロジェクト別内訳を、色付きでソート可能な形式で表示します。データは Neon が請求に使うのと同じ v2 消費エンドポイントから取得しているため、数値はインボイスと一致します。
```
usage by project
PROJECT ID COMPUTE ROOT BR CHILD BR EGRESS
──────────────── ──────────────────────────── ───────── ─────── ──────── ──────
maca.sh red-firefly-70089523 0.25 CU·h 43.4 KB 0 B 173 KB
devphotos tiny-sky-12271004 0.00 CU·h 42.8 KB 0 B 0 B
```
## セットアップ [#セットアップ]
[console.neon.tech/app/settings/api-keys](https://console.neon.tech/app/settings/api-keys) で API キーを取得します:
```bash
export NEON_API_KEY=napi_...
# or store it: npx @crafter/neon-cli auth login
```
## プロジェクト単位で掘り下げる [#プロジェクト単位で掘り下げる]
```bash
npx @crafter/neon-cli usage --project shy-darkness-12345
```
## 今月、どこにお金を使っているのか? [#今月どこにお金を使っているのか]
```bash
npx @crafter/neon-cli billing # current-period running totals
npx @crafter/neon-cli invoice # reconcile against your bill, to the cent
```
## エージェントと CI 向けの JSON [#エージェントと-ci-向けの-json]
```bash
npx @crafter/neon-cli usage --json | jq '.projects[] | {id: .project_id, cu_h: (.totals.compute_unit_seconds/3600)}'
```
注:公式の `neonctl` は消費履歴を一切公開していません。詳しい比較は [neon-cli ドキュメント](/ja/docs/neon-cli) を参照してください。
---
# CLI で Mermaid 図をレンダリングする
URL: https://crafter.run/ja/docs/guides/render-mermaid-cli
```bash
npx @crafter/mermaid-cli diagram.mmd
```
このコマンドは、ANSI カラーと Unicode 罫線を使ってターミナルに図をレンダリングします。ヘッドレスブラウザも Chromium のダウンロードも不要で、エンジン全体はわずか 30.5KB です。
## stdin から [#stdin-から]
```bash
echo "graph TD; A-->B-->C" | npx @crafter/mermaid-cli
```
## テーマを選ぶ [#テーマを選ぶ]
```bash
npx @crafter/mermaid-cli --theme tokyo-night diagram.mmd
npx @crafter/mermaid-cli --list-themes # 30 available
```
## オプション [#オプション]
| フラグ | 説明 |
| ---------------- | ------------------------ |
| `--theme ` | テーマ名(デフォルト:`one-hunter`) |
| `--width ` | ターミナル幅(デフォルト:自動検出) |
| `--compact` | コンパクトな間隔 |
| `--list-themes` | 全 30 テーマを一覧表示 |
## 恒久的にインストールする [#恒久的にインストールする]
```bash
npm install -g @crafter/mermaid-cli
crafter-mermaid diagram.mmd
```
## @mermaid-js/mermaid-cli と何が違うのか? [#mermaid-jsmermaid-cli-と何が違うのか]
公式の `@mermaid-js/mermaid-cli` は、Puppeteer 経由でヘッドレス Chromium を起動してレンダリングします。これは重量級のインストールで、多くの CI やサンドボックス環境では動作しません。`@crafter/mermaid-cli` は、依存ゼロ・同期 API でフルスクラッチ実装されたレンダリングエンジン [@crafter/mermaid](/ja/docs/mermaid) を使うため、Node が動く環境ならどこでも即座に動作します。
ターミナルレンダリングではなく SVG 出力が必要な場合は、ライブラリを直接使ってください:
```ts
import { render } from "@crafter/mermaid"
const svg = render("graph TD; A-->B")
```
---
# コマンドラインで YouTube 動画を文字起こしする
URL: https://crafter.run/ja/docs/guides/transcribe-youtube-cli
```bash
npx @crafter/trx "https://youtube.com/watch?v=dQw4w9WgXcQ"
```
このコマンドは、yt-dlp で動画の音声をダウンロードし、ffmpeg でクリーンアップし、ローカルの Whisper モデルで文字起こしします。`.txt`、`.srt`、`.wav`、JSON の出力が得られます。すべてローカルマシン上で動作します。無料、プライベート、API キー不要です。
初めて実行する場合は、最初に一度だけ初期化して Whisper モデルのサイズ(tiny 75MB から large 3GB まで)を選択します:
```bash
npx @crafter/trx init
```
trx はランタイムとして [Bun](https://bun.sh) を必要とします。
## ローカルファイルも同じ方法で [#ローカルファイルも同じ方法で]
```bash
npx @crafter/trx recording.mp4
```
## テキストだけを JSON で取得する [#テキストだけを-json-で取得する]
```bash
npx @crafter/trx transcribe video.mp4 --fields text --output json
```
## 他の言語 [#他の言語]
```bash
npx @crafter/trx transcribe video.mp4 --language es
```
## スクリプトと AI エージェント向け [#スクリプトと-ai-エージェント向け]
`trx` はエージェントファーストです。JSON 出力、dry-run 検証、実行時のスキーマイントロスペクションを備えています。
```bash
npx @crafter/trx transcribe video.mp4 --dry-run --output json # validate without executing
npx @crafter/trx schema transcribe # inspect the command schema
```
完全なリファレンス:[trx ドキュメント](/ja/docs/trx)。