PHPackages                             pnodev/jim-core - 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. [CLI &amp; Console](/categories/cli)
4. /
5. pnodev/jim-core

ActiveLibrary[CLI &amp; Console](/categories/cli)

pnodev/jim-core
===============

A cli task runner

1.1.3(1y ago)06783MITShell

Since May 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pnodev/jim-core)[ Packagist](https://packagist.org/packages/pnodev/jim-core)[ RSS](/packages/pnodev-jim-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (12)Used By (3)

[![Logo](resources/logo.png)](resources/logo.png)

jim
===

[](#jim)

jim is a highly extensible task runner.

[![Screencast](resources/screencast.gif)](resources/screencast.gif)

Concept
-------

[](#concept)

jim comes in two parts: the cli-command and the `jim-core` package.

### jim-cli

[](#jim-cli)

The jim command is just a wrapper that makes the `jim` command globally available. When you run a jim command, it will look for a jim-runtime inside the current working directory and delegate the command to it.

### jim-core (this package)

[](#jim-core-this-package)

The jim-runtime can be installed via [Composer](https://getcomposer.org/) or [npm](http://npmjs.com/). Once you installed the package inside your project, you will be able to execute jim commands.

#### jim-core and jim-scripts

[](#jim-core-and-jim-scripts)

The jim-core packages comes with a pretty small set of pre-installed commands. The true power of jim lies in the concept of jim-scripts.

You can write your own commands as node- or shell-scripts and make them available to jim.

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

[](#installation)

### jim-cli

[](#jim-cli-1)

You can install the jim-command by executing the `install.sh` script inside the repository. You only need to do this once.

```
curl -o- https://raw.githubusercontent.com/pnodev/jim-core/refs/heads/main/install.sh | bash
```

### jim-core

[](#jim-core)

Depending on your project, you can install jim-core with the following commands:

> **Note**It is recommended to install jim-core as a dev-dependency

#### Node / npm

[](#node--npm)

```
npm install -D @pnodev/jim-core
```

#### PHP / Composer

[](#php--composer)

```
composer require --dev pnodev/jim-core
```

Configuration / Usage
---------------------

[](#configuration--usage)

You can provide project-specific configuration with a `.jimrc` file:

```
NODE_VERSION=20
DIR_JIM_SCRIPTS=./jim-scripts
```

VariableDescription`NODE_VERSION`if you set the node-version, jim will make sure to set the correct version via [nvm](https://github.com/nvm-sh/nvm) before executing node commands. This is especially useful if you are switching a lot between projects that require different node versions.`DIR_JIM_SCRIPTS`Makes node- or shell-scripts at the specified location available as jim-commands.You can add more project-specific variables here. All variables defined in `.jimrc` will be exposed to the commands, so you can use them in your scripts. You could e.g. add variables to define the path to your JavaScript files and use it inside a esbuild-task.

Writing custom commands
-----------------------

[](#writing-custom-commands)

Custom commands can be written as shell scripts. The jim-runtime provides you with the following helpers for writing your scripts in a consistent manner:

### Environment Variables

[](#environment-variables)

The following environment variables will be made available for your commands:

VariableDescription`DIR_JIM_SCRIPTS`The path to your jim-scripts folder`DIR_CORE`The path to your jim-core package> **Note**Additionally, all variables you defined in `.jimrc` will be available as well.

### Utility functions

[](#utility-functions)

By importing the following script, you get access to a bunch of utility functions:

```
source "${DIR_CORE}/utils.sh"
```

#### Colors

[](#colors)

To generate more pleasing terminal output, you can use the following variables to format your logs:

VariableDescription`COLOR_RESET`Resets all formatting`COLOR_YELLOW`Sets the color to yellow`COLOR_BLUE`Sets the color to blue`COLOR_GREEN`Sets the color to green`COLOR_RED`Sets the color to red`COLOR_CYAN`Sets the color to cyan`COLOR_DIMMED`Dimms the output color`COLOR_BOLD`Formats the output bold#### \_log

[](#_log)

The `_log` function provides a coherent output behaviour. It is recommended to use it for all logs. It accepts the output string as the first parameter and an optional second parameter to set the output color.

```
_log "This is a yellow string" "${COLOR_YELLOW}"
```

#### \_ask

[](#_ask)

The `_ask` functions displays a prompt to which the user can answer with yes or no. A good usecase for this function is asking the user for confirmation before executing a potentially dangerous command:

```
source "${DIR_CORE}/utils.sh"

if _ask "This will overwrite the data on the deploy server, do you want to continue?"
then
  _log "… Stating update" "$COLOR_YELLOW"
  ddev updateDeploy
  _log "✓ update finished" "$COLOR_YELLOW"
  echo ""
fi
```

#### \_box

[](#_box)

The `_box` function will display a given string inside a box:

```
_box "I'm in a box"
```

```
┌──────────────┐
│ I'm in a box │
└──────────────┘

```

#### \_invoke

[](#_invoke)

The `_invoke` command can be used to start another jim-task as a subtask. E.g. if you have a `build`-task that should start both the `build:css`- and `build:js`-tasks, you could do the following:

```
source "${DIR_CORE}/utils.sh"

setNodeVersion

_invoke build:css
_invoke build:js
```

#### \_announceTaskStart

[](#_announcetaskstart)

Pre-formatted log for announcing that your task started.

```
_announceTaskStart "Building CSS"
```

```
[jim] 🚧 Building CSS

```

#### \_announceTaskEnd

[](#_announcetaskend)

Pre-formatted log for announcing that your task finished.

```
_announceTaskEnd "CSS built in ${PATH_CSS_OUT}"
```

```
[jim] 💪 CSS built in Resources/Public/Css/main.min.css

```

#### setNodeVersion

[](#setnodeversion)

Sets the node version to the one specified in `.jimrc`. This is useful if you need to call a node-script from inside a shell-script command.

```
source "${DIR_CORE}/utils.sh"

setNodeVersion
npm install
```

Removing jim-cli
----------------

[](#removing-jim-cli)

If you want to remove the jim command from your system, simply execute the `uninstall.sh` script inside this repository.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~60 days

Recently: every ~89 days

Total

10

Last Release

564d ago

Major Versions

0.3.0 → 1.0.02023-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/25957482b3afba54a61eee9cdc912597eefc12d0a20e672279a3c29dd073d010?d=identicon)[pno](/maintainers/pno)

---

Top Contributors

[![kaesetoast](https://avatars.githubusercontent.com/u/1102078?v=4)](https://github.com/kaesetoast "kaesetoast (30 commits)")[![janwolfram](https://avatars.githubusercontent.com/u/40030632?v=4)](https://github.com/janwolfram "janwolfram (3 commits)")

### Embed Badge

![Health badge](/badges/pnodev-jim-core/health.svg)

```
[![Health](https://phpackages.com/badges/pnodev-jim-core/health.svg)](https://phpackages.com/packages/pnodev-jim-core)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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