Module: Holivia::CLI::Help

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

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
    holivia selfcare update <id> [options] Update a selfcare content
    holivia selfcare compose               Create a full content tree atomically (no audio)
    holivia selfcare schema                Show allowed values for content_types, format_types, item_types

  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

  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.
    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.

  Version:
    holivia version                        Print version
HELP