Skip to content

5-Minute Quickstart

This quickstart walks through the Aegean Voyages (aegeanvoyages.example) workflow from site/modules/Ai/examples/real-world/.

  1. Add a Provider & Enable Models in Setup -> AI:

    • Open Setup -> AI -> Providers and click + New Provider.
    • Choose a driver (for example openrouter, gemini, anthropic, openai, or local ollama) and add an encrypted key or $env:OPENROUTER_API_KEY.
    • Open Models, click Fetch Live Models (/models), enable at least one model, and assign default routes in Routing & Governance.
  2. Generate Grounded Editorial Copy in PHP:

    <?php declare(strict_types=1);
    namespace ProcessWire;
    $ai = Ai::requireInstance($wire);
    $result = $ai->generate(
    'Write a 3-sentence charter overview for M/Y Aegean Horizon departing Gocek Marina.',
    [
    'tier' => 'balanced',
    'voice' => 'aegean-editorial',
    'rules' => ['aegean-yacht-rule'],
    ]
    );
    echo $result->text();
  3. Localize a Multi-Language Page With a Protected Glossary:

    Terminal window
    php vendor/bin/wire ai:translate 1042 --to=tr --glossary=maritime-terms --dry-run --json

    Remove --dry-run (or add --queue for background execution via BulkTranslateQueue) to apply the localized fields while keeping terms like APA, Gulet, and Gocek consistent.

  4. Index Content for Semantic Search & Visitor Chat:

    Terminal window
    php vendor/bin/wire ai:index --type=pages --template=yacht --limit=100 --json
  5. Run a Pre-Publish Editorial Audit:

    Terminal window
    php vendor/bin/wire ai:audit --template=yacht --limit=20 --format=table --json

Next steps