PHPackages                             godbout/alfred-workflow-config - 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. godbout/alfred-workflow-config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

godbout/alfred-workflow-config
==============================

Manage settings easily for your Alfred 3 or 4 Workflows.

1.8.0(4y ago)32.4kMITPHPPHP ^8.0.2CI failing

Since Feb 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/godbout/alfred-workflow-config)[ Packagist](https://packagist.org/packages/godbout/alfred-workflow-config)[ Docs](https://github.com/godbout/alfred-workflow-config)[ RSS](/packages/godbout-alfred-workflow-config/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (5)Versions (13)Used By (0)

PHP Alfred Workflow Config
==========================

[](#php-alfred-workflow-config)

 [![Latest Stable Version](https://camo.githubusercontent.com/50400b256818e617697708756f95e6162f33047d55de78727b7c3743c307ca4d/68747470733a2f2f706f7365722e707567782e6f72672f676f64626f75742f616c667265642d776f726b666c6f772d636f6e6669672f762f737461626c65)](https://packagist.org/packages/godbout/alfred-workflow-config) [![Build Status](https://camo.githubusercontent.com/91ae22762cfb825a56a0b2f71c9e540b3dcb07571aa7d6b4768c567203b1b776/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f676f64626f75742f616c667265642d776f726b666c6f772d636f6e6669672f7465737473)](https://github.com/godbout/alfred-workflow-config/actions) [![Quality Score](https://camo.githubusercontent.com/eef49f5ca137a6341fcdef0bc89a67025afac6815efdd5a3714ece47fd9ac2a9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f676f64626f75742f616c667265642d776f726b666c6f772d636f6e6669672e737667)](https://scrutinizer-ci.com/g/godbout/alfred-workflow-config) [![Code Coverage](https://camo.githubusercontent.com/39d853d6376962ce063248ea0aeefdef948a781b522977d22a82e9ab86834180/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f64626f75742f616c667265642d776f726b666c6f772d636f6e6669672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/godbout/alfred-workflow-config) [![Total Downloads](https://camo.githubusercontent.com/1b8ccc8ba6732a01c18cdf887d1ad69d343e78b4c27d723cc8eeaa87d22c43c2/68747470733a2f2f706f7365722e707567782e6f72672f676f64626f75742f616c667265642d776f726b666c6f772d636f6e6669672f646f776e6c6f616473)](https://packagist.org/packages/godbout/alfred-workflow-config)

 Easily read and write config settings for your Alfred 3 or 4 Workflow. We took care of the [boring stuff](#behind-the-scenes) for you.

---

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

[](#installation)

```
composer require godbout/alfred-workflow-config
```

Usage
-----

[](#usage)

Import the class:

```
require 'vendor/autoload.php';

use Godbout\Alfred\Workflow\Config;
```

Then you can start save settings. Use [dot notation](https://github.com/adbario/php-dot-notation) for nested settings:

```
Config::write('language', 'english');

Config::write('workflow.user.name', 'Guill');
```

Read settings:

```
$language = Config::read('language');

$userName = Config::read('workflow.user.name');
```

You can provide a default config for your workflow. It will only be saved if no config is found:

```
Config::ifEmptyStartWith(['version' => 1.0, 'enabled' => true]);
```

Usage in your tests
-------------------

[](#usage-in-your-tests)

#### Set the Alfred Workflow Data environment variable

[](#set-the-alfred-workflow-data-environment-variable)

The package uses an environment variable set by Alfred to determine where to create and store your data. If you are not using this Config class through a script that is called by Alfred (like in your [tests](#usage-in-your-tests), for example), then you need to set that environment variable. Use `putenv("alfred_workflow_data=./where_you_want_to_store_alfred_data");` before writing or reading your settings.

#### Destroy the Config between tests

[](#destroy-the-config-between-tests)

The `Config` class is a singleton. This allows me to provide you with a very simple and nice to use API. It works great when being used by Alfred calling your Workflow script, but not so much with testing. If you're using the `Config` class in your own tests, you have to destroy the singleton between each test. You can do it easily like this:

```
protected function tearDown(): void
{
    parent::tearDown();

    Config::destroy();
}
```

This will make sure that your next test starts with a virgin `Config`.

ArrayAccess
-----------

[](#arrayaccess)

There is none. We don't keep an array of settings internally, so there's no way to implement completely ArrayAccess. You could read settings through an array notation but not add a new setting, so the whole ArrayAccess implementation has been put to sleep.

Behind the scenes
-----------------

[](#behind-the-scenes)

1. We create the [Alfred Workflow Data](https://www.alfredapp.com/help/workflows/script-environment-variables/) folder if it doesn't exist.
2. We create a `config.json` file and store the settings, well, in pretty json.
3. We directly read and write to the config file, so even if your workflow crashes after, your settings will be saved as soon as you call the method.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 96.5% 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 ~116 days

Recently: every ~165 days

Total

11

Last Release

1466d ago

PHP version history (6 changes)1.0.0PHP ^7.2

1.2.0PHP ^7.0

1.3.0PHP ^7.1

1.6.0PHP ^7.4 || ^8.0

1.7.0PHP ^7.3 || ^8.0

1.8.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a99985b9d95710208c2b66a8935acaf3ef0e09d98d8732408a683a26c09351d?d=identicon)[godbout](/maintainers/godbout)

---

Top Contributors

[![godbout](https://avatars.githubusercontent.com/u/121373?v=4)](https://github.com/godbout "godbout (55 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

alfredalfred-workflowconfigphpworkflowphpconfigworkflowalfredalfred-workflow

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/godbout-alfred-workflow-config/health.svg)

```
[![Health](https://phpackages.com/badges/godbout-alfred-workflow-config/health.svg)](https://phpackages.com/packages/godbout-alfred-workflow-config)
```

###  Alternatives

[godbout/alfred-workflow-scriptfilter

Generate Alfred 3 or 4 Workflow Results in PHP with a laugh.

173.7k1](/packages/godbout-alfred-workflow-scriptfilter)

PHPackages © 2026

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