PHPackages                             spatie/code-outliner - 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. spatie/code-outliner

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

spatie/code-outliner
====================

Generate outline images of your code

0.1.3(7y ago)83493MITPHPPHP ^7.1CI passing

Since Jul 19Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/spatie/code-outliner)[ Packagist](https://packagist.org/packages/spatie/code-outliner)[ Docs](https://github.com/spatie/code-outliner)[ RSS](/packages/spatie-code-outliner/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Create a visual representation of your code
===========================================

[](#create-a-visual-representation-of-your-code)

[![Latest Version](https://camo.githubusercontent.com/0ee60bf97e02dd151fb1eedbb5cc0ff4954c8849be76e7ad93b0be905b13d1d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7370617469652f636f64652d6f75746c696e65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/spatie/code-outliner/releases)[![Quality Score](https://camo.githubusercontent.com/9efdb5997300348c087aa65169d204d2fbec24f27e9a38892d3502900a0deb29/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f636f64652d6f75746c696e65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/code-outliner)[![StyleCI](https://camo.githubusercontent.com/226f255cf0ffd7776ea90f1cf78a2a1a28cfdca48efce8c7118fa1b5bbdc27ff/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3134313431333239362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/141413296)[![Total Downloads](https://camo.githubusercontent.com/1f03f1c536075208b7d290f983fb6e78279c20cf73f2d3c48c4fd230f20dc5fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f636f64652d6f75746c696e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/code-outliner)

You're reading code on a daily basis, code should be optimised for that. This tool helps you visualise how the code in your project looks, and might be a trigger to better structure your files.

More information about the visual perception of code here: .

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/ac680c0349fa6a898f0ef19bb00846c52bb0e19519cafa6d2b524e85d6df70de/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f636f64652d6f75746c696e65722e6a70673f743d31)](https://spatie.be/github-ad-click/code-outliner)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

[spatie/browsershot](https://github.com/spatie/browsershot) is required to generate images. Please refer to the Browsershot documentation for all details, most important is to install puppeteer.

```
npm install puppeteer --global

```

You can install the package via composer:

```
composer global require spatie/code-outliner

```

Usage
-----

[](#usage)

```
code-outliner  [--output=] [--extensions=]
```

### Outlining a single file

[](#outlining-a-single-file)

Pass a single file to the command, and you'll get output like this.

[![Outline of a single file](https://camo.githubusercontent.com/84f73baa588bc3517534442ab8d36b38da66182bd3267ead9d66b2edb5693e3a/68747470733a2f2f7370617469652e6769746875622e696f2f636f64652d6f75746c696e65722f6f75746c696e652d73696e676c652e706e67)](https://camo.githubusercontent.com/84f73baa588bc3517534442ab8d36b38da66182bd3267ead9d66b2edb5693e3a/68747470733a2f2f7370617469652e6769746875622e696f2f636f64652d6f75746c696e65722f6f75746c696e652d73696e676c652e706e67)

### Overlaying multiple files

[](#overlaying-multiple-files)

Pass a directory path to the command, and it'll overlay all files on top of each other. The darker areas represent areas where there's more code across all files.

[![Outline of multiple files](https://camo.githubusercontent.com/2598d83cfbc15e9b8198f7e07d438e5c02903031316236f5d742ff41de208d3e/68747470733a2f2f7370617469652e6769746875622e696f2f636f64652d6f75746c696e65722f6f75746c696e652d6d756c7469706c652e706e67)](https://camo.githubusercontent.com/2598d83cfbc15e9b8198f7e07d438e5c02903031316236f5d742ff41de208d3e/68747470733a2f2f7370617469652e6769746875622e696f2f636f64652d6f75746c696e65722f6f75746c696e652d6d756c7469706c652e706e67)

### Filtering extensions

[](#filtering-extensions)

By default, PHP files will be scanned. You're able to specify other and multiple extensions with the `--extensions` option.

```
code-outliner --extensions="html,twig"
```

### Security

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Brent Roose](https://github.com/brendt)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance54

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.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 ~6 days

Total

4

Last Release

2839d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (39 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (23 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (7 commits)")

---

Tags

phptoolspatiecode-outliner

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spatie-code-outliner/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-code-outliner/health.svg)](https://phpackages.com/packages/spatie-code-outliner)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[spatie/laravel-event-sourcing

The easiest way to get started with event sourcing in Laravel

9003.7M26](/packages/spatie-laravel-event-sourcing)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)

PHPackages © 2026

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