PHPackages                             medienbaecker/kirby-alter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. medienbaecker/kirby-alter

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

medienbaecker/kirby-alter
=========================

2.2.2(3w ago)242.1k↑198.7%1MITPHPPHP ^8.2

Since Jun 25Pushed 3w ago2 watchersCompare

[ Source](https://github.com/medienbaecker/kirby-alter)[ Packagist](https://packagist.org/packages/medienbaecker/kirby-alter)[ RSS](/packages/medienbaecker-kirby-alter/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (28)Used By (0)

Kirby Alter
===========

[](#kirby-alter)

Edit, generate and review alt texts for images in the [Kirby](https://getkirby.com/) Panel.

[![Screenshot of the custom panel view with several cat images and alt texts](https://private-user-images.githubusercontent.com/7975568/543451120-48540160-430c-4a40-a80f-d8cc29de5a5e.webp?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMyMzU2NzgsIm5iZiI6MTc4MzIzNTM3OCwicGF0aCI6Ii83OTc1NTY4LzU0MzQ1MTEyMC00ODU0MDE2MC00MzBjLTRhNDAtYTgwZi1kOGNjMjlkZTVhNWUud2VicD9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzA1VDA3MDkzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkZDIzM2QzMWY5ZWMyMjI0YzRjOTA2MjEwOTk3M2ZiZjZmNTBmZDVmMjBiNDYyZTNmZTY1ZjdkNjYzNzhkYjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRndlYnAifQ.-DJ3DqUqOvMjKjefGgamBHG0BW9LdpVYOUGXvu1SWfM)](https://private-user-images.githubusercontent.com/7975568/543451120-48540160-430c-4a40-a80f-d8cc29de5a5e.webp?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMyMzU2NzgsIm5iZiI6MTc4MzIzNTM3OCwicGF0aCI6Ii83OTc1NTY4LzU0MzQ1MTEyMC00ODU0MDE2MC00MzBjLTRhNDAtYTgwZi1kOGNjMjlkZTVhNWUud2VicD9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzA1VDA3MDkzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkZDIzM2QzMWY5ZWMyMjI0YzRjOTA2MjEwOTk3M2ZiZjZmNTBmZDVmMjBiNDYyZTNmZTY1ZjdkNjYzNzhkYjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRndlYnAifQ.-DJ3DqUqOvMjKjefGgamBHG0BW9LdpVYOUGXvu1SWfM)

Requirements
------------

[](#requirements)

- Kirby 5+
- PHP 8.2+

Installation
------------

[](#installation)

```
composer require medienbaecker/kirby-alter
```

Tip

If you don’t use Composer, you can download this repository and copy it to `site/plugins/kirby-alter`.

Features
--------

[](#features)

### Panel view

[](#panel-view)

The plugin provides a custom Panel view for reviewing and managing alt texts of images across all pages in your site.

- Filter modes to focus on **All / Saved / Unsaved / Missing**
- Shows the total number of drafts and saved alt texts
- Language toggle for switching between languages
- Sections for each page with breadcrumb, image count, and status
- Save or discard changes per image or in bulk
- Optional AI generation buttons to draft alt texts for the current list or a single image
- Optional "Doesn't need alt text" checkbox to mark decorative images as reviewed

If you've overwritten `panel.menu` in your config, make sure to add Alter back:

```
'panel.menu' => [
	'site',
	'projects' => [
		'icon'  => 'heart',
		'label' => 'Projects',
		'link'  => 'pages/portfolio',
	],
	'alter' # Add this line wherever you want Alter to appear in the menu
]
```

Note

On multilingual pages, the default alt text appears as a placeholder in non-default languages, making it easier to spot missing translations.

### CLI command

[](#cli-command)

`kirby alter:generate` [CLI command](https://github.com/getkirby/cli) is included and uses the [Claude API](https://docs.anthropic.com/en/api/overview) to generate alt texts for images. Generated texts are stored as unsaved changes and need to be reviewed and published in the Panel.

- Supports multi-language installations (run for default only, a specific language, or all languages)
- Detects duplicate images and saves tokens by only uploading them once, updating all instances at once

[![Screenshot of a terminal displaying output from "kirby alter:generate"](https://private-user-images.githubusercontent.com/7975568/461555513-b82e6e42-de36-4545-b484-240936b2fbeb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMyMzU2NzgsIm5iZiI6MTc4MzIzNTM3OCwicGF0aCI6Ii83OTc1NTY4LzQ2MTU1NTUxMy1iODJlNmU0Mi1kZTM2LTQ1NDUtYjQ4NC0yNDA5MzZiMmZiZWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQ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zZjOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.dvgqEyWZWkAGO1TotyLWNNlYY1p0D2o3JBgN-0yT_6Q)

#### CLI Arguments

[](#cli-arguments)

- `--prompt` / `-p` - Custom prompt for generating alt texts (overrides the configured prompt)
- `--overwrite` - Overwrite existing alt texts (default: `false`)
- `--dry-run` - Preview changes without updating files (default: `false`)
- `--verbose` - Show detailed progress information (default: `false`)
- `--page` - Start from specific page URI, e.g. `"blog"` (optional)

> \[!WARNING\] &gt; `--dry-run` still uses the API (it only skips writing changes).

#### Usage Examples

[](#usage-examples)

```
# Generate alt texts for all images
kirby alter:generate

# Preview changes without updating files (still uses the API)
kirby alter:generate --dry-run

# Generate with custom prompt
kirby alter:generate --prompt "My custom prompt"

# Process only images from a specific page and overwrite existing alt texts
kirby alter:generate --page "blog/my-article" --overwrite
```

Options
-------

[](#options)

```
// site/config/config.php
return [
  'medienbaecker.alter' => [
    'api.key' => 'claude-api-key', // Set your Claude API key here
    'api.model' => 'model-id',     // Optional: set a Claude model id/alias
    'templates' => null,           // Optional: restrict to specific file templates (string or array)
    'ignore' => null,              // Optional: a callback function that returns a boolean
    'prompt' => 'Custom prompt',   // Optional: custom prompt for alt text generation
    'maxLength' => false,          // Optional: max characters (e.g. 125) for Panel counter and generation
    'language' => 'English',       // Optional: output language for non-multilingual sites
    'panel.generation' => false,   // Show AI generation buttons in the Panel (default: CLI-only)
    'panel.decorative' => false,   // Show a "Doesn't need alt text" checkbox in the Panel
  ]
];
```

Enable `panel.generation` to surface “Generate” buttons in the Alter view. A dropdown lets you choose whether to translate for the current language only or for all site languages. Panel generation never overwrites existing alt texts; it only fills missing ones as drafts.

Tip

Get your Claude API key from the [Anthropic Console](https://console.anthropic.com/).

### "Doesn't need alt text" checkbox

[](#doesnt-need-alt-text-checkbox)

Enable `panel.decorative` to add a "Doesn't need alt text" checkbox to each image. Checking it marks the image as reviewed even when the alt text is empty. This is intended to be used for purely decorative images, which should use an empty `alt=""`. Decorative images then count towards the progress badge and leave the **Missing** filter. The flag is set per language, stored in an `alt_decorative` field.

### Custom Prompt Configuration

[](#custom-prompt-configuration)

The prompt option can be either a string or a callback function that receives the image file as a parameter. The default is:

```
'prompt' => function ($file) {
  $prompt = 'You are an accessibility expert writing alt text. Write a concise, short description in one to three sentences. Start directly with the subject - NO introductory phrases like "image of", "shows", "displays", "depicts", "contains", "features" etc.';
  if ($file->parent() instanceof \Kirby\Cms\Page) {
    $prompt .= ' The image is on a page called "' . $file->parent()->title() . '".';
  }
  $prompt .= ' The site is called "' . $file->site()->title() . '".';
  $prompt .= ' Return the alt text only, without any additional text or formatting.';

  return $prompt;
}
```

You can override this with your own string or callback:

```
// Simple string prompt
'prompt' => 'Describe this image concisely for accessibility purposes.'

// Custom callback with different context
'prompt' => function($file) {
  return 'Describe this image. Context: "' . $file->page()->text()->excerpt(100) . '"';
}
```

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance95

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 86.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~7 days

Total

27

Last Release

24d ago

Major Versions

1.7.0 → 2.0.0-rc.12026-02-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7975568?v=4)[Thomas Günther](/maintainers/medienbaecker)[@medienbaecker](https://github.com/medienbaecker)

---

Top Contributors

[![medienbaecker](https://avatars.githubusercontent.com/u/7975568?v=4)](https://github.com/medienbaecker "medienbaecker (84 commits)")[![grommasdietz](https://avatars.githubusercontent.com/u/136818759?v=4)](https://github.com/grommasdietz "grommasdietz (12 commits)")[![mrflix](https://avatars.githubusercontent.com/u/60777?v=4)](https://github.com/mrflix "mrflix (1 commits)")

---

Tags

kirbykirby5

### Embed Badge

![Health badge](/badges/medienbaecker-kirby-alter/health.svg)

```
[![Health](https://phpackages.com/badges/medienbaecker-kirby-alter/health.svg)](https://phpackages.com/packages/medienbaecker-kirby-alter)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k475](/packages/getkirby-cms)[medienbaecker/kirby-modules

Easily add modules to your pages

895.5k1](/packages/medienbaecker-kirby-modules)[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14698.5k1](/packages/distantnative-retour-for-kirby)[arnoson/kirby-vite

Vite helper for Kirby CMS

9765.1k3](/packages/arnoson-kirby-vite)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4149.6k2](/packages/bnomei-kirby3-dotenv)[tobimori/kirby-dreamform

Kirby DreamForm is an opiniated form builder plugin for Kirby CMS 4+ that makes forms work like magic

6011.4k1](/packages/tobimori-kirby-dreamform)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
