Module: Holivia::CLI::Help

Defined in:
lib/holivia/cli/help.rb

Overview

rubocop:disable Metrics/ModuleLength

Constant Summary collapse

HELP_TEXT =
<<~HELP
  HOLIVIA CLI
  ===========

  Environment:
    holivia env                            Show current environment
    holivia env list                       List all configured environments
    holivia env add <name> --url <url>     Add or update an environment (--debug / --no-debug)
    holivia env use <name>                 Switch to an environment
    holivia env remove <name>              Remove an environment and its credentials
    holivia env debug [name] --true/--false  Toggle debug logging for an environment
    Config stored at ~/.holivia/config.yml. Defaults to staging if no config exists.

  Authentication:
    holivia login [--email EMAIL --password PASSWORD]  Log in (flags or interactive prompt)
    holivia logout                         Log out and clear stored credentials
    Tokens are stored at ~/.holivia/credentials.<env>.json and refreshed automatically on 401.

  Selfcare Contents:
    holivia selfcare index                 List all selfcare contents
    holivia selfcare show <id>             Show a selfcare content by id
    holivia selfcare create [options]      Create a selfcare content
                                           (--state draft|ongoing_translation|translation_to_be_reviewed|
                                            translation_reviewed|published)
    holivia selfcare update <id> [options] Update a selfcare content (same --state values)
    holivia selfcare compose               Create a full content tree atomically (no audio)
    holivia selfcare schema                Show allowed values for content_types, format_types,
                                           item_types, states, objective_tiers

  Content Formats:
    holivia selfcare format create [options]      Add a format to a selfcare content
    holivia selfcare format update <id> [options] Update a content format

  Slides:
    holivia selfcare slide create [options]       Add a slide to a format
    holivia selfcare slide update <id> [options]  Update a slide

  Slide Items:
    holivia selfcare item create [options]        Add an item to a slide
    holivia selfcare item update <id> [options]   Update a slide item

  Objectives:
    holivia objective index [--page N --per-page N --code CODE]  List objectives
    holivia objective show <id>                                  Show one objective
    Translated fields are returned in the default locale (fr).

  Enterprises:
    holivia enterprise index [--query TEXT --headquarter-id ID --user-id ID --page N --per-page N]
                                          Find enterprises and their enterprise_id values
    holivia enterprise lookup [options]   Alias for enterprise index

  Communication Items:
    holivia communication index [--page N --per-page N --query TEXT --locale LOCALE --document-type TYPE]
                                          List communication library items
    holivia communication show <id>       Show one communication item
    holivia communication create [options] Create a communication item with a required document upload
    holivia communication update <id> [options] Update metadata or replace uploads
    holivia communication publish <id>    Publish a draft communication item
    holivia communication unpublish <id>  Unpublish a communication item and clear published_at
    holivia communication delete <id>     Delete a communication item
    holivia communication schema          Show allowed document_types and locales

  Intervention Items:
    holivia intervention index [--page N --per-page N --query TEXT --locale LOCALE --state STATE
                                --provider PROVIDER --category KEY --translation-group-id UUID
                                --intervention-type TYPE]
                                          List HR intervention catalog items
    holivia intervention schema           Show allowed intervention enum values, providers, and locales
    holivia intervention show <id>        Show one intervention item
    holivia intervention create [options] Create one localized intervention item
    holivia intervention update <id> [options] Update one localized intervention item
    holivia intervention publish <id>     Publish one intervention item
    holivia intervention unpublish <id>   Unpublish one intervention item
    holivia intervention delete <id>      Delete one localized intervention item

  HR Home Highlights:
    holivia highlight index [--page N --per-page N --query TEXT --locale LOCALE
                             --highlight-type TYPE --state STATE]
                                          List HR home highlights
    holivia highlight schema              Show allowed highlight_types, states, and locales
    holivia highlight show <id>           Show one HR home highlight
    holivia highlight create [options]    Create one localized HR home highlight
    holivia highlight update <id> [options] Update one localized HR home highlight
    holivia highlight publish <id>        Publish one HR home highlight
    holivia highlight unpublish <id>      Unpublish one HR home highlight
    holivia highlight delete <id>         Delete one localized HR home highlight

  Crises:
    holivia crisis index [--enterprise-id ID --status STATUS --page N --per-page N]
                                          List crises
    holivia crisis show <id>              Show one crisis
    holivia crisis create [options]       Create a crisis
    holivia crisis update <id> [options]  Update a crisis
    holivia crisis delete <id>            Delete a crisis
    Status values: reported, in_progress, resolved.

  Collective Interventions:
    holivia collective-intervention index [--enterprise-id ID --status STATUS --page N --per-page N]
                                          List collective interventions
    holivia collective-intervention show <id>       Show one collective intervention
    holivia collective-intervention create [options] Create a collective intervention
    holivia collective-intervention update <id> [options] Update a collective intervention
    holivia collective-intervention delete <id>     Delete a collective intervention
    Status values: submitted, scheduled, in_progress, completed, canceled.

  Appointments:
    holivia appointment video-diagnostics <id>  Show video diagnostics for an appointment

  Selfcare Content Objectives:
    holivia selfcare objective index [--page N --per-page N --selfcare-content-id ID --objective-id ID]
                                          List a selfcare content's associated objectives
    holivia selfcare objective show <id>          Show one selfcare content objective
    holivia selfcare objective create --selfcare-content-id ID --objective-id ID [--tier main|secondary]
                                          Associate an objective to a selfcare content (tier defaults to main)
    holivia selfcare objective update <id> --tier main|secondary  Change the tier
    holivia selfcare objective delete <id>        Dissociate an objective from a selfcare content
    Inline alternative: include "objectives": [{ "objective_id": ID, "tier": "main" }, ...] in the
    JSON payload of compose/update. On update, [] clears the list; omitting the key leaves it untouched.

  Data Model:
    SelfcareContent → ContentFormat (format_type: text, audio, video)
      → Slide (title, duration) → SlideItem (one of: RichTextItem, VideoItem,
        WistiaItem, QuizItem, AudioItem, MeditationItem, BreathingItem)
    BreathingItem and MeditationItem are rendered full screen: one per slide.

  Workflow:
    1. holivia selfcare schema         Discover valid enum values
    2. holivia selfcare compose         Create a full content tree in one atomic request
       Text and video items are created inline. Audio items require a file upload,
       so compose creates the slide without items — then add them using the slide ID:
       holivia selfcare item create --slide-id <id> --item-type AudioItem --audio <path>
       OR build everything incrementally:
       holivia selfcare create          → create the content
       holivia selfcare format create   → attach a format
       holivia selfcare slide create    → add a slide to the format
       holivia selfcare item create     → add items to the slide (supports audio upload)

  Data Input:
    Create/update commands accept flags (run <command> --help for details).
    Compose accepts --file <path> for a JSON payload.
    All create/update/compose commands also accept piped JSON via stdin.
    Audio uploads use --audio <path> on item create/update (sent as multipart/form-data).
    Accepted audio formats: MP3, MP4, WAV, OGG, FLAC, AAC, M4A, WebM. Max size: 100 MB.
    Image uploads use --image <path> on selfcare create/update (sent as multipart/form-data).
    Accepted image formats: JPEG, PNG, WebP, GIF. Max size: 5 MB.
    Communication uploads use --document <path> and optional --cover-image <path>.
    The API validates accepted communication upload formats and file sizes.
    Intervention cover images use --cover-image <path> on intervention create/update.
    Highlight uploads use required --cover-image <path> and either --resource-url URL or --document <path>.
    Crisis and collective intervention contacts can be passed as repeated --contact-json JSON flags,
    or as "contacts_attributes": [...] in piped JSON.
    Compose is JSON-only — to attach an image to a composed tree, PATCH the returned id:
      holivia selfcare update <id> --image <path>

  Errors:
    Validation errors (422) show structured details:
      path: "formats[0].slides[0]"  errors: { "title": ["can't be blank"] }
    Auth errors return 401. Not found returns 404.

  Discovery:
    Run holivia selfcare schema to get current allowed values for all enums
    and item types with their permitted params. Always use this over hardcoded
    values — it is the source of truth.
    Run holivia intervention schema before creating or updating intervention items
    to discover current intervention enum values and locales.
    Run holivia highlight schema before creating or updating HR home highlights
    to discover current highlight types, states, and locales.

  Version:
    holivia version                        Print version
HELP