Download the PHP package avocadesign/statamic-tools without Composer

On this page you can find all versions of the php package avocadesign/statamic-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-tools

Avoca Tools

The machinery Avoca Design sites share: reference pages for clients, plus the checks and generated files that keep each site's block knowledge in step with its fieldsets. The addon holds no site content. Each site keeps its own guidance files and AI block catalogue, committed in its own repo.

What it provides

On production the reference pages are only visible to a logged-in Statamic user.

Files in the site

Path Written by Read by
resources/site/blocks/<handle>.md people the content page and the catalogue
resources/site/sets/<handle>.md people the content page and the catalogue
resources/site/design.md people the catalogue
resources/site/catalogue.md avoca:site:catalogue AI editors
resources/site/collections/<handle>.md avoca:make:collection, then people and AI agents AI agents finishing or changing a collection
resources/site/editor-access.yaml people avoca:site:permissions, the automatic editor role updates and avoca:site:check
resources/site/installed.yaml avoca:library:install, avoca:site:script avoca:library:list, avoca:site:check
scripts/server-git.sh avoca:site:script, then the site cron and the deploy script on the server

The paths are set in config/statamic-tools.php.

Server scripts

scripts/check-site.sh stays in the package: it is the same everywhere, and a site forking the thing that judges it would defeat the point.

scripts/server-git.sh does not. How a server commits a site's content is the site's business, so php please avoca:site:script writes a copy into the site at scripts/server-git.sh, executable, and records its version and a checksum of it in resources/site/installed.yaml. The starter kit runs the command when a site is installed. From then on the copy is the site's: the add-on never reads it back and never changes it again.

The package still holds the script at vendor/avocadesign/statamic-tools/scripts/server-git.sh, so a server set up before this and pointing at that path keeps working.

Guidance files

One file per block or set. This example is for a cards block:

The content page shows the description and the When to use and When not to use sections. Notes for AI appear only in the catalogue. Any other section heading is shown on the page and included in the catalogue. Placeholder text left from a stub counts as not written, so it never reaches the catalogue.

Rules every block shares, such as when to use each colour scheme, live once in resources/site/design.md instead of in each block's file. Its written sections appear in the catalogue under Design, before the blocks, and a Notes for AI section works the same way as in block guidance. --stubs writes this file too.

Keeping the catalogue current

  1. Change a fieldset or a guidance file.
  2. Run php please avoca:site:catalogue and commit the catalogue with your change.
  3. CI runs php please avoca:site:check --strict, which fails when the committed catalogue does not match.

Point the site's AI brief at the catalogue so an AI editor reads it before adding content.

Making a collection

php please avoca:make:collection

It asks for a title and handle, whether each entry gets its own page and at what URL, whether entries are dated, whether editors put them in order by hand, whether an entry is built with the page builder or from its own fields, and whether a block lists the entries. Then it writes:

With the page builder and URLs, entries use the site's default template. The catalogue is regenerated when a block is added, unless --no-catalogue. Nothing is written if any of the files, or a page builder block with the same handle, already exists. It also stops when a library item the site hasn't installed uses the handle, as Names describes. --dry-run shows every change, and -v adds each file's contents.

Every question has an option, so an AI agent can run it without prompts. --json reports the record path and each step:

php please avoca:make:collection --title="People" --ordered --blueprint=custom \
    --description="Each person has a photo, name, role, a short bio, an email and a LinkedIn link." --json

The options are --title, --handle, --route or --no-route, --dated, --ordered, --blueprint=page_builder|custom, --description, --no-block, --no-editor-access, --ignore-library, --no-catalogue, --dry-run, --json and --ai.

An AI agent finishes a custom blueprint from the record: ask it to build the blueprint described in resources/site/collections/people.md. With --ai, once you confirm, the command runs Claude Code headless itself, if claude is on the PATH. It runs with --restricted, --permission-mode dontAsk and an allow list, so it can read the site, change only the files the record lists, and run php please avoca:site:catalogue and php please avoca:site:check --strict. It does not commit.

Editor permissions

The editor role in resources/users/roles.yaml holds the permissions for every collection, taxonomy, navigation, global set and asset container, so the site is ready for editors as soon as it moves to Statamic Pro. Statamic Core ignores roles but still keeps the file, so this runs on Core too. Each type gets every permission Statamic has for it.

To keep a structure away from editors, list its handle in resources/site/editor-access.yaml, under the folder in content/ that holds its settings file:

assets:
  - favicons
globals:
  - seo

A collection made with --no-editor-access is opted out by editor_access: false in its record. Opting out stops permissions being added and never removes any, so a partial set, such as view only, stays as it is. The role's handle is editor_role in config/statamic-tools.php.

Installing

Sites made from the Avoca starter kit get the addon while the kit installs. For any other site:

It needs Statamic 6. It comes from Packagist, so Composer needs no repository entry and no credentials, on a computer or on a server.

Versions and releases

Releases are git tags on GitHub, such as v0.1.0, and CHANGELOG.md says what each one changed. Each site records the version it runs in its composer.lock, so sites can run different versions side by side.

To make a release:

  1. Add the release to CHANGELOG.md and commit it on main.
  2. Tag that commit, such as git tag -a v0.1.1 -m "Avoca Tools v0.1.1".
  3. Push main and the tag: git push origin main v0.1.1.
  4. A release that changes how sites work goes in the changelog with a note on what to do about it. Sites ask for <2.0, so only a 2.0 release needs the starter kit's constraint changed and sites moved on purpose.

The sandbox requires the addon as *@dev from its local folder, so it always runs the code being worked on.

Library

Avoca's library of ready-made blocks, text editor sets and presets lives in library/. It holds the FAQ, Projects and Testimonials presets.

php please avoca:library
php please avoca:library:install {handle} --dry-run
php please avoca:library:install {handle}

Installing copies the item's files into the site and adds its blocks or sets to their declared group. It places its control panel screenshot, adds permissions, records the version in resources/site/installed.yaml and regenerates the catalogue. It stops before writing anything if a file or fieldset entry already exists and differs, unless --force is given. library/README.md describes the item format.

Names

A library item reserves its handles: its own, those of the blocks and sets it adds, and those of the collections, taxonomies, global sets, navigations and fieldsets among its files. The recipe installs a library item rather than building the same thing again, and installing an item after new work took one of its handles would collide.

php please avoca:check-name testimonials --display="Testimonials"

It exits with 1 when the handle is taken: a library item the site hasn't installed uses it, or the site already has a block, set, collection, taxonomy, global set, navigation or fieldset with it. A similar name, one that differs only in case, separators or a plural, or has the same name editors see, is listed but doesn't take the handle. --json reports as JSON.

Licence and credits

Avoca Tools is published so that Avoca's sites can install it with Composer. It is not open source: LICENSE grants the right to run it on a site Avoca builds or maintains, and nothing else.

Issues and pull requests are not monitored. The addon is written for Avoca's own starter kit and isn't meant to be used elsewhere.

Two ideas here came from Agentic (MIT, © Sander Janssen): a site reference an AI editor can read, and generating a block catalogue from the site's own fieldsets. None of its code is used.


All versions of statamic-tools with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package avocadesign/statamic-tools contains the following files

Loading the files please wait ...