{"_id":"@thetiket/cli","_rev":"4-54461e166f55a215256439afda5e787c","name":"@thetiket/cli","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@thetiket/cli","version":"0.1.0","keywords":["thetiket","cli","toml","formularios"],"license":"UNLICENSED","_id":"@thetiket/cli@0.1.0","maintainers":[{"name":"felipeinf","email":"felipe.concha.a@mail.pucv.cl"}],"bin":{"thetiket":"dist/cli.js"},"dist":{"shasum":"78a6462c1a27190f5c6ca7a1d8afa9eb2f8a9024","tarball":"https://registry.npmjs.org/@thetiket/cli/-/cli-0.1.0.tgz","fileCount":5,"integrity":"sha512-5abJSmnQsJ2mlZhlJQgITrUrCFL+HU8f3/TLOjFKVHfoB2BjoBJdtMaAckvKwL29cK6AIXykdR4JtUJ8rvhuHw==","signatures":[{"sig":"MEUCIFWc7Suwq88VTayDBOtv0ii8SevbYTB0PvFsSygis+leAiEAtFaM7/uBpRMpeXecpJiFHPq/0UCEuYcW42mlk5t8pZI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQD4sljKlxENvoKaUWf0ko5LTW/2j5+n/Xv7UN72LjUgtgIgUu4AkDKL0uQaLFN68iRsRmZ54+8vnVSKyKrJoIsiCuo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":245172},"type":"module","engines":{"node":">=20"},"scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","check":"npm run typecheck && npm run lint && npm run test && npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run check"},"_npmUser":{"name":"felipeinf","email":"felipe.concha.a@mail.pucv.cl"},"_npmVersion":"11.16.0","description":"CLI para crear recursos de The Tiket desde archivos TOML","directories":{},"_nodeVersion":"24.18.0","dependencies":{"zod":"^4.6.7","bcryptjs":"^3.0.3","commander":"^14.0.3","smol-toml":"^1.9.1","playwright-core":"^1.64.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^9.0.0","eslint":"^10.14.0","vitest":"^5.0.5","@eslint/js":"^10.0.1","typescript":"~6.0.3","@types/node":"^22.19.0","typescript-eslint":"^8.72.1"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.0_1796064310111_0.5366670558104183","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@thetiket/cli@0.1.1","bin":{"thetiket":"dist/cli.js"},"dist":{"shasum":"59a7564bd048a7860b967184e43921c275b1708e","tarball":"https://registry.npmjs.org/@thetiket/cli/-/cli-0.1.1.tgz","fileCount":5,"integrity":"sha512-vVsrEym0lDzJcKTxudgS2EzTrrDKIql6P26g7GUKA3kMeI9+jOI8NsQ1XuZO8/68seTyQNT/Uf0RaxULlmHsDQ==","signatures":[{"sig":"MEYCIQCvtBmriqa5dtKS0ECxGWOj3NFkvXAT5YsHyUkpfcKywgIhAOxf9ibxPRTV4Y1fBFrjED5qIafqfaqqp1OfMi0qeugE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB8E8/bhJHB0PZgHj+qoGI+Q9Dn7LqFHfxCSCiwSfx8aAiEAs0PIxWXPb1jjciyzqYmRGsqumMbTT2K3vO7dGgEoQTs="}],"unpackedSize":245352},"name":"@thetiket/cli","type":"module","engines":{"node":">=20"},"license":"UNLICENSED","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","check":"npm run typecheck && npm run lint && npm run test && npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run check"},"version":"0.1.1","_npmUser":{"name":"felipeinf","email":"felipe.concha.a@mail.pucv.cl"},"keywords":["thetiket","cli","toml","formularios"],"_npmVersion":"11.16.0","description":"CLI para crear recursos de The Tiket desde archivos TOML","directories":{},"maintainers":[{"name":"felipeinf","email":"felipe.concha.a@mail.pucv.cl"}],"_nodeVersion":"24.18.0","dependencies":{"zod":"^4.6.7","bcryptjs":"^3.0.3","commander":"^14.0.3","smol-toml":"^1.9.1","playwright-core":"^1.64.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^9.0.0","eslint":"^10.14.0","vitest":"^5.0.5","@eslint/js":"^10.0.1","typescript":"~6.0.3","@types/node":"^22.19.0","typescript-eslint":"^8.72.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_0.1.1_1796067892678_0.5315066540027674"}}},"time":{"created":"2026-11-30T18:43:33.648Z","modified":"2026-11-30T19:44:53.010Z","0.0.0-stage":"2026-11-30T18:43:33.648Z","0.1.0":"2026-11-30T18:45:10.230Z","0.1.1":"2026-11-30T19:44:52.794Z"},"license":"UNLICENSED","keywords":["thetiket","cli","toml","formularios"],"description":"CLI para crear recursos de The Tiket desde archivos TOML","maintainers":[{"name":"felipeinf","email":"felipe.concha.a@mail.pucv.cl"}],"readme":"# @thetiket/cli\n\nCrea recursos de The Tiket desde un archivo TOML: listas externas, listas condicionales, formularios (plantillas), técnicos y gestores. Solo crea; nunca modifica ni borra. Lo que ya existe se omite, así que ejecutarlo dos veces no duplica nada.\n\nLa guía completa (comandos, formato del archivo, tipos de control, códigos de salida, salida `--json`, errores comunes) está en la propia CLI:\n\n```sh\nthetiket guide\n```\n\n## Instalación\n\nRequiere Node.js 20 o superior.\n\n```sh\n# Desde el código fuente\nnpm install\nnpm run build\nnpm link            # deja disponible el comando `thetiket`\n\n# O desde un paquete generado con `npm pack`\nnpm install -g ./thetiket-cli-0.1.0.tgz\n```\n\n`thetiket login` usa Google Chrome si está instalado. Si no, usa el Chromium de Playwright, que se instala con `npx playwright-core install chromium`.\n\n## Iniciar sesión\n\n```sh\nthetiket login          # abre el navegador; inicia sesión en la consola (con MFA si corresponde)\nthetiket whoami         # muestra usuario, empresa, rol y vencimiento del token\n```\n\nEl token queda en `~/.config/thetiket/credentials.json`, legible solo por tu usuario, y dura 90 días. Sin navegador:\n\n```sh\nthetiket login --token -                # pega el token y presiona Ctrl+D\nexport THETIKET_TOKEN=...               # o por variable de entorno\nexport THETIKET_BUSINESS=<id empresa>   # necesario si el token no vino de `thetiket login`\n```\n\n`thetiket logout` borra el token guardado.\n\n## Ejemplo en 5 minutos\n\n```sh\nthetiket status                       # cuenta y empresa sobre las que actúa la CLI\nthetiket init acme                    # carpeta de proyecto fijada a esa empresa\ncd acme\nthetiket example formularios.toml     # archivo de ejemplo comentado; edítalo\nthetiket plan --out plan.json         # vista previa; no crea nada\nthetiket apply plan.json              # crea exactamente lo revisado, uno a uno\nthetiket plan                         # ahora todo aparece como \"Sin cambios\"\nthetiket forms list                   # formularios de la empresa\n```\n\nUn formulario mínimo:\n\n```toml\nversion = 1\n\n[[list]]\nname = \"Tipo de falla\"\noptions = [\"Eléctrica\", \"Mecánica\", \"Otra\"]\n\n[[form]]\nname = \"Visita técnica\"\n\n[[form.controls]]\ntitle = \"Tipo de falla\"\ntype = \"select\"\nlist = \"Tipo de falla\"\nrequired = true\n\n[[form.controls]]\ntitle = \"Firma del cliente\"\ntype = \"signature\"\n```\n\nMás ejemplos en [`examples/formularios.toml`](examples/formularios.toml) y [`examples/usuarios.toml`](examples/usuarios.toml).\n\n## Antes de usarlo en producción\n\n- **Listas:** son visibles para todas las empresas de la plataforma, y probablemente editables por ellas. No pongas datos confidenciales en sus opciones. La CLI recuerda localmente las listas que creó y nunca reutiliza una lista ajena por su nombre.\n- **Confirmación:** `apply` ejecuta un plan guardado con `plan --out` y revisado. Sin plan guardado exige `--yes` (solo para scripts). Cada técnico o gestor creado recibe un correo de invitación real; el bloque **Efectos** del plan lo muestra.\n- **Enlace de activación:** no está verificado. Al crear técnicos, la CLI envía el mismo valor `url_local` que la consola (`http://localhost:8100/`); se puede cambiar con `apply --app-url <url>`. Revisa el primer correo real que llegue.\n- **Formularios:** no se actualizan. Si cambias un formulario ya creado, crea uno con otro nombre: volver a guardar una plantilla degrada los controles de fecha y hora.\n\n## Para agentes de IA\n\nEjecuta `thetiket guide`: es autosuficiente. Para que una persona no técnica arranque con su propio agente, comparte `docs/agentes.md` (aún sin publicar). `thetiket schema` imprime el JSON Schema del archivo, y `--json` emite un evento JSON por línea.\n\n## Desarrollo\n\n```sh\nnpm run check      # typecheck + lint + tests + build\n```\n\n---\n\n## English summary\n\n`thetiket-cli` is a Node.js (≥ 20) CLI that creates The Tiket resources from a declarative TOML file: external lists, conditional lists, forms (templates), technicians and service managers. It is create-only and idempotent:\n- Existing resources are skipped.\n- Writes happen one at a time, with at least one second between them.\n- `apply` stops at the first error and reports what it created.\n\n**Commands:**\n- Authentication: `thetiket login` opens a browser to capture the console session token; alternatives are `login --token -` and `THETIKET_TOKEN`.\n- Workflow: `init` creates a project folder pinned to a (profile → tenant) scope, `example` writes a commented resource file, `plan --out plan.json` previews and saves, `apply plan.json` runs exactly the confirmed plan (`apply --yes` is the one-step path for scripts). Platform admins can create tenants with `tenant plan|create`; the admin session never creates resources inside a tenant (plan/apply/init refuse it with exit 2). Resources are created only with the tenant owner's own profile, which `tenant create --init` pins in the project folder even before the owner has activated the account.\n- Listings: `forms list`, `tikers list`, `managers list`.\n- Self-documentation: `thetiket guide` prints the complete, self-contained guide, intended for AI agents. `thetiket schema` prints the JSON Schema. `--json` switches output to NDJSON events.\n\n**Caveats:**\n- External lists are visible to every tenant of the platform (and probably editable by them).\n- Forms are never updated.\n- The invitation link is unverified; `url_local` defaults to the console's own value (`--app-url` overrides it).\n","readmeFilename":"README.md"}