Download the PHP package stubr/craft-loki without Composer

On this page you can find all versions of the php package stubr/craft-loki. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-loki

Loki

Your lowkey ai trickster for the Craft CMS 5 Control Panel. Adds AI text generation to field editing, and supports multiple LLM providers (OpenAI, Anthropic, DeepL)..

Important: The plugin handle is "craft-loki" This handle is needed for cli tasks e.g. migrations ddev exec php craft migrate/up --plugin=craft-loki

Installation

Add the minimum stability to your composer.json (as long as the plugin is not yet 1.0)

Add the repository to your composer.json

Run ddev composer require stubr/craft-loki

Open the panel ddev launch panel, go to Settings -> Plugins and Install the Plugin.

APIs

API keys can be set in two ways:

  1. Plugin Settings page (Settings → Plugins → Loki) — paste keys directly into the form, or reference an environment variable by typing $OPENAI_API_KEY (the field will autosuggest available env vars from your .env).
  2. .env file — set OPENAI_API_KEY=sk-..., CLAUDE_API_KEY=sk-ant-..., DEEPL_API_KEY=... and reference them as $OPENAI_API_KEY etc. in the Settings page.

Usage

Managing Prompts

Go to the "Loki" section in the CP sidebar. Here you can:

Each prompt has:

Twig Variables in Prompts

Prompts support the following Twig variables for dynamic content

Example: Translate this text to {{ siteLang }} or while editing the subtitle: Summarise the following text in one sentence: "{{ fields.description }}

Using the Wand Button

On any entry edit page, PlainText and CKEditor fields will show a magic wand button next to the field label. Click it to see a dropdown of available prompts. Selecting a prompt will:

  1. Send the prompt along with all field content to the selected AI provider
  2. Create a draft of the entry with the AI-generated text
  3. Redirect you to the draft for review

Settings

Prompt Management

Prompts are managed through the "Loki" CP section. They are stored in Craft's project config and automatically synced to config/project/project.yaml.

Field Assignments

In the "AI Prompts" CP section, use the Field Prompt Assignments panel to assign specific prompts to specific fields. Select a field on the left, then check the prompts you want available for that field on the right.

Fields without specific assignments will fall back to prompts marked as "All PlainText" or "All CKEditor".

Updating

To update to the newest version of this package use ddev c update stubr/craft-loki


All versions of craft-loki with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stubr/craft-loki contains the following files

Loading the files please wait ...