@jurishub/cli
v0.2.0
Published
JurisHUB Public API V1/V2 CLI
Readme
JurisHUB CLI
CLI for the JurisHUB Public APIs V1 and V2.
Read commands remain generated from /api/public/v1/openapi.json. The combined /api/public/v2/openapi.json includes those safe reads plus the allowlisted writes and their idempotency, optimistic-concurrency, tenant-isolation, preview, and secret-redaction contracts.
For client installation and first-run instructions, see INSTALL.md.
The packaged CLI connects to the official JurisHUB API at https://jurishub.dev by default. Set JURISHUB_BASE_URL only for local development or when JurisHUB support explicitly provides another API host.
Install
npm install -g @jurishub/cli
jurishub versionCustomer Commands
jurishub login
jurishub status
jurishub contatos buscar Maria
jurishub contatos buscar 11999999999
jurishub casos listar
jurishub casos criar --dados '{"contact_id":"<contact-id>","stage_id":"<column-id>"}'
jurishub casos atualizar <case-id> --dados '{"notes":"Retorno marcado"}'
jurishub casos mover <case-id> --dados '{"stage_id":"<column-id>"}'
jurishub agenda listar
jurishub contatos criar --dados '{"name":"Maria","phone":"5511999999999"}'
jurishub pipeline colunas criar --dados '{"title":"Qualificados","color":"#2563EB"}'
jurishub pipeline colunas renomear <column-id> --dados '{"title":"Contratados"}'
jurishub pipeline colunas reordenar --dados '{"column_ids":["<id-2>","<id-1>"]}'
jurishub pipeline clientes criar --dados '{"name":"Maria","phone":"5511999999999","stage_id":"<column-id>"}'
jurishub agentes config
jurishub relatorioBuild
go build ./cmd/jurishub-pp-cliAuth
For CI and agents, configure JURISHUB_API_KEY in the platform's protected secret settings. Do not type the key in a shell command.
For local use, store the key in the user-local credentials file without putting it in argv:
jurishub loginPaste the API key when prompted. The key is hidden while you paste or type it; that is expected.
The raw key is never printed by the CLI. Do not store API keys in the repo, Obsidian, logs, shell scripts, or generated artifacts.
Output Contract
- Default output is JSON on stdout.
- Use
--humanfor human-friendly output. - Errors are JSON on stderr and use non-zero exit codes.
- Logs, warnings, dry-run details, and progress belong on stderr.
- The supported CI credential override is
JURISHUB_API_KEY.
Commands
Use the customer-facing commands:
jurishub contatos listar
jurishub contatos buscar Maria
jurishub contatos buscar 11999999999
jurishub contatos ver <id>
jurishub casos listar
jurishub casos ver <id>
jurishub casos criar --dados @caso.json
jurishub casos atualizar <id> --dados '{"notes":"Atualizado"}'
jurishub casos mover <id> --dados '{"stage_id":"<column-id>"}'
jurishub agenda listar
jurishub agenda criar --dados @evento.json
jurishub agenda cancelar <id>
jurishub agenda excluir <id> --yes
jurishub contatos duplicados listar
jurishub contatos duplicados prever --telefone 5511999999999
jurishub contatos duplicados mesclar --dados '{"phone":"5511999999999"}' --yes
jurishub pipeline colunas listar
jurishub pipeline colunas renomear <id> --dados '{"title":"Contratados"}'
jurishub pipeline colunas reordenar --dados @ordem-colunas.json
jurishub pipeline colunas remover <id> --yes
jurishub equipe listar
jurishub integracoes status
jurishub webhooks status
jurishub omnichat conversas
jurishub omnichat estado <conversation-id> --estado closed
jurishub omnichat marcar-lida <conversation-id>
jurishub agentes config
jurishub relatorioWrites require a key with the exact scope. Use --dados '<json>', --dados @file, or --dados - to read JSON from stdin. Destructive operations require --yes; --agent enables it together with the other agent-safe defaults.
Each write gets a fresh Idempotency-Key. For a safe retry after an interrupted request, repeat the exact command with the same explicit key:
jurishub contatos criar --dados @contato.json --idempotency-key retry-contato-001Contact, event, member, and pipeline-column deletion automatically fetch a key-bound five-minute preview and current ETag before sending the guarded deletion. Pipeline columns can be removed only when empty, non-default, and not the last column. The live command prints Idempotency-Key, Preview-Fingerprint, and If-Match to stderr. If the response is lost, repeat the same command with all three captured values so the CLI does not fetch a changed preview:
jurishub contatos excluir <id> --yes \
--idempotency-key retry-delete-001 \
--preview-fingerprint '<captured>' \
--if-match '<captured-etag>'Contact merge prints and accepts the same --preview-fingerprint retry value, without --if-match. --dry-run redacts credential and token fields before writing request details to stderr.
Integration and webhook commands are status-only. Connecting or disconnecting credentials, changing WhatsApp instance state, and reconciling webhooks are intentionally unavailable through the CLI.
When the organization is delinquent, the CLI stops with ORGANIZATION_DELINQUENT and instructs the user to regularize the subscription in JurisHUB. The API key is not revoked; if it is still valid, access resumes automatically after regularization.
The generated public ... endpoint mirror remains available for advanced/agent use, but it is hidden from the default help.
Billing/financial operations, integration credential changes, webhook reconciliation, arbitrary webhook URLs, WhatsApp instance mutations, OmniChat outbound sends/media/deletion, agent prompts/models/credentials, secret output, and MCP packaging remain outside the public CLI.
Relacionados
- [[JurisHUB/04_Planos/FEAT/FEAT-04_api-publica-cli-clientes/Index|FEAT-04 API publica e CLI para clientes]]
- [[JurisHUB/04_Planos/FEAT/FEAT-04_api-publica-cli-clientes/05 Validacao|05 Validacao]]
- [[JurisHUB/04_Planos/FEAT/FEAT-10_api-publica-cli-v2-escrita/Index|FEAT-10 API Pública e CLI V2 com escrita]]
