@roilab/crm-cli 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SURFACE.txt CHANGED
@@ -1,489 +1,512 @@
1
- # Format: one line per command, flags flat, types terse.
2
- # Agents: grep this to discover capabilities without reading help pages.
3
-
4
- # ── Capacidades que NO son verbos (sólo flags) ─────────────────────────
5
- # Si grepeas la lista de verbos te las saltas. Existen en escrituras:
6
- # ATTACH file uploads via --file <path...> → task create, task update,
7
- # comment create, chat send, chat reply. Max 10 MB/archivo,
8
- # aviso desde 2 MB, --clear-files en task update vacía la lista.
9
- # Endpoints REST: POST /api/v1/uploads (genérico tareas/comentarios)
10
- # y POST /api/v1/chats/:id/uploads (chat). Two-step: pides URL →
11
- # PUT bytes a Convex storage → mandas attachments[] al write.
12
- # REUSE El mismo fichero adjuntado a N tareas ocupa UN solo blob. Antes de
13
- # subir, el CLI hashea (sha-256) y consulta GET /api/v1/uploads/lookup
14
- # ?contentHash=<hex>; si el workspace ya lo tiene, reutiliza ese
15
- # storageId y no sube bytes (stderr: "[INFO] ... se reutiliza el blob").
16
- # El hash viaja además en attachments[].contentHash, así que el
17
- # servidor colapsa gemelos aunque el lookup falle. Sólo aplica a
18
- # tareas/comentarios: chat sube siempre su copia porque su GC cuenta
19
- # referencias en otra tabla. No hay flag — es automático.
20
- # SHADOW --shadow fuerza la escritura a propuesta pendiente de revisión.
21
- # WAIT --wait-for-approval --timeout 30m bloquea hasta decisión humana.
22
- # IDEMP --idempotency-key <ulid> = reintentos seguros entre invocaciones.
23
-
24
- CMD crm auth login [key] --profile <name> --api-url <url> --device-name <label>
25
- CMD crm auth whoami
26
- CMD crm auth list
27
- CMD crm auth switch <name>
28
- CMD crm auth logout [name]
29
-
30
- CMD crm task list --status <status> --domain <id> --board <id> --column <id> --assignee <id> --tag <id> --review-pending --review-acked --limit <n>
31
- # --review-pending / --review-acked filtran la cola de revisión (agente pendiente
32
- # de aceptar vs ya aceptada por staff).
33
- # --board filtra por tablero incluyendo su multi-home; --column por la columna
34
- # en la que la tarea SE PINTA (sin colocación explícita cae en la primera columna
35
- # de su estado, igual que el kanban), y ya implica su tablero. Sirven para leer
36
- # una sola swimlane (p. ej. el backlog "To Do" de un board de redactores).
37
- # Ambos bajan al índice del tablero: no truncan y no leen el workspace entero.
38
- # Si hay más resultados que --limit (máx. 500), la respuesta lo dice en
39
- # `summary` + `pagination.hasMore` en vez de recortar en silencio.
40
- CMD crm task get <id>
41
- # task get returns `participants[]` with name, role, expertise, and
42
- # internalNotes (staff-only, markdown handling rules) — use it instead of a
43
- # follow-up `member list` when composing @mentions on an existing task.
44
- CMD crm task related <id>
45
- # task related groups: referenced (already linked via #), sameDomain, sharedTags.
46
- CMD crm task search <query> --limit <n>
47
- # task awaiting-reply — cola de tareas con un comentario de cliente aún sin
48
- # respuesta del equipo (--client la acota a un cliente).
49
- CMD crm task awaiting-reply --client <id>
50
- # task preflight — OBLIGATORIO antes de `task create`. Bundle de 1 round-trip:
51
- # similarTasks (FTS + Jaccard) · recall si --url · recentChanges en el dominio
52
- # · urlScopedTasks · recentBacklinks · openTaskCounts del dominio · hints[].
53
- # Si `hints` empieza con "Posible duplicado", PARA: revisa la tarea existente
54
- # antes de crear una nueva.
55
- CMD crm task preflight --title <title> --url <url> --domain <id> --limit <n> --since-ms <epoch>
56
- # task create / update accept the full mutation surface: `--assignee` (responsible)
57
- # vs `--collaborator` (follower); `--start` + `--due`; `--completion-strategy`
58
- # (all|any|manual); `--board` (move to another board on update); `--column`
59
- # (place the task in a kanban column on its board — adopts the column status and
60
- # applies its auto-assign, e.g. drops a redactor into their swimlane). `task
61
- # update` uses `--client-visible` / `--no-client-visible` (symmetric boolean flags).
62
- # `--file <path>` (repetible) adjunta archivos a la tarea. Máx 10 MB cada uno;
63
- # el CLI avisa en stderr a partir de 2 MB y rechaza localmente >10 MB antes de
64
- # tocar la red. En `task update` la lista es REEMPLAZO (los adjuntos antiguos
65
- # se borran salvo que también los pases); usa `--clear-files` para vaciar.
66
- # `--description-file <path>` lee el cuerpo de un fichero (markdown / code fences
67
- # seguros, evita la substitución de shell con backticks). Gana a `--description`.
68
- CMD crm task create --title <title> --description <text> --description-file <path> --domain <id> --board <id> --status <status> --assignee <id...> --collaborator <id...> --tag <id...> --start <date> --due <date> --completion-strategy <all|any|manual> --client-visible --completed-at <date> --no-review --file <path...>
69
- CMD crm task update <id> --title <title> --description <text> --description-file <path> --status <status> --domain <id> --board <id> --column <id> --assignee <id...> --collaborator <id...> --tag <id...> --start <date> --due <date> --completion-strategy <all|any|manual> --client-visible --no-client-visible --completed-at <date> --file <path...> --clear-files
70
- # task delete — destructivo, owner/admin. Borra la tarea (desadjunta timeEntries).
71
- CMD crm task delete <id>
72
- # Tableros kanban — `board list` descubre los tableros del workspace (id, nombre,
73
- # cliente, orden, isDefault); imprescindible para tableros vacíos, que de otro
74
- # modo solo se conocen por una tarea que ya viva en ellos. Filtra con --client.
75
- # Staff-only. `board columns <boardId>` lista las columnas (ordenadas) con su
76
- # autoAssignUserId / autoMoveOnAssign. Flujo redactores: `board columns` para
77
- # resolver la columna de cada redactor → `task update <id> --column <colId>`
78
- # (la auto-asignación coloca al redactor y la tarjeta cae en su columna).
79
- CMD crm board list --client <id> --archived
80
- CMD crm board columns <boardId>
81
- # Phase 41 — task ↔ backlink linking. `assets` returns the primary FK +
82
- # outgoing mentions in one payload; `link-backlink` sets the primary FK
83
- # (use --unlink to clear); `complete-with-evidence` closes a task citing a
84
- # backlink (server validates the comment cites the asset).
85
- CMD crm task assets <id>
86
- CMD crm task link-backlink <task-id> <backlink-id> --unlink
87
- CMD crm task complete-with-evidence <task-id> --asset <kind:id> --comment <id>
88
- # `task cancel` CIERRA la tarea sin contarla como entregada (status done +
89
- # resolution cancelled). Úsalo en vez de `--status done` cuando el trabajo se
90
- # descarta: una tarea cerrada como done se le reporta al cliente como trabajo
91
- # hecho. El motivo es obligatorio e interno (no lo ve el cliente). Para
92
- # reabrirla: `crm task update <id> --status todo` (limpia la cancelación).
93
- CMD crm task cancel <task-id> --reason <texto>
94
- # `task verify` — revisión de métricas ("aplicada, pendiente de revisión").
95
- # La tarea se completa el día que se aplica el cambio y se revisa N días
96
- # después: ese día avisa al equipo y entra en `verify list` con la foto de
97
- # métricas antes/después (ventanas simétricas alrededor del día aplicado +
98
- # metas de ranking). Veredicto: positive | neutral | negative | inconclusive.
99
- # Un AGENTE solo PROPONE (queda `proposed`, nota obligatoria, solo cuando ya
100
- # venció); una persona lo confirma en la bandeja. Staff-only.
101
- CMD crm task verify list --state <estado> --domain <id> --client <id>
102
- CMD crm task verify show <task-id>
103
- CMD crm task verify schedule <task-id> --in <días> --at <AAAA-MM-DD> --criteria <texto> --complete
104
- CMD crm task verify snooze <task-id> --in <días> --at <AAAA-MM-DD>
105
- CMD crm task verify resolve <task-id> --verdict <veredicto> --note <texto> --note-file <ruta>
106
- CMD crm task verify measure <task-id>
107
- CMD crm task verify clear <task-id>
108
-
109
- # `task tracking` — URLs tocadas por la tarea y ámbito de su revisión de
110
- # métricas. Cada registro de cambios añade su URL solo. Modos: urls (lista
111
- # exacta), pattern (filtro de página GSC, RE2: '\.html$' = todas las fichas)
112
- # o domain (propiedad entera). Al completar la tarea la revisión se programa
113
- # sola a --verify-days (28 por defecto) del cierre.
114
- CMD crm task tracking get <task-id>
115
- CMD crm task tracking set <task-id> --urls <lista> --urls-file <path> --add-url <url...> --pattern <expr> --operator <regex|contains|not_regex|not_contains> --domain --verify-days <n> --auto-verify --no-auto-verify
116
- # `task attach` — add/remove/list files INDIVIDUALLY (no clobber, unlike
117
- # `task update --file` which replaces the whole list). `attach remove` takes the
118
- # attachment id from `attach list`. Máx 10 MB/archivo, máx 50 archivos/tarea.
119
- CMD crm task attach list <taskId>
120
- CMD crm task attach add <taskId> --file <path...>
121
- CMD crm task attach remove <taskId> <attachmentId>
122
- # task board — multi-home (Asana-style). Una tarea vive en N boards del mismo
123
- # cliente, todos iguales (no hay board "principal"). `list` muestra los boards;
124
- # `add`/`remove` gestionan la pertenencia. Se puede quitar cualquiera; lo único
125
- # vetado es dejar la tarea sin ningún board.
126
- CMD crm task board list <taskId>
127
- CMD crm task board add <taskId> <boardId>
128
- CMD crm task board remove <taskId> <boardId>
129
-
130
- CMD crm comment list <taskId>
131
- # `--body` opcional si pasas `--file`. `--body-file <path>` lee el cuerpo de un
132
- # fichero (markdown / code fences seguros). `--file <path>` repetible para varios
133
- # adjuntos (máx 10 MB cada uno; aviso a partir de 2 MB).
134
- CMD crm comment create --task <id> --body <text> --body-file <path> --kind <note|agent_log|decision> --file <path...>
135
- # comment update — edita el cuerpo de un comentario propio (--id obligatorio).
136
- CMD crm comment update --id <commentId> --body <text> --body-file <path>
137
-
138
- # Chat — conversaciones ancladas a workspace/cliente/dominio + DMs y grupos.
139
- # Per-cliente las salas Interna y Compartida se auto-crean. Para chats libres
140
- # usa `chat dm` (1:1 idempotente; varios miembros = grupo). `chat reply`
141
- # crea sub-hilos sin salir del CLI; `chat react` activa/desactiva una de
142
- # las 8 reacciones curadas. Markdown + @[Name](id) + #[Title](id) soportados.
143
- CMD crm chat list --scope <workspace|client|dm> --client <id>
144
- CMD crm chat get <threadId> --message-limit <n>
145
- CMD crm chat read <threadId> --page-limit <n> --before <ms>
146
- CMD crm chat thread --workspace --client <id> --shared
147
- # `--body` opcional si pasas `--file`. `--file <path>` repetible para varios
148
- # adjuntos (máx 10 MB cada uno; el CLI avisa en stderr a partir de 2 MB y
149
- # rechaza localmente >10 MB antes de tocar la red).
150
- CMD crm chat send <threadId> --body <text> --file <path...> --kind <message|agent_log> --parent <messageId>
151
- CMD crm chat reply <messageId> --thread <id> --body <text> --file <path...> --kind <message|agent_log>
152
- CMD crm chat react <messageId> --emoji <👍|✅|👀|🙏|❤️|❓|🔥|🚀>
153
- CMD crm chat dm --member <id...> --title <name> --client <id>
154
- CMD crm chat mark-read <threadId> --message <id>
155
-
156
- CMD crm client list
157
- CMD crm client get <id>
158
- # create provisiona presupuesto + tablero por defecto; delete es cascade
159
- # (budgets + columnas + refs). Ambos solo owner/admin.
160
- CMD crm client create --name <name>
161
- CMD crm client delete <id>
162
- # Profile responses carry `internalNotes` (markdown, staff-only) — handling
163
- # rules like "never mention X to this CEO" / "always cc Eric as follower".
164
- # Read these before drafting any comment/mention. Never echo into client-
165
- # visible surfaces (shared chat, client-visible tasks, portal).
166
- CMD crm client profile <id>
167
- CMD crm client profile-set <id> --ceo-name <text> --ceo-role <text> --industry <text> --what-they-sell <text> --target-audience <text> --objectives <text> --usps <csv> --pain-points <csv> --tone-of-voice <text> --language-prefs <csv> --comms-preferences <text> --brief <md> --internal-notes <md>
168
-
169
- CMD crm domain list --client <id>
170
- CMD crm domain get <id>
171
- CMD crm domain metrics <id> --start <date> --end <date>
172
- CMD crm domain create --name <name> --url <url> --client <id> --favicon <url> --primary-metric <id> --currency <code>
173
- CMD crm domain profile <id>
174
- CMD crm domain profile-set <id> --positioning <text> --tone-override <text> --audience-override <text> --content-guidelines <text> --brief <md> --internal-notes <md>
175
-
176
- # property — fuente de datos individual (GSC site, GA4 property, Bing site, Ads
177
- # account, GBP location). Si pasas --account + source ingestible (gsc/ga4/bing)
178
- # se programa una ingesta inmediata de hasta 16 meses. Owner/admin only.
179
- CMD crm property create --source-type <gsc|ga4|bing|ads|gbp> --identifier <id> --display-name <name> --client <id> --domain <id> --account <id> --backfill <date> --favicon <url> --currency <code> --website-url <url>
180
- # update: campos omitidos no cambian; --clear-client / --clear-domain desvinculan.
181
- CMD crm property update <id> --display-name <name> --client <id> --clear-client --domain <id> --clear-domain --favicon <url> --primary-metric <id>
182
-
183
- CMD crm backlink list --domain <id> --status <status>
184
- # create: da de alta un enlace conseguido. --source-url es la URL EXACTA de la
185
- # pagina que enlaza, NUNCA el dominio (la salud se comprueba sobre esa URL, asi
186
- # que un dominio suelto deja un backlink que no se puede verificar nunca).
187
- # --target-url debe estar en el dominio indicado. Duplicado (mismo origen→destino
188
- # y misma tipologia) devuelve el id existente sin escribir salvo --allow-duplicate.
189
- CMD crm backlink create --domain <id> --source-url <url> --target-url <url> --go-live <YYYY-MM-DD> --placement-type <key> --anchor <text> --kind <link|mention> --link-type <dofollow|nofollow|ugc|sponsored> --brand-term <text> --provider <name> --cost <n> --currency <code> --notes <text> --contact-email <email> --task <id> --allow-duplicate
190
- CMD crm backlink lost --domain <id> --since <iso>
191
- CMD crm backlink list-tasks <backlink-id>
192
- # Human-QA verbs (staff-only). `pending` lists rows awaiting review; `verify`
193
- # is idempotent; `reject` requires a structured `--reason` and notifies the
194
- # creator; `rejection-report` aggregates rejected rows with reason breakdown.
195
- CMD crm backlink pending --domain <id> --client <id>
196
- CMD crm backlink verify <id>
197
- CMD crm backlink reject <id> --reason <spammy_source|wrong_anchor|wrong_target|nofollow_unexpected|dead_on_arrival|duplicate|policy_violation|other> --notes <text>
198
- CMD crm backlink rejection-report --domain <id> --client <id> --since-days <n>
199
- # Manual health-status override (audited). 'manual_override' parks the row;
200
- # 'non_crawlable' for links embedded in Issuu/Calameo/Yumpu/Scribd documents.
201
- CMD crm backlink set-status <id> --status <pending_check|active|nofollowed|anchor_changed|removed|broken|redirected|deindexed|blocked|non_crawlable|manual_override> --note <text>
202
- # Edita la URL de origen (subpagina equivocada) → recalcula + resetea salud + re-check.
203
- CMD crm backlink update <id> --source-url <url>
204
- # Cruza sospechosos vs Ahrefs (oráculo independiente). NO cambia estados.
205
- # Dry-run por defecto; --confirm gasta unidades (1 llamada filtrada, aborta si pocas).
206
- CMD crm backlink reconcile --domain <id> --confirm --unit-floor <n>
207
-
208
- # Social profiles (Phase 44) — store + manage a domain's / client's handles.
209
- # `--domain` for a site's profile, `--client` for a brand-level handle.
210
- # platform=other requires `--label`. Staff-only.
211
- CMD crm social list --domain <id> --client <id> --archived
212
- CMD crm social create --platform <instagram|facebook|x|youtube|tiktok|linkedin|pinterest|threads|trustpilot|other> --url <url> --domain <id> --client <id> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
213
- CMD crm social update <id> --platform <p> --url <url> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
214
- CMD crm social delete <id>
215
-
216
- # Todos los filtros son opcionales y combinables — sin ninguno lista el
217
- # workspace entero. --task es el más barato (índice propio) y devuelve lo mismo
218
- # que el log de cambios del cajón de la tarea. --url sin --domain vale: el
219
- # filtro de URL es exacto y se resuelve en el servidor.
220
- CMD crm change list --domain <id> --task <id> --url <url> --since <iso>
221
-
222
- # Registrar un cambio on-page (= botón «Registrar cambio» de la web). Un
223
- # registro = una URL: un cambio con --type, o varios con --items-file (array
224
- # JSON de {type,before,after,sourceUrl,anchor,direction,note}). --url por
225
- # defecto = URL objetivo de la meta de la tarea. --date = fecha real de
226
- # publicación (coloca el marcador en las gráficas; la revisión de métricas
227
- # cuenta desde que se completa la tarea). La URL entra sola en el seguimiento
228
- # de la tarea (crm task tracking get). Reglas por tipo:
229
- # metaTitle/metaDesc/h1 → --after; content → --after-file o --note; link* →
230
- # --source-url; linkChanged → --after (anchor nuevo); other → --note. Textos
231
- # largos o con acentos por fichero (*-file, UTF-8). Staff-only; sin --shadow
232
- # (no hay revisión de change events). Verifica en la página publicada antes.
233
- CMD crm change log --task <id> --type <metaTitle|metaDesc|h1|content|linkAdded|linkRemoved|linkChanged|other> --url <url> --date <AAAA-MM-DD|iso> --before <t> --before-file <path> --after <t> --after-file <path> --source-url <url> --anchor <t> --direction <inbound|outbound> --note <t> --note-file <path>
234
- CMD crm change log --task <id> --items-file <path.json> --url <url> --date <AAAA-MM-DD|iso> --note <t> --note-file <path>
235
-
236
- # Conector de webs — tienda (PrestaShop) y blog (WordPress) con la credencial
237
- # guardada en el CRM (Ajustes del dominio → Conexiones con la web). La
238
- # credencial nunca sale del servidor. Una conexión la usan owner/admin y las
239
- # personas autorizadas en ella. La URL elige la conexión (el blog en /blog
240
- # gana a la tienda del mismo dominio). Campos: h1, metaTitle,
241
- # metaDescription, content (HTML), summary (extracto / descripción corta /
242
- # descripción adicional), author (WP), noindex y canonical. Fuera: URL/slug,
243
- # precio, stock. Escribir exige un CLI con la versión mínima (crm update).
244
- CMD crm site list --domain <id>
245
- CMD crm site test <connection-id>
246
- # Reglas de publicación de la web (perfil del dominio, normas, comprobaciones,
247
- # skills y documentos completos). Obligatorio antes de escribir: update exige
248
- # haber leído la versión vigente en las últimas 24 h.
249
- CMD crm site rules --url <url> --connection <id>
250
- # Lee la página tal como está ahora. Siempre antes de cambiar nada.
251
- CMD crm site get --url <url> --ref <post|page|product|category|cms:id> --connection <id>
252
- # Escribe solo lo que cambia, vuelve a leer para confirmar, comprueba la página
253
- # publicada y crea el registro de cambios de la tarea (antes/después reales).
254
- # --task obligatorio (mismo dominio). Textos largos por fichero (UTF-8).
255
- # Indexación: --noindex noindex|index|default (noindex exige --allow-noindex y
256
- # avisa con los clics de la URL en Search Console); --canonical <url>|auto
257
- # (mismo dominio, destino 200 e indexable; si no, bloquea).
258
- CMD crm site update --task <id> --url <url> --ref <tipo:id> --connection <id> --h1 <t> --h1-file <path> --meta-title <t> --meta-title-file <path> --meta-desc <t> --meta-desc-file <path> --content <html> --content-file <path> --summary <html> --summary-file <path> --author <id> --noindex <noindex|index|default> --allow-noindex --canonical <url|auto> --note <t> --note-file <path> --dry-run
259
- # Ventas reales de la tienda (PrestaShop), sumadas cada noche: de una ficha o
260
- # categoría (28 y 90 días con interanual, puesto en su categoría o top 10 de
261
- # la categoría) o ranking de fichas por facturación. Pedidos válidos y no
262
- # cancelados de la tienda e idioma de la conexión; sin IVA. Nunca stock.
263
- CMD crm site sales --url <url> --ref <product|category:id> --connection <id>
264
- CMD crm site sales --top <n> --category <id> --days <28|90|365> --connection <id>
265
-
266
- CMD crm scope list --domain <id> --kind <saved|ephemeral>
267
- CMD crm scope get <id>
268
-
269
- CMD crm competitor list --domain <id>
270
-
271
- CMD crm tag list
272
- # member list filters help resolve a name fragment to a memberId before composing @[Name](id).
273
- CMD crm member list --query <text> --email <text> --client <id> --domain <id> --role <csv>
274
- CMD crm member profile <id>
275
- CMD crm member profile-set <id> --title <text> --bio <text> --expertise <csv> --preferred-contact <text> --timezone <iana> --working-hours <text> --internal-notes <md>
276
-
277
- # Mention resolvers — print the markdown chip on stdout, exit 8 on ambiguous, 2 on no match.
278
- # Compose into writes via shell substitution: --body "$(crm mention member luis) ping"
279
- CMD crm mention member <query> --client <id> --domain <id> --role <csv>
280
- CMD crm mention task <query> --domain <id> --status <status>
281
-
282
- # Agent memory primer — aggregates client profile + all domain profiles + assigned staff.
283
- # Call this before drafting client-visible content (comments, task titles, proposals).
284
- # --domain narrows to staff with activity on a domain + open tasks under it.
285
- # --task is the URL-of-tasks: participants + parent domain + cross-refs already linked.
286
- CMD crm brief [clientId] --domain <id> --task <id>
287
-
288
- CMD crm recall <url> --since <iso>
289
- # search result rows: { id, kind: task|description|comment|change, score, snippet, breadcrumb[] }
290
- # Use --jq '.data[].snippet' for titles-in-context; NOT .data[].title (not present)
291
- CMD crm search <query> --kind <task|description|comment|change|all> --domain <id>
292
-
293
- CMD crm inbox list
294
- CMD crm inbox read <category>
295
-
296
- CMD crm review list --mine --key <apiKeyId>
297
- CMD crm review show <task|comment|edit> <id>
298
- # review approve task <id> sobre una tarea aplicada con REVISAR (reviewRequired) la
299
- # acepta (= botón Aceptar de la web); --completed-at fecha trabajo cerrado fuera
300
- # del CRM (solo staff, tarea en done, sin fechas futuras).
301
- CMD crm review approve <task|comment|edit> <id>
302
- CMD crm review reject <task|comment|edit> <id> --reason <text>
303
- # Agent iteration loop — read your own rejected proposals + the reviewer's
304
- # reason. `--retryable-only` filters to items the reviewer wants you to redo.
305
- CMD crm review feedback --retryable-only --key <apiKeyId>
306
- # Bulk approve / reject — items via stdin (NDJSON or 'kind:id' tokens; ≤100).
307
- # The mini-jq embedded in --jq does NOT support `|` or `\(.x)` interpolation —
308
- # use real `jq` post-pipe, or pass tokens by hand.
309
- # Example: crm review list --mine --quiet | jq -r '.[] | "\(.kind):\(.id)"' | crm review bulk-approve
310
- CMD crm review bulk-approve
311
- CMD crm review bulk-reject --reason <text> --no-retry
312
-
313
- # Access requests — chat-driven flow. Clients (or agents acting as clients)
314
- # request access to a task they spotted in a chat thread; staff resolve.
315
- # The verbs used to live under `crm task {request,list,approve,deny}-access`
316
- # (still work for one release with a deprecation hint).
317
- CMD crm access request <task-id> --via <message-id> --message <text>
318
- CMD crm access list
319
- CMD crm access approve <request-id> --scope <task|board> --note <text>
320
- CMD crm access deny <request-id> --note <text>
321
-
322
- # Workspace-wide rollup of all properties for a date range — useful for
323
- # overview prompts. Sources from Tinybird.
324
- CMD crm dashboard summary --start <date> --end <date>
325
-
326
- CMD crm integration list
327
- CMD crm integration sites --account <id> --service <gsc|ga4|bing>
328
- CMD crm integration sync --property <id>
329
-
330
- # Merchant Center: fotos diarias de solo lectura (estado por fuente, avisos,
331
- # clics de producto a 28 días, comprobaciones como idioma de feed mal puesto).
332
- # <account> acepta el id del CRM o el ID numérico de Merchant.
333
- CMD crm merchant list --client <id>
334
- CMD crm merchant get <account>
335
- CMD crm merchant sync <account>
336
- CMD crm merchant task <account> --check <key> --board <id> --assignee <memberId> --title <text>
337
- CMD crm merchant add --client <id> --merchant-id <id> --label <text>
338
-
339
- # gsc/ga4/bing/ads query hit the live provider API (tokens stay on server).
340
- # --filters is ';'-separated. Format: "<dim> <op> <expr>; ..."
341
- # Operators (GSC + Bing): equals | contains | regex | not_equals | not_contains | not_regex
342
- # Operators (GA4 adds): batch (inListFilter; value is newline-separated)
343
- # ads query is read-only GAQL; cost is returned in micros (÷1e6 for currency).
344
- CMD crm gsc query --property <id> --account <id> --site-url <url> --start <date> --end <date> --dimension <date|page|query|country|device> --filters <expr> --cursor <n>
345
- CMD crm ga4 query --property <id> --account <id> --ga4-property <num> --start <date> --end <date> --filters <expr> --dimensions <list> --metrics <list>
346
- CMD crm bing query --property <id> --account <id> --site-url <url> --start <date> --end <date>
347
- CMD crm ads query --property <id> --account <id> --customer-id <id> --start <date> --end <date>
348
- CMD crm ads whoami --account <id> # diagnóstico OAuth: scopes concedidos + ¿'adwords'? + MCC/dev-token
349
- CMD crm ads accounts --account <id> # enumera cuentas hijas del MCC (customerId/nombre/moneda)
350
- CMD crm ads campaigns --property <id> --account <id> --customer-id <id> --start <date> --end <date> --compare-start <date> --compare-end <date> # desglose por campaña + CPA/ROAS + deltas
351
- CMD crm ads anomalies --property <id> --start <date> --end <date> --compare-start <date> --compare-end <date> # pico CPA/caída ROAS/gasto disparado/0-conv por cuenta (omite --property = todas)
352
- CMD crm ads pacing --property <id> --month-start <date> --as-of <date> # gasto MTD vs presupuesto + proyección (omite --property = todas)
353
- CMD crm ads budget --property <id> --set <amount> --clear # sin --set/--clear lee; --set fija; --clear elimina
354
- CMD crm ads import # dispara ingesta fresca de Google Ads (diaria + campañas) del workspace
355
-
356
- # Agency skills — librería de playbooks para Claude Code. `pull` escribe en
357
- # `.claude/skills/<slug>/SKILL.md` + recursos; el manifest se guarda en
358
- # `.claude/skills/.crm-manifest.json` para que `update` detecte desactualizados.
359
- # `init` copia los tool-skills que vienen en el bundle del CLI (sin login).
360
- CMD crm skill init --dry-run --force --preserve
361
- CMD crm skill list --category <name> --status <draft|published|archived> --tag <id> --q <text>
362
- CMD crm skill show <slug> --revision <id>
363
- CMD crm skill revisions <slug>
364
- CMD crm skill revision <id>
365
- # skill create lands a draft; first publish via `crm skill push <slug> --publish`.
366
- CMD crm skill create --slug <slug> --name <name> --description <text> --category <local-seo|google-ads|technical-seo|content|link-building|crm-ops|workflow|general> --kind <playbook|workflow|tool|reference> --tag <id...> --visibility <workspace|staff_only> --body <md> --frontmatter <yaml>
367
- # skill set patches metadata only; body edits go through `crm skill push`.
368
- CMD crm skill set <slug> --name <name> --description <text> --category <name> --kind <kind> --tag <id...> --visibility <workspace|staff_only>
369
- # skill push — sube el cuerpo editado a Convex (draft). `--submit` lo manda al
370
- # inbox de revisión (member/agent); `--publish` publica directo (owner/admin);
371
- # `--force` ignora drift; `--force-overwrite-draft` pisa un draft pendiente ajeno.
372
- CMD crm skill push <slug> --note <text> --publish --submit --force --force-overwrite-draft --dry-run
373
- CMD crm skill archive <slug>
374
- CMD crm skill restore <slug>
375
- # skill remove — borra el mirror local (`--purge` también quita la entrada del manifest).
376
- CMD crm skill remove <slug> --purge
377
- CMD crm skill pull <slug> --revision <id> --dry-run --preserve --force
378
- CMD crm skill pull --all --category <name> --tag <id>
379
- CMD crm skill update --dry-run --preserve --prune-archived
380
- CMD crm skill diff <slug>
381
- # skill review — inbox de aprobación (owner/admin). `list` muestra revisiones
382
- # sugeridas pendientes; `approve`/`reject` resuelven una por id.
383
- CMD crm skill review list
384
- CMD crm skill review approve <id>
385
- CMD crm skill review reject <id> --reason <text>
386
-
387
- # Documentos de trabajo de cliente — procesos en markdown editables por IA.
388
- # Anclados a un cliente; internos por defecto, opt-in a cliente con `share`.
389
- # Cuerpos largos/markdown SIEMPRE por `--body-file` (no `--body "$(cat)"`).
390
- CMD crm doc list --client <id> --kind <proceso|guia|nota|entregable> --status <draft|published|archived> --q <text>
391
- CMD crm doc get <slug> --client <id>
392
- CMD crm doc content <slug> --client <id> --revision <id>
393
- CMD crm doc revisions <slug> --client <id>
394
- CMD crm doc create --client <id> --slug <slug> --title <text> --summary <text> --kind <proceso|guia|nota|entregable> --domain <id> --body <md> --body-file <path> --format <markdown|html>
395
- CMD crm doc update <slug> --client <id> --title <text> --summary <text> --kind <kind> --domain <id> --body <md> --body-file <path> --format <markdown|html>
396
- CMD crm doc publish <slug> --client <id> --note <text>
397
- CMD crm doc share <slug> --client <id> --retract
398
- CMD crm doc archive <slug> --client <id>
399
- CMD crm doc restore <slug> --client <id>
400
-
401
- CMD crm time log --task <id> --description <text> --date <YYYY-MM-DD> --started-at <epoch|iso> --ended-at <epoch|iso> --duration <minutes>
402
- CMD crm time list --from <YYYY-MM-DD> --to <YYYY-MM-DD> --user <id>
403
- # Entries linked to a specific task (no date filter).
404
- CMD crm time list-task <taskId>
405
- CMD crm time status
406
- CMD crm time start --task <id> --description <text>
407
- CMD crm time stop --description <text>
408
- CMD crm time discard
409
- CMD crm time update <id> --started-at <epoch|iso> --ended-at <epoch|iso> --description <text> --task <id>
410
- CMD crm time delete <id> --reason <text>
411
- CMD crm time hours <YYYY-MM> --employee <email>
412
- CMD crm time budgets
413
- CMD crm time usage <id>
414
-
415
- # Rank tracker — agency-internal (clients never granted the scopes).
416
- # `list` returns the same shape the dashboard reads, so `--ids-only` pipes
417
- # straight into the bulk commands. Bulk endpoints cap at 500 ids; pass them
418
- # positionally, via --stdin (newline/space/comma) or --ids-from-file.
419
- # `delete` refuses the whole batch when any keyword still has an active
420
- # rank goal — unlink the task first.
421
- CMD crm rank list --domain <id> --country <iso2> --device <mobile|desktop> --state <pending_sync|active|orphan|archived> --unranked --canibalised --favorites --search <text> --limit <n>
422
- CMD crm rank get <id>
423
- # rank inspect — diagnóstico GRATIS de una keyword (0 unidades Ahrefs): por qué no
424
- # tiene snapshot / posición. rank reconcile — chequeo de drift gratis que marca
425
- # keywords huérfanas (dry-run por defecto).
426
- CMD crm rank inspect <id>
427
- CMD crm rank reconcile --domain <id> --dry-run
428
- CMD crm rank add --domain <id> --country <iso2> --device <mobile|desktop> --tag <name...> --text <raw>|--file <path>|--stdin
429
- CMD crm rank tag [ids...] --add <tag...> --remove <tag...> --replace <tag...> --stdin --ids-from-file <path>
430
- # rank favorite — marca (o --off desmarca) el set top-N que alimenta la posición
431
- # media del proyecto (la vista que ve el cliente en el portal). Máx 500 por lote.
432
- CMD crm rank favorite [ids...] --off --stdin --ids-from-file <path>
433
- CMD crm rank archive [ids...] --stdin --ids-from-file <path>
434
- CMD crm rank restore [ids...] --stdin --ids-from-file <path>
435
- CMD crm rank delete [ids...] --stdin --ids-from-file <path>
436
- # rank goal — KPI binding keyword↔tarea↔URL (lo que la UI/importer escriben).
437
- # `set` upsertea (crea la keyword si no existe); `move` re-apunta un goal a otra
438
- # tarea (corrige goals mal atados por el importer); `unlink` lo borra.
439
- CMD crm rank goal set --task <id> --keyword <kw> --url <url> --target-position <n> --country <iso2> --device <mobile|desktop>
440
- CMD crm rank goal move <goalId> --to-task <id> --url <url> --target-position <n>
441
- CMD crm rank goal unlink <goalId>
442
-
443
- # Meta title + description — dossier de datos reales (sin créditos Ahrefs).
444
- # Reúne Rank Tracker + queries GSC de la URL + canibalización en una llamada.
445
- # Interpreta la salida con la skill de agencia `optimizar-metas`.
446
- CMD crm meta brief --task <id> --url <url> --domain <id> --kw <keyword> --start <date> --end <date>
447
-
448
- # Report schedules — list/get/run/snapshots/approve/reject covered. CRUD
449
- # bodies are too rich for flat flags; `create` and `update` take JSON via
450
- # --body (inline string | '@file.json' | '-' for stdin).
451
- CMD crm report types
452
- CMD crm report list
453
- CMD crm report get <id>
454
- CMD crm report create --body <json|@path|->
455
- CMD crm report update <id> --body <json|@path|->
456
- CMD crm report delete <id>
457
- CMD crm report run <id>
458
- CMD crm report snapshots --schedule <id> --limit <n>
459
- CMD crm report snapshot <id>
460
- CMD crm report approve <id> --note <text>
461
- CMD crm report reject <id> --reason <text>
462
-
463
- # Dump the full CLI surface as JSON so agents can introspect without help-text
464
- # parsing. `{ data: { tree, flat } }` — `flat` is the linear command list.
465
- CMD crm commands
466
-
467
- CMD crm doctor
468
- # Actualiza el CLI a la última versión (npm i -g @roilab/crm-cli@latest);
469
- # --check solo compara. Cuando el CLI avise de versión nueva, ejecútalo.
470
- CMD crm update --check
471
-
472
- # Global flags (available on every command):
473
- FLAG --json full JSON envelope (default)
474
- FLAG --quiet only `data`, no envelope
475
- FLAG --ids-only one id per line
476
- FLAG --count single integer
477
- FLAG --markdown human-readable preview
478
- FLAG --styled alias of --markdown (reserved for colored output)
479
- FLAG --jq <expr> tiny jq (.a, .a.b, .a[], .a[].b)
480
- FLAG --profile <name> named credentials profile
481
- FLAG --workspace <id> workspace override
482
- FLAG --all walk Link-next pages
483
- FLAG --limit <n> max rows
484
- FLAG --since <iso> lower bound on creation/update time
485
- FLAG --idempotency-key stable retry key (autogenerated on writes if omitted)
486
- FLAG --wait-for-approval block until a human decides (shadow-mode writes only)
487
- FLAG --timeout <dur> timeout for --wait-for-approval, e.g. 30s, 5m, 2h (default 30m)
488
- FLAG --shadow force this write to land as a pending proposal for human review (one-way: agents cannot downgrade to autonomous)
489
- FLAG --as-agent stamp this invocation as an AI agent (actorType:agent, AGENT badge). Auto-detected under Claude Code / Codex.
1
+ # Format: one line per command, flags flat, types terse.
2
+ # Agents: grep this to discover capabilities without reading help pages.
3
+
4
+ # ── Capacidades que NO son verbos (sólo flags) ─────────────────────────
5
+ # Si grepeas la lista de verbos te las saltas. Existen en escrituras:
6
+ # ATTACH file uploads via --file <path...> → task create, task update,
7
+ # comment create, chat send, chat reply. Max 10 MB/archivo,
8
+ # aviso desde 2 MB, --clear-files en task update vacía la lista.
9
+ # Endpoints REST: POST /api/v1/uploads (genérico tareas/comentarios)
10
+ # y POST /api/v1/chats/:id/uploads (chat). Two-step: pides URL →
11
+ # PUT bytes a Convex storage → mandas attachments[] al write.
12
+ # REUSE El mismo fichero adjuntado a N tareas ocupa UN solo blob. Antes de
13
+ # subir, el CLI hashea (sha-256) y consulta GET /api/v1/uploads/lookup
14
+ # ?contentHash=<hex>; si el workspace ya lo tiene, reutiliza ese
15
+ # storageId y no sube bytes (stderr: "[INFO] ... se reutiliza el blob").
16
+ # El hash viaja además en attachments[].contentHash, así que el
17
+ # servidor colapsa gemelos aunque el lookup falle. Sólo aplica a
18
+ # tareas/comentarios: chat sube siempre su copia porque su GC cuenta
19
+ # referencias en otra tabla. No hay flag — es automático.
20
+ # SHADOW --shadow fuerza la escritura a propuesta pendiente de revisión.
21
+ # WAIT --wait-for-approval --timeout 30m bloquea hasta decisión humana.
22
+ # IDEMP --idempotency-key <ulid> = reintentos seguros entre invocaciones.
23
+
24
+ CMD crm auth login [key] --profile <name> --api-url <url> --device-name <label>
25
+ CMD crm auth whoami
26
+ CMD crm auth list
27
+ CMD crm auth switch <name>
28
+ CMD crm auth logout [name]
29
+
30
+ CMD crm task list --status <status> --domain <id> --board <id> --column <id> --assignee <id> --tag <id> --review-pending --review-acked --limit <n>
31
+ # --review-pending / --review-acked filtran la cola de revisión (agente pendiente
32
+ # de aceptar vs ya aceptada por staff).
33
+ # --board filtra por tablero incluyendo su multi-home; --column por la columna
34
+ # en la que la tarea SE PINTA (sin colocación explícita cae en la primera columna
35
+ # de su estado, igual que el kanban), y ya implica su tablero. Sirven para leer
36
+ # una sola swimlane (p. ej. el backlog "To Do" de un board de redactores).
37
+ # Ambos bajan al índice del tablero: no truncan y no leen el workspace entero.
38
+ # Si hay más resultados que --limit (máx. 500), la respuesta lo dice en
39
+ # `summary` + `pagination.hasMore` en vez de recortar en silencio.
40
+ CMD crm task get <id>
41
+ # task get returns `participants[]` with name, role, expertise, and
42
+ # internalNotes (staff-only, markdown handling rules) — use it instead of a
43
+ # follow-up `member list` when composing @mentions on an existing task.
44
+ CMD crm task related <id>
45
+ # task related groups: referenced (already linked via #), sameDomain, sharedTags.
46
+ CMD crm task search <query> --limit <n>
47
+ # task awaiting-reply — cola de tareas con un comentario de cliente aún sin
48
+ # respuesta del equipo (--client la acota a un cliente).
49
+ CMD crm task awaiting-reply --client <id>
50
+ # task preflight — OBLIGATORIO antes de `task create`. Bundle de 1 round-trip:
51
+ # similarTasks (FTS + Jaccard) · recall si --url · recentChanges en el dominio
52
+ # · urlScopedTasks · recentBacklinks · openTaskCounts del dominio · hints[].
53
+ # Si `hints` empieza con "Posible duplicado", PARA: revisa la tarea existente
54
+ # antes de crear una nueva.
55
+ CMD crm task preflight --title <title> --url <url> --domain <id> --limit <n> --since-ms <epoch>
56
+ # task create / update accept the full mutation surface: `--assignee` (responsible)
57
+ # vs `--collaborator` (follower); `--start` + `--due`; `--completion-strategy`
58
+ # (all|any|manual); `--board` (move to another board on update); `--column`
59
+ # (place the task in a kanban column on its board — adopts the column status and
60
+ # applies its auto-assign, e.g. drops a redactor into their swimlane). `task
61
+ # update` uses `--client-visible` / `--no-client-visible` (symmetric boolean flags).
62
+ # `--file <path>` (repetible) adjunta archivos a la tarea. Máx 10 MB cada uno;
63
+ # el CLI avisa en stderr a partir de 2 MB y rechaza localmente >10 MB antes de
64
+ # tocar la red. En `task update` la lista es REEMPLAZO (los adjuntos antiguos
65
+ # se borran salvo que también los pases); usa `--clear-files` para vaciar.
66
+ # `--description-file <path>` lee el cuerpo de un fichero (markdown / code fences
67
+ # seguros, evita la substitución de shell con backticks). Gana a `--description`.
68
+ CMD crm task create --title <title> --description <text> --description-file <path> --domain <id> --board <id> --status <status> --assignee <id...> --collaborator <id...> --tag <id...> --start <date> --due <date> --completion-strategy <all|any|manual> --client-visible --completed-at <date> --no-review --file <path...>
69
+ CMD crm task update <id> --title <title> --description <text> --description-file <path> --status <status> --domain <id> --board <id> --column <id> --assignee <id...> --collaborator <id...> --tag <id...> --start <date> --due <date> --completion-strategy <all|any|manual> --client-visible --no-client-visible --completed-at <date> --file <path...> --clear-files
70
+ # task delete — destructivo, owner/admin. Borra la tarea (desadjunta timeEntries).
71
+ CMD crm task delete <id>
72
+ # Tableros kanban — `board list` descubre los tableros del workspace (id, nombre,
73
+ # cliente, orden, isDefault); imprescindible para tableros vacíos, que de otro
74
+ # modo solo se conocen por una tarea que ya viva en ellos. Filtra con --client.
75
+ # Staff-only. `board columns <boardId>` lista las columnas (ordenadas) con su
76
+ # autoAssignUserId / autoMoveOnAssign. Flujo redactores: `board columns` para
77
+ # resolver la columna de cada redactor → `task update <id> --column <colId>`
78
+ # (la auto-asignación coloca al redactor y la tarjeta cae en su columna).
79
+ CMD crm board list --client <id> --archived
80
+ CMD crm board columns <boardId>
81
+ # Phase 41 — task ↔ backlink linking. `assets` returns the primary FK +
82
+ # outgoing mentions in one payload; `link-backlink` sets the primary FK
83
+ # (use --unlink to clear); `complete-with-evidence` closes a task citing a
84
+ # backlink (server validates the comment cites the asset).
85
+ CMD crm task assets <id>
86
+ CMD crm task link-backlink <task-id> <backlink-id> --unlink
87
+ CMD crm task complete-with-evidence <task-id> --asset <kind:id> --comment <id>
88
+ # `task cancel` CIERRA la tarea sin contarla como entregada (status done +
89
+ # resolution cancelled). Úsalo en vez de `--status done` cuando el trabajo se
90
+ # descarta: una tarea cerrada como done se le reporta al cliente como trabajo
91
+ # hecho. El motivo es obligatorio e interno (no lo ve el cliente). Para
92
+ # reabrirla: `crm task update <id> --status todo` (limpia la cancelación).
93
+ CMD crm task cancel <task-id> --reason <texto>
94
+ # `task verify` — revisión de métricas ("aplicada, pendiente de revisión").
95
+ # La tarea se completa el día que se aplica el cambio y se revisa N días
96
+ # después: ese día avisa al equipo y entra en `verify list` con la foto de
97
+ # métricas antes/después (ventanas simétricas alrededor del día aplicado +
98
+ # metas de ranking). Veredicto: positive | neutral | negative | inconclusive.
99
+ # Un AGENTE solo PROPONE (queda `proposed`, nota obligatoria, solo cuando ya
100
+ # venció); una persona lo confirma en la bandeja. Staff-only.
101
+ CMD crm task verify list --state <estado> --domain <id> --client <id>
102
+ CMD crm task verify show <task-id>
103
+ CMD crm task verify schedule <task-id> --in <días> --at <AAAA-MM-DD> --criteria <texto> --complete
104
+ CMD crm task verify snooze <task-id> --in <días> --at <AAAA-MM-DD>
105
+ CMD crm task verify resolve <task-id> --verdict <veredicto> --note <texto> --note-file <ruta>
106
+ CMD crm task verify measure <task-id>
107
+ CMD crm task verify clear <task-id>
108
+
109
+ # `task tracking` — URLs tocadas por la tarea y ámbito de su revisión de
110
+ # métricas. Cada registro de cambios añade su URL solo. Modos: urls (lista
111
+ # exacta), pattern (filtro de página GSC, RE2: '\.html$' = todas las fichas)
112
+ # o domain (propiedad entera). Al completar la tarea la revisión se programa
113
+ # sola a --verify-days (28 por defecto) del cierre.
114
+ CMD crm task tracking get <task-id>
115
+ CMD crm task tracking set <task-id> --urls <lista> --urls-file <path> --add-url <url...> --pattern <expr> --operator <regex|contains|not_regex|not_contains> --domain --verify-days <n> --auto-verify --no-auto-verify
116
+ # `task attach` — add/remove/list files INDIVIDUALLY (no clobber, unlike
117
+ # `task update --file` which replaces the whole list). `attach remove` takes the
118
+ # attachment id from `attach list`. Máx 10 MB/archivo, máx 50 archivos/tarea.
119
+ CMD crm task attach list <taskId>
120
+ CMD crm task attach add <taskId> --file <path...>
121
+ CMD crm task attach remove <taskId> <attachmentId>
122
+ # task board — multi-home (Asana-style). Una tarea vive en N boards del mismo
123
+ # cliente, todos iguales (no hay board "principal"). `list` muestra los boards;
124
+ # `add`/`remove` gestionan la pertenencia. Se puede quitar cualquiera; lo único
125
+ # vetado es dejar la tarea sin ningún board.
126
+ CMD crm task board list <taskId>
127
+ CMD crm task board add <taskId> <boardId>
128
+ CMD crm task board remove <taskId> <boardId>
129
+
130
+ CMD crm comment list <taskId>
131
+ # `--body` opcional si pasas `--file`. `--body-file <path>` lee el cuerpo de un
132
+ # fichero (markdown / code fences seguros). `--file <path>` repetible para varios
133
+ # adjuntos (máx 10 MB cada uno; aviso a partir de 2 MB).
134
+ CMD crm comment create --task <id> --body <text> --body-file <path> --kind <note|agent_log|decision> --file <path...>
135
+ # comment update — edita el cuerpo de un comentario propio (--id obligatorio).
136
+ CMD crm comment update --id <commentId> --body <text> --body-file <path>
137
+
138
+ # Chat — conversaciones ancladas a workspace/cliente/dominio + DMs y grupos.
139
+ # Per-cliente las salas Interna y Compartida se auto-crean. Para chats libres
140
+ # usa `chat dm` (1:1 idempotente; varios miembros = grupo). `chat reply`
141
+ # crea sub-hilos sin salir del CLI; `chat react` activa/desactiva una de
142
+ # las 8 reacciones curadas. Markdown + @[Name](id) + #[Title](id) soportados.
143
+ CMD crm chat list --scope <workspace|client|dm> --client <id>
144
+ CMD crm chat get <threadId> --message-limit <n>
145
+ CMD crm chat read <threadId> --page-limit <n> --before <ms>
146
+ CMD crm chat thread --workspace --client <id> --shared
147
+ # `--body` opcional si pasas `--file`. `--file <path>` repetible para varios
148
+ # adjuntos (máx 10 MB cada uno; el CLI avisa en stderr a partir de 2 MB y
149
+ # rechaza localmente >10 MB antes de tocar la red).
150
+ CMD crm chat send <threadId> --body <text> --file <path...> --kind <message|agent_log> --parent <messageId>
151
+ CMD crm chat reply <messageId> --thread <id> --body <text> --file <path...> --kind <message|agent_log>
152
+ CMD crm chat react <messageId> --emoji <👍|✅|👀|🙏|❤️|❓|🔥|🚀>
153
+ CMD crm chat dm --member <id...> --title <name> --client <id>
154
+ CMD crm chat mark-read <threadId> --message <id>
155
+
156
+ CMD crm client list
157
+ CMD crm client get <id>
158
+ # create provisiona presupuesto + tablero por defecto; delete es cascade
159
+ # (budgets + columnas + refs). Ambos solo owner/admin.
160
+ CMD crm client create --name <name>
161
+ CMD crm client delete <id>
162
+ # Profile responses carry `internalNotes` (markdown, staff-only) — handling
163
+ # rules like "never mention X to this CEO" / "always cc Eric as follower".
164
+ # Read these before drafting any comment/mention. Never echo into client-
165
+ # visible surfaces (shared chat, client-visible tasks, portal).
166
+ CMD crm client profile <id>
167
+ CMD crm client profile-set <id> --ceo-name <text> --ceo-role <text> --industry <text> --what-they-sell <text> --target-audience <text> --objectives <text> --usps <csv> --pain-points <csv> --tone-of-voice <text> --language-prefs <csv> --comms-preferences <text> --brief <md> --internal-notes <md>
168
+
169
+ CMD crm domain list --client <id>
170
+ CMD crm domain get <id>
171
+ CMD crm domain metrics <id> --start <date> --end <date>
172
+ CMD crm domain create --name <name> --url <url> --client <id> --favicon <url> --primary-metric <id> --currency <code>
173
+ CMD crm domain profile <id>
174
+ CMD crm domain profile-set <id> --positioning <text> --tone-override <text> --audience-override <text> --content-guidelines <text> --brief <md> --internal-notes <md>
175
+
176
+ # property — fuente de datos individual (GSC site, GA4 property, Bing site, Ads
177
+ # account, GBP location). Si pasas --account + source ingestible (gsc/ga4/bing)
178
+ # se programa una ingesta inmediata de hasta 16 meses. Owner/admin only.
179
+ CMD crm property create --source-type <gsc|ga4|bing|ads|gbp> --identifier <id> --display-name <name> --client <id> --domain <id> --account <id> --backfill <date> --favicon <url> --currency <code> --website-url <url>
180
+ # update: campos omitidos no cambian; --clear-client / --clear-domain desvinculan.
181
+ CMD crm property update <id> --display-name <name> --client <id> --clear-client --domain <id> --clear-domain --favicon <url> --primary-metric <id>
182
+
183
+ CMD crm backlink list --domain <id> --status <status>
184
+ # create: da de alta un enlace conseguido. --source-url es la URL EXACTA de la
185
+ # pagina que enlaza, NUNCA el dominio (la salud se comprueba sobre esa URL, asi
186
+ # que un dominio suelto deja un backlink que no se puede verificar nunca).
187
+ # --target-url debe estar en el dominio indicado. Duplicado (mismo origen→destino
188
+ # y misma tipologia) devuelve el id existente sin escribir salvo --allow-duplicate.
189
+ CMD crm backlink create --domain <id> --source-url <url> --target-url <url> --go-live <YYYY-MM-DD> --placement-type <key> --anchor <text> --kind <link|mention> --link-type <dofollow|nofollow|ugc|sponsored> --brand-term <text> --provider <name> --cost <n> --currency <code> --notes <text> --contact-email <email> --task <id> --allow-duplicate
190
+ CMD crm backlink lost --domain <id> --since <iso>
191
+ CMD crm backlink list-tasks <backlink-id>
192
+ # Human-QA verbs (staff-only). `pending` lists rows awaiting review; `verify`
193
+ # is idempotent; `reject` requires a structured `--reason` and notifies the
194
+ # creator; `rejection-report` aggregates rejected rows with reason breakdown.
195
+ CMD crm backlink pending --domain <id> --client <id>
196
+ CMD crm backlink verify <id>
197
+ CMD crm backlink reject <id> --reason <spammy_source|wrong_anchor|wrong_target|nofollow_unexpected|dead_on_arrival|duplicate|policy_violation|other> --notes <text>
198
+ CMD crm backlink rejection-report --domain <id> --client <id> --since-days <n>
199
+ # Manual health-status override (audited). 'manual_override' parks the row;
200
+ # 'non_crawlable' for links embedded in Issuu/Calameo/Yumpu/Scribd documents.
201
+ CMD crm backlink set-status <id> --status <pending_check|active|nofollowed|anchor_changed|removed|broken|redirected|deindexed|blocked|non_crawlable|manual_override> --note <text>
202
+ # Edita la URL de origen (subpagina equivocada) → recalcula + resetea salud + re-check.
203
+ CMD crm backlink update <id> --source-url <url>
204
+ # Cruza sospechosos vs Ahrefs (oráculo independiente). NO cambia estados.
205
+ # Dry-run por defecto; --confirm gasta unidades (1 llamada filtrada, aborta si pocas).
206
+ CMD crm backlink reconcile --domain <id> --confirm --unit-floor <n>
207
+
208
+ # Social profiles (Phase 44) — store + manage a domain's / client's handles.
209
+ # `--domain` for a site's profile, `--client` for a brand-level handle.
210
+ # platform=other requires `--label`. Staff-only.
211
+ CMD crm social list --domain <id> --client <id> --archived
212
+ CMD crm social create --platform <instagram|facebook|x|youtube|tiktok|linkedin|pinterest|threads|trustpilot|other> --url <url> --domain <id> --client <id> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
213
+ CMD crm social update <id> --platform <p> --url <url> --handle <h> --label <l> --primary --order <n> --notes <t> --internal-notes <t>
214
+ CMD crm social delete <id>
215
+
216
+ # Todos los filtros son opcionales y combinables — sin ninguno lista el
217
+ # workspace entero. --task es el más barato (índice propio) y devuelve lo mismo
218
+ # que el log de cambios del cajón de la tarea. --url sin --domain vale: el
219
+ # filtro de URL es exacto y se resuelve en el servidor.
220
+ CMD crm change list --domain <id> --task <id> --url <url> --since <iso>
221
+
222
+ # Registrar un cambio on-page (= botón «Registrar cambio» de la web). Un
223
+ # registro = una URL: un cambio con --type, o varios con --items-file (array
224
+ # JSON de {type,before,after,sourceUrl,anchor,direction,note}). --url por
225
+ # defecto = URL objetivo de la meta de la tarea. --date = fecha real de
226
+ # publicación (coloca el marcador en las gráficas; la revisión de métricas
227
+ # cuenta desde que se completa la tarea). La URL entra sola en el seguimiento
228
+ # de la tarea (crm task tracking get). Reglas por tipo:
229
+ # metaTitle/metaDesc/h1 → --after; content → --after-file o --note; link* →
230
+ # --source-url; linkChanged → --after (anchor nuevo); other → --note. Textos
231
+ # largos o con acentos por fichero (*-file, UTF-8). Staff-only; sin --shadow
232
+ # (no hay revisión de change events). Verifica en la página publicada antes.
233
+ CMD crm change log --task <id> --type <metaTitle|metaDesc|h1|content|linkAdded|linkRemoved|linkChanged|other> --url <url> --date <AAAA-MM-DD|iso> --before <t> --before-file <path> --after <t> --after-file <path> --source-url <url> --anchor <t> --direction <inbound|outbound> --note <t> --note-file <path>
234
+ CMD crm change log --task <id> --items-file <path.json> --url <url> --date <AAAA-MM-DD|iso> --note <t> --note-file <path>
235
+
236
+ # Conector de webs — tienda (PrestaShop) y blog (WordPress) con la credencial
237
+ # guardada en el CRM (Ajustes del dominio → Conexiones con la web). La
238
+ # credencial nunca sale del servidor. Una conexión la usan owner/admin y las
239
+ # personas autorizadas en ella. La URL elige la conexión (el blog en /blog
240
+ # gana a la tienda del mismo dominio). Campos: h1, metaTitle,
241
+ # metaDescription, content (HTML), summary (extracto / descripción corta /
242
+ # descripción adicional), author (WP), noindex y canonical. Fuera: URL/slug,
243
+ # precio, stock. Escribir exige un CLI con la versión mínima (crm update).
244
+ CMD crm site list --domain <id>
245
+ CMD crm site test <connection-id>
246
+ # Reglas de publicación de la web (perfil del dominio, normas, comprobaciones,
247
+ # skills y documentos completos). Obligatorio antes de escribir: update exige
248
+ # haber leído la versión vigente en las últimas 24 h.
249
+ CMD crm site rules --url <url> --connection <id>
250
+ # Lee la página tal como está ahora. Siempre antes de cambiar nada.
251
+ CMD crm site get --url <url> --ref <post|page|product|category|cms:id> --connection <id>
252
+ # Escribe solo lo que cambia, vuelve a leer para confirmar, comprueba la página
253
+ # publicada y crea el registro de cambios de la tarea (antes/después reales).
254
+ # --task obligatorio (mismo dominio). Textos largos por fichero (UTF-8).
255
+ # Indexación: --noindex noindex|index|default (noindex exige --allow-noindex y
256
+ # avisa con los clics de la URL en Search Console); --canonical <url>|auto
257
+ # (mismo dominio, destino 200 e indexable; si no, bloquea).
258
+ CMD crm site update --task <id> --url <url> --ref <tipo:id> --connection <id> --h1 <t> --h1-file <path> --meta-title <t> --meta-title-file <path> --meta-desc <t> --meta-desc-file <path> --content <html> --content-file <path> --summary <html> --summary-file <path> --author <id> --noindex <noindex|index|default> --allow-noindex --canonical <url|auto> --note <t> --note-file <path> --dry-run
259
+ # Ventas reales de la tienda (PrestaShop), sumadas cada noche: de una ficha o
260
+ # categoría (28 y 90 días con interanual, puesto en su categoría o top 10 de
261
+ # la categoría) o ranking de fichas por facturación. Pedidos válidos y no
262
+ # cancelados de la tienda e idioma de la conexión; sin IVA. Nunca stock.
263
+ CMD crm site sales --url <url> --ref <product|category:id> --connection <id>
264
+ CMD crm site sales --top <n> --category <id> --days <28|90|365> --connection <id>
265
+ # Redirecciones 301 del blog (WordPress, mu-plugin roilab-seo-rest 1.2.0), sin
266
+ # plugin de redirecciones ni .htaccess. Entrada publicada → entrada publicada:
267
+ # fusión (el origen a la papelera y WordPress responde 301 por su slug
268
+ # antiguo). Lo demás (páginas, categorías, URLs que ya no existen, destino en
269
+ # la tienda): por ruta, y el origen publicado a la papelera. Destino del mismo
270
+ # dominio, 200 y sin noindex (si no, bloquea); después comprueba el 301 y lo
271
+ # registra en la tarea. La tienda (PrestaShop) sigue por .htaccess.
272
+ CMD crm site redirect list --url <url> --connection <id>
273
+ CMD crm site redirect create --task <id> --from <url> --to <url> --connection <id> --note <t> --note-file <path> --dry-run
274
+ CMD crm site redirect delete --task <id> --from <url> --connection <id> --note <t> --dry-run
275
+
276
+ # credential — accesos de un cliente (usuario + contraseña de una plataforma).
277
+ # list nunca devuelve la contraseña. Para usarla, pídela: le llega un aviso a
278
+ # la persona dueña de la clave, que la aprueba en el CRM (solo si ella tiene
279
+ # acceso). Aprobada, se puede leer durante 15 min; cada lectura se registra.
280
+ # Pregunta siempre antes de usar una contraseña y no la copies en ningún sitio.
281
+ CMD crm credential list --client <id> --task <id>
282
+ # Alta: la contraseña por stdin o fichero, nunca como argumento. Úsalo al crear
283
+ # una cuenta o para sacar una contraseña de un comentario.
284
+ CMD crm credential create --label <text> --client <id> --task <id> --url <url> --username <text> --password-stdin --password-file <path> --notes <text>
285
+ CMD crm credential link <credential-id> --task <id>
286
+ CMD crm credential request <credential-id> --task <id> --reason <text> --wait
287
+ CMD crm credential fetch <request-id> --wait
288
+
289
+ CMD crm scope list --domain <id> --kind <saved|ephemeral>
290
+ CMD crm scope get <id>
291
+
292
+ CMD crm competitor list --domain <id>
293
+
294
+ CMD crm tag list
295
+ # member list filters help resolve a name fragment to a memberId before composing @[Name](id).
296
+ CMD crm member list --query <text> --email <text> --client <id> --domain <id> --role <csv>
297
+ CMD crm member profile <id>
298
+ CMD crm member profile-set <id> --title <text> --bio <text> --expertise <csv> --preferred-contact <text> --timezone <iana> --working-hours <text> --internal-notes <md>
299
+
300
+ # Mention resolvers — print the markdown chip on stdout, exit 8 on ambiguous, 2 on no match.
301
+ # Compose into writes via shell substitution: --body "$(crm mention member luis) ping"
302
+ CMD crm mention member <query> --client <id> --domain <id> --role <csv>
303
+ CMD crm mention task <query> --domain <id> --status <status>
304
+
305
+ # Agent memory primer — aggregates client profile + all domain profiles + assigned staff.
306
+ # Call this before drafting client-visible content (comments, task titles, proposals).
307
+ # --domain narrows to staff with activity on a domain + open tasks under it.
308
+ # --task is the URL-of-tasks: participants + parent domain + cross-refs already linked.
309
+ CMD crm brief [clientId] --domain <id> --task <id>
310
+
311
+ CMD crm recall <url> --since <iso>
312
+ # search result rows: { id, kind: task|description|comment|change, score, snippet, breadcrumb[] }
313
+ # Use --jq '.data[].snippet' for titles-in-context; NOT .data[].title (not present)
314
+ CMD crm search <query> --kind <task|description|comment|change|all> --domain <id>
315
+
316
+ CMD crm inbox list
317
+ CMD crm inbox read <category>
318
+
319
+ CMD crm review list --mine --key <apiKeyId>
320
+ CMD crm review show <task|comment|edit> <id>
321
+ # review approve task <id> sobre una tarea aplicada con REVISAR (reviewRequired) la
322
+ # acepta (= botón Aceptar de la web); --completed-at fecha trabajo cerrado fuera
323
+ # del CRM (solo staff, tarea en done, sin fechas futuras).
324
+ CMD crm review approve <task|comment|edit> <id>
325
+ CMD crm review reject <task|comment|edit> <id> --reason <text>
326
+ # Agent iteration loop — read your own rejected proposals + the reviewer's
327
+ # reason. `--retryable-only` filters to items the reviewer wants you to redo.
328
+ CMD crm review feedback --retryable-only --key <apiKeyId>
329
+ # Bulk approve / reject — items via stdin (NDJSON or 'kind:id' tokens; ≤100).
330
+ # The mini-jq embedded in --jq does NOT support `|` or `\(.x)` interpolation —
331
+ # use real `jq` post-pipe, or pass tokens by hand.
332
+ # Example: crm review list --mine --quiet | jq -r '.[] | "\(.kind):\(.id)"' | crm review bulk-approve
333
+ CMD crm review bulk-approve
334
+ CMD crm review bulk-reject --reason <text> --no-retry
335
+
336
+ # Access requests — chat-driven flow. Clients (or agents acting as clients)
337
+ # request access to a task they spotted in a chat thread; staff resolve.
338
+ # The verbs used to live under `crm task {request,list,approve,deny}-access`
339
+ # (still work for one release with a deprecation hint).
340
+ CMD crm access request <task-id> --via <message-id> --message <text>
341
+ CMD crm access list
342
+ CMD crm access approve <request-id> --scope <task|board> --note <text>
343
+ CMD crm access deny <request-id> --note <text>
344
+
345
+ # Workspace-wide rollup of all properties for a date range — useful for
346
+ # overview prompts. Sources from Tinybird.
347
+ CMD crm dashboard summary --start <date> --end <date>
348
+
349
+ CMD crm integration list
350
+ CMD crm integration sites --account <id> --service <gsc|ga4|bing>
351
+ CMD crm integration sync --property <id>
352
+
353
+ # Merchant Center: fotos diarias de solo lectura (estado por fuente, avisos,
354
+ # clics de producto a 28 días, comprobaciones como idioma de feed mal puesto).
355
+ # <account> acepta el id del CRM o el ID numérico de Merchant.
356
+ CMD crm merchant list --client <id>
357
+ CMD crm merchant get <account>
358
+ CMD crm merchant sync <account>
359
+ CMD crm merchant task <account> --check <key> --board <id> --assignee <memberId> --title <text>
360
+ CMD crm merchant add --client <id> --merchant-id <id> --label <text>
361
+
362
+ # gsc/ga4/bing/ads query hit the live provider API (tokens stay on server).
363
+ # --filters is ';'-separated. Format: "<dim> <op> <expr>; ..."
364
+ # Operators (GSC + Bing): equals | contains | regex | not_equals | not_contains | not_regex
365
+ # Operators (GA4 adds): batch (inListFilter; value is newline-separated)
366
+ # ads query is read-only GAQL; cost is returned in micros (÷1e6 for currency).
367
+ CMD crm gsc query --property <id> --account <id> --site-url <url> --start <date> --end <date> --dimension <date|page|query|country|device> --filters <expr> --cursor <n>
368
+ CMD crm ga4 query --property <id> --account <id> --ga4-property <num> --start <date> --end <date> --filters <expr> --dimensions <list> --metrics <list>
369
+ CMD crm bing query --property <id> --account <id> --site-url <url> --start <date> --end <date>
370
+ CMD crm ads query --property <id> --account <id> --customer-id <id> --start <date> --end <date>
371
+ CMD crm ads whoami --account <id> # diagnóstico OAuth: scopes concedidos + ¿'adwords'? + MCC/dev-token
372
+ CMD crm ads accounts --account <id> # enumera cuentas hijas del MCC (customerId/nombre/moneda)
373
+ CMD crm ads campaigns --property <id> --account <id> --customer-id <id> --start <date> --end <date> --compare-start <date> --compare-end <date> # desglose por campaña + CPA/ROAS + deltas
374
+ CMD crm ads anomalies --property <id> --start <date> --end <date> --compare-start <date> --compare-end <date> # pico CPA/caída ROAS/gasto disparado/0-conv por cuenta (omite --property = todas)
375
+ CMD crm ads pacing --property <id> --month-start <date> --as-of <date> # gasto MTD vs presupuesto + proyección (omite --property = todas)
376
+ CMD crm ads budget --property <id> --set <amount> --clear # sin --set/--clear lee; --set fija; --clear elimina
377
+ CMD crm ads import # dispara ingesta fresca de Google Ads (diaria + campañas) del workspace
378
+
379
+ # Agency skills — librería de playbooks para Claude Code. `pull` escribe en
380
+ # `.claude/skills/<slug>/SKILL.md` + recursos; el manifest se guarda en
381
+ # `.claude/skills/.crm-manifest.json` para que `update` detecte desactualizados.
382
+ # `init` copia los tool-skills que vienen en el bundle del CLI (sin login).
383
+ CMD crm skill init --dry-run --force --preserve
384
+ CMD crm skill list --category <name> --status <draft|published|archived> --tag <id> --q <text>
385
+ CMD crm skill show <slug> --revision <id>
386
+ CMD crm skill revisions <slug>
387
+ CMD crm skill revision <id>
388
+ # skill create lands a draft; first publish via `crm skill push <slug> --publish`.
389
+ CMD crm skill create --slug <slug> --name <name> --description <text> --category <local-seo|google-ads|technical-seo|content|link-building|crm-ops|workflow|general> --kind <playbook|workflow|tool|reference> --tag <id...> --visibility <workspace|staff_only> --body <md> --frontmatter <yaml>
390
+ # skill set patches metadata only; body edits go through `crm skill push`.
391
+ CMD crm skill set <slug> --name <name> --description <text> --category <name> --kind <kind> --tag <id...> --visibility <workspace|staff_only>
392
+ # skill push — sube el cuerpo editado a Convex (draft). `--submit` lo manda al
393
+ # inbox de revisión (member/agent); `--publish` publica directo (owner/admin);
394
+ # `--force` ignora drift; `--force-overwrite-draft` pisa un draft pendiente ajeno.
395
+ CMD crm skill push <slug> --note <text> --publish --submit --force --force-overwrite-draft --dry-run
396
+ CMD crm skill archive <slug>
397
+ CMD crm skill restore <slug>
398
+ # skill remove — borra el mirror local (`--purge` también quita la entrada del manifest).
399
+ CMD crm skill remove <slug> --purge
400
+ CMD crm skill pull <slug> --revision <id> --dry-run --preserve --force
401
+ CMD crm skill pull --all --category <name> --tag <id>
402
+ CMD crm skill update --dry-run --preserve --prune-archived
403
+ CMD crm skill diff <slug>
404
+ # skill review — inbox de aprobación (owner/admin). `list` muestra revisiones
405
+ # sugeridas pendientes; `approve`/`reject` resuelven una por id.
406
+ CMD crm skill review list
407
+ CMD crm skill review approve <id>
408
+ CMD crm skill review reject <id> --reason <text>
409
+
410
+ # Documentos de trabajo de cliente — procesos en markdown editables por IA.
411
+ # Anclados a un cliente; internos por defecto, opt-in a cliente con `share`.
412
+ # Cuerpos largos/markdown SIEMPRE por `--body-file` (no `--body "$(cat)"`).
413
+ CMD crm doc list --client <id> --kind <proceso|guia|nota|entregable> --status <draft|published|archived> --q <text>
414
+ CMD crm doc get <slug> --client <id>
415
+ CMD crm doc content <slug> --client <id> --revision <id>
416
+ CMD crm doc revisions <slug> --client <id>
417
+ CMD crm doc create --client <id> --slug <slug> --title <text> --summary <text> --kind <proceso|guia|nota|entregable> --domain <id> --body <md> --body-file <path> --format <markdown|html>
418
+ CMD crm doc update <slug> --client <id> --title <text> --summary <text> --kind <kind> --domain <id> --body <md> --body-file <path> --format <markdown|html>
419
+ CMD crm doc publish <slug> --client <id> --note <text>
420
+ CMD crm doc share <slug> --client <id> --retract
421
+ CMD crm doc archive <slug> --client <id>
422
+ CMD crm doc restore <slug> --client <id>
423
+
424
+ CMD crm time log --task <id> --description <text> --date <YYYY-MM-DD> --started-at <epoch|iso> --ended-at <epoch|iso> --duration <minutes>
425
+ CMD crm time list --from <YYYY-MM-DD> --to <YYYY-MM-DD> --user <id>
426
+ # Entries linked to a specific task (no date filter).
427
+ CMD crm time list-task <taskId>
428
+ CMD crm time status
429
+ CMD crm time start --task <id> --description <text>
430
+ CMD crm time stop --description <text>
431
+ CMD crm time discard
432
+ CMD crm time update <id> --started-at <epoch|iso> --ended-at <epoch|iso> --description <text> --task <id>
433
+ CMD crm time delete <id> --reason <text>
434
+ CMD crm time hours <YYYY-MM> --employee <email>
435
+ CMD crm time budgets
436
+ CMD crm time usage <id>
437
+
438
+ # Rank tracker — agency-internal (clients never granted the scopes).
439
+ # `list` returns the same shape the dashboard reads, so `--ids-only` pipes
440
+ # straight into the bulk commands. Bulk endpoints cap at 500 ids; pass them
441
+ # positionally, via --stdin (newline/space/comma) or --ids-from-file.
442
+ # `delete` refuses the whole batch when any keyword still has an active
443
+ # rank goal — unlink the task first.
444
+ CMD crm rank list --domain <id> --country <iso2> --device <mobile|desktop> --state <pending_sync|active|orphan|archived> --unranked --canibalised --favorites --search <text> --limit <n>
445
+ CMD crm rank get <id>
446
+ # rank inspect — diagnóstico GRATIS de una keyword (0 unidades Ahrefs): por qué no
447
+ # tiene snapshot / posición. rank reconcile — chequeo de drift gratis que marca
448
+ # keywords huérfanas (dry-run por defecto).
449
+ CMD crm rank inspect <id>
450
+ CMD crm rank reconcile --domain <id> --dry-run
451
+ CMD crm rank add --domain <id> --country <iso2> --device <mobile|desktop> --tag <name...> --text <raw>|--file <path>|--stdin
452
+ CMD crm rank tag [ids...] --add <tag...> --remove <tag...> --replace <tag...> --stdin --ids-from-file <path>
453
+ # rank favorite — marca (o --off desmarca) el set top-N que alimenta la posición
454
+ # media del proyecto (la vista que ve el cliente en el portal). Máx 500 por lote.
455
+ CMD crm rank favorite [ids...] --off --stdin --ids-from-file <path>
456
+ CMD crm rank archive [ids...] --stdin --ids-from-file <path>
457
+ CMD crm rank restore [ids...] --stdin --ids-from-file <path>
458
+ CMD crm rank delete [ids...] --stdin --ids-from-file <path>
459
+ # rank goal — KPI binding keyword↔tarea↔URL (lo que la UI/importer escriben).
460
+ # `set` upsertea (crea la keyword si no existe); `move` re-apunta un goal a otra
461
+ # tarea (corrige goals mal atados por el importer); `unlink` lo borra.
462
+ CMD crm rank goal set --task <id> --keyword <kw> --url <url> --target-position <n> --country <iso2> --device <mobile|desktop>
463
+ CMD crm rank goal move <goalId> --to-task <id> --url <url> --target-position <n>
464
+ CMD crm rank goal unlink <goalId>
465
+
466
+ # Meta title + description — dossier de datos reales (sin créditos Ahrefs).
467
+ # Reúne Rank Tracker + queries GSC de la URL + canibalización en una llamada.
468
+ # Interpreta la salida con la skill de agencia `optimizar-metas`.
469
+ CMD crm meta brief --task <id> --url <url> --domain <id> --kw <keyword> --start <date> --end <date>
470
+
471
+ # Report schedules — list/get/run/snapshots/approve/reject covered. CRUD
472
+ # bodies are too rich for flat flags; `create` and `update` take JSON via
473
+ # --body (inline string | '@file.json' | '-' for stdin).
474
+ CMD crm report types
475
+ CMD crm report list
476
+ CMD crm report get <id>
477
+ CMD crm report create --body <json|@path|->
478
+ CMD crm report update <id> --body <json|@path|->
479
+ CMD crm report delete <id>
480
+ CMD crm report run <id>
481
+ CMD crm report snapshots --schedule <id> --limit <n>
482
+ CMD crm report snapshot <id>
483
+ CMD crm report approve <id> --note <text>
484
+ CMD crm report reject <id> --reason <text>
485
+
486
+ # Dump the full CLI surface as JSON so agents can introspect without help-text
487
+ # parsing. `{ data: { tree, flat } }` — `flat` is the linear command list.
488
+ CMD crm commands
489
+
490
+ CMD crm doctor
491
+ # Actualiza el CLI a la última versión (npm i -g @roilab/crm-cli@latest);
492
+ # --check solo compara. Cuando el CLI avise de versión nueva, ejecútalo.
493
+ CMD crm update --check
494
+
495
+ # Global flags (available on every command):
496
+ FLAG --json full JSON envelope (default)
497
+ FLAG --quiet only `data`, no envelope
498
+ FLAG --ids-only one id per line
499
+ FLAG --count single integer
500
+ FLAG --markdown human-readable preview
501
+ FLAG --styled alias of --markdown (reserved for colored output)
502
+ FLAG --jq <expr> tiny jq (.a, .a.b, .a[], .a[].b)
503
+ FLAG --profile <name> named credentials profile
504
+ FLAG --workspace <id> workspace override
505
+ FLAG --all walk Link-next pages
506
+ FLAG --limit <n> max rows
507
+ FLAG --since <iso> lower bound on creation/update time
508
+ FLAG --idempotency-key stable retry key (autogenerated on writes if omitted)
509
+ FLAG --wait-for-approval block until a human decides (shadow-mode writes only)
510
+ FLAG --timeout <dur> timeout for --wait-for-approval, e.g. 30s, 5m, 2h (default 30m)
511
+ FLAG --shadow force this write to land as a pending proposal for human review (one-way: agents cannot downgrade to autonomous)
512
+ FLAG --as-agent stamp this invocation as an AI agent (actorType:agent, AGENT badge). Auto-detected under Claude Code / Codex.