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.1.6(1mo ago)21668↓33.3%1MITPHPPHP ^8.2

Since Jun 25Pushed 1mo 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 1mo ago

READMEChangelog (10)Dependencies (2)Versions (23)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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4NTQwODAsIm5iZiI6MTc3NDg1Mzc4MCwicGF0aCI6Ii83OTc1NTY4LzU0MzQ1MTEyMC00ODU0MDE2MC00MzBjLTRhNDAtYTgwZi1kOGNjMjlkZTVhNWUud2VicD9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzMwVDA2NTYyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZkNDUzNjBkYmQ4YjczNzQ4ZDgzYTI0YmRkYjkzNTc5YzNhODZmMjYyYWIzNjBkNzU4YjQ5MzdlNmVmMjRkNTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.w-o1ZQK7W9beydzg7hHE2zu-BqxFnwFpK7kT0ot7GAY)](https://private-user-images.githubusercontent.com/7975568/543451120-48540160-430c-4a40-a80f-d8cc29de5a5e.webp?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4NTQwODAsIm5iZiI6MTc3NDg1Mzc4MCwicGF0aCI6Ii83OTc1NTY4LzU0MzQ1MTEyMC00ODU0MDE2MC00MzBjLTRhNDAtYTgwZi1kOGNjMjlkZTVhNWUud2VicD9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzMwVDA2NTYyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZkNDUzNjBkYmQ4YjczNzQ4ZDgzYTI0YmRkYjkzNTc5YzNhODZmMjYyYWIzNjBkNzU4YjQ5MzdlNmVmMjRkNTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.w-o1ZQK7W9beydzg7hHE2zu-BqxFnwFpK7kT0ot7GAY)

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

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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4NTQwODAsIm5iZiI6MTc3NDg1Mzc4MCwicGF0aCI6Ii83OTc1NTY4LzQ2MTU1NTUxMy1iODJlNmU0Mi1kZTM2LTQ1NDUtYjQ4NC0yNDA5MzZiMmZiZWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMDY1NjIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODU2YjE2OTUyZTQ1MTQwZWIzMmIyNjZhMDg2ZDUyMmZmODViZDQ4YTRlNGJiMTBiNWUzOGIyZWI4OWUxY2NkNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.z0kJ3oN-e8Ff5DnnAUNS9lBYKkVIKj89LgPyDWEJTKM)](https://private-user-images.githubusercontent.com/7975568/461555513-b82e6e42-de36-4545-b484-240936b2fbeb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ4NTQwODAsIm5iZiI6MTc3NDg1Mzc4MCwicGF0aCI6Ii83OTc1NTY4LzQ2MTU1NTUxMy1iODJlNmU0Mi1kZTM2LTQ1NDUtYjQ4NC0yNDA5MzZiMmZiZWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDMzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAzMzBUMDY1NjIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODU2YjE2OTUyZTQ1MTQwZWIzMmIyNjZhMDg2ZDUyMmZmODViZDQ4YTRlNGJiMTBiNWUzOGIyZWI4OWUxY2NkNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.z0kJ3oN-e8Ff5DnnAUNS9lBYKkVIKj89LgPyDWEJTKM)

#### 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)
    'prompt' => 'Custom prompt',   // Optional: custom prompt for alt text generation
    'maxLength' => false,          // Optional: set a max length (e.g. 125) for alt texts in the panel counter
    'language' => 'English',       // Optional: output language for non-multilingual sites
    'panel.generation' => false,   // Show AI generation buttons in the Panel (default: CLI-only)
  ]
];
```

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

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

49

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% 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

Total

22

Last Release

54d 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 (78 commits)")[![grommasdietz](https://avatars.githubusercontent.com/u/136818759?v=4)](https://github.com/grommasdietz "grommasdietz (12 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

[distantnative/retour-for-kirby

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

14689.4k1](/packages/distantnative-retour-for-kirby)[mzur/kirby-uniform

A versatile Kirby plugin to handle web form actions.

26068.3k13](/packages/mzur-kirby-uniform)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[thathoff/kirby-git-content

Plugin to track changes to content in a git repository.

15343.7k](/packages/thathoff-kirby-git-content)[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11237.3k1](/packages/sylvainjule-locator)[tobimori/kirby-seo

The default choice for SEO on Kirby: Implement technical SEO &amp; Meta best practices with ease and provide an easy-to-use editor experience

10039.7k1](/packages/tobimori-kirby-seo)

PHPackages © 2026

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