{"id":38949231,"url":"https://github.com/jools-r/textpattern-cli-install","last_synced_at":"2026-01-17T16:07:22.127Z","repository":{"id":319877461,"uuid":"1079833201","full_name":"jools-r/textpattern-cli-install","owner":"jools-r","description":"Automatic command-line installation of textpattern using a setup.json config file.","archived":false,"fork":false,"pushed_at":"2025-10-20T16:15:25.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-20T18:16:19.507Z","etag":null,"topics":["textpattern","textpattern-cms","textpattern-dev-tool"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jools-r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-20T13:06:46.000Z","updated_at":"2025-10-20T16:17:05.000Z","dependencies_parsed_at":"2025-10-20T18:16:26.120Z","dependency_job_id":"2f398028-f86a-4aaa-9e45-fecb06f07f20","html_url":"https://github.com/jools-r/textpattern-cli-install","commit_stats":null,"previous_names":["jools-r/textpattern-cli-install"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jools-r/textpattern-cli-install","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jools-r%2Ftextpattern-cli-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jools-r%2Ftextpattern-cli-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jools-r%2Ftextpattern-cli-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jools-r%2Ftextpattern-cli-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jools-r","download_url":"https://codeload.github.com/jools-r/textpattern-cli-install/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jools-r%2Ftextpattern-cli-install/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["textpattern","textpattern-cms","textpattern-dev-tool"],"created_at":"2026-01-17T16:07:22.046Z","updated_at":"2026-01-17T16:07:22.116Z","avatar_url":"https://github.com/jools-r.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Textpattern CLI installation\n\nInstall Textpattern CMS in seconds from the command line with this shell script for automatic creation of a database and Textpattern installation based on site specifications defined in a `setup.json` file.\n\n\n\n## Prerequisites\n\n* Shell access (this example runs on MacOS with a zsh shell)\n* A (local) web server with active git, php and mysql services\n* [jq](https://jqlang.org/download/) installed in your shell\n\n\n\n## Description\n\nThis repo comprises two files: \n- `setup_textpattern.zsh` - a shell script. Set up once and re-use, and \n- `setup.json` - a config file containing the configuration for each new site.\n\nIn the standard setup, the script pulls [the current dev branch of Textpattern](https://github.com/textpattern/textpattern/tree/dev) from GitHub, prunes all descriptive text files, repo config files and typically unused folders, reads the setup configuration in `setup.json`, creates the database if it does not already exist and installs Textpattern.\n\nThe result is a clean, ready-to-use Textpattern installation with a preconfigured admin user, perfect for quickly spinning up test sites on a local web server.\n\nThis principle can be adapted to setup a Textpattern site with a custom start configuration, or based on the release branch of Textpattern.\n\n\n\n## Installation\n\n\n### Option A – In you local site folder (once per site)\n\n* Create a folder in your web root to hold your site.\n* Save `setup_textpattern.zsh` as a text file in this folder.\n* Open a Terminal at this folder (on Mac: right-click on the folder in the Finder and choose _Services › New Terminal at Folder_).\n* Enter `chmod +x setup_textpattern.zsh` + ENTER to make the setup file executable.\n\nContinue below with \"Usage\".\n\n\n### Option B – For system-wide use (re-usable)\n\n* Either open a fresh Terminal at a folder that you already know to be in your `PATH` variable such as `usr/local/bin` or create a separate folder to hold your own executable scripts, e.g.:\n  * Open a fresh Terminal and type `cd ~` + ENTER to go to your home directory.\n  * Type `mkdir bin` to create a folder called `bin` (if this does not already exist).\n  * Type `vim ~/.zshrc` to open the zsh shell environment variable settings file.\n  * Press `i` to start editing, find or make a free line (e.g. alongside other PATH settings) and type `export PATH=~/bin:$PATH`.\n  * Press `ESC` and type `:wq` to save the changes.\n  * Close and restart your Terminal. From now on, executable scripts saved in this folder should be reachable system-wide.\n* Still in the Terminal: save `setup_textpattern.zsh` as a text file to the folder you chose/created above.\n* Run `chmod +x setup_textpattern.zsh` to make the setup file executable.\n\nContinue below with \"Usage\".\n\n\n\n## Usage\n\n* Create a folder in your web root folder to hold your site (if not already created earlier). If your host or local web server requires you to set up any domain details / databases, do this now. \n* Save `setup.json` as a text file into this folder.\n* Open `setup.json` in a text editor and modify to match your site's configuration. Not all details are required, but you will need:\n  - public_url\n  - your MySQL connection and db details\n  - user credentials for a predefined admin user\n* Open a Terminal window in your site's folder and run `./setup_textpattern.zsh`.\n* The script should execute and report on its progress, for example:\n\n```\nCloning into 'textpattern'...\nremote: Enumerating objects: 100074, done.\nremote: Counting objects: 100% (934/934), done.\nremote: Compressing objects: 100% (325/325), done.\nremote: Total 100074 (delta 781), reused 680 (delta 606), pack-reused 99140 (from 3)\nReceiving objects: 100% (100074/100074), 51.93 MiB | 21.87 MiB/s, done.\nResolving differences: 100% (71060/71060), done.\nDeleted: textpattern/.git\nDeleted: textpattern/.github\nDeleted: textpattern/.gitignore\nDeleted: textpattern/.gitattributes\nDeleted: textpattern/.phpstorm.meta.php\nDeleted: textpattern/phpcs.xml\nDeleted: textpattern/composer.lock\nDeleted: textpattern/composer.json\nDeleted: textpattern/package.json\nDeleted: textpattern/HISTORY.txt\nDeleted: textpattern/UPGRADE.txt\nDeleted: textpattern/INSTALL.txt\nDeleted: textpattern/LICENSE.txt\nDeleted: textpattern/README.txt\nDeleted: textpattern/README.md\nDeleted: textpattern/CONTRIBUTING.md\nDeleted: textpattern/CODE_OF_CONDUCT.md\nDeleted: textpattern/SECURITY.md\nDeleted: textpattern/rpc\nDeleted: textpattern/sites\nEnter password: \nEnter password: \nDatabase your_sitename_db created.\n[OK]\tConnected\n[OK]\tUsing your_sitename_db (utf8mb4).\n[OK]\tCreating database tables\n[OK]\tLang: 'en'\n[OK]\tPrefs: 'data/core'\n[OK]\tImport: 'data/txp_category'\n[OK]\tImport: 'data/txp_link'\n[OK]\tImport: 'data/txp_section'\n[OK]\tImport: 'articles/articles.welcome'\n[OK]\tPublic theme: 'four-point-nine'\n[OK]\tThat went well!\n```\n\nDepending on your connection and computer, this usually takes less than a minute, often just 10-20 seconds.\n\nYour site is ready to go: open it in your browser and sign in to the admin area using the login details you specified.\n\n\n**Example with [Laravel Valet](https://laravel.com/docs/valet) on a Mac**\n\nLaravel Valet sets up a low-overhead always-on web server with php and mysql running as background services. It maps any folder in the `~/Sites` folder to the site url `name-of-folder.test` making it very easy to create new sites. You just need [git](https://git-scm.com/downloads) and [jq](https://jqlang.org/download/) already installed on your system. If you have setup the install script for system-wide use, spinning up a new site is as easy as:\n\n* Create a new folder named after the site name in the MacOS `Sites` folder.\n* Copy `setup.json` into this folder\n* Edit `setup.json` to match the site's name and your desired database name. If your standard admin user doesn't change, there's often nothing more to change.\n* Open a Terminal window at your folder and run `./setup_textpattern.zsh`.\n\nYour site is installed and immediately reachable in your browser at `http://name-of-folder.test`. \n\n\n**Bonus: set up an alias for easier use**\n\n* Open a Terminal window, and enter `vim .zshrc` to open the zsh shell environment variable settings file.\n* Press `i` to begin editing. On a free line enter `alias setup_txp=\"~/bin/setup_textpattern.zsh\"` (adapt to match where you saved your script).\n* Press `ESC` and type `:wq` to save the changes.\n* Close and restart your Terminal. From now on, you can start the script by entering `setup_txp` in the Terminal.\n\n\n\n## Adapting to own scenarios\n\n\n### Adapting setup_textpattern.zsh\n\n* You can rename the file if desired. Equally you can use an alias name of your choosing.\n* If you prefer to keep certain files \u0026 folders in your Textpattern installation, edit the `TO_DELETE` variable in the script in a text editor.\n* If you want to copy a different branch, edit the `REPO_BRANCH` variable to match the desired branch name, e.g. `REPO_BRANCH=\"main\"` for the release branch.\n* If you want to use a different name for the config file, edit the `SETUP_JSON` variable to match your filename. It must be in json format.\n* Create several versions of the installer for different pre-configured quick-install options.\n\n### Adapting your site’s start configuration\n\n* Extend the `setup_textpattern.zsh` script to copy in desired test files or insert a pre-prepared .sql file to the database with initial settings.\n* Supply a different `content_directory` to start with your own initial content. By default, the setup script uses the details supplied in the `articles`, `themes` and `data` folders in the [/textpattern/setup/](https://github.com/textpattern/textpattern/tree/dev/textpattern/setup/) folder. Follow this pattern for your own details.\n\n### Adapting for offline use or non-git-capable servers (TODO)\n\n* Instead of cloning the current dev/main branch from the GitHub repo, `setup_textpattern.zsh` could be adapted to make a copy of a pre-existing blank installation folder saved elsewhere on your computer. Unneeded files and/or add further desired files could be added to this folder as required.\n* \n\n## Contributions welcome\n\n* Instructions for use on Windows, Linux, or with other local web servers welcome.\n\n\n## Credits\n\nThe Textpattern devs and team, especially [Pete Cooper](https://github.com/petecooper) for his example of the demo installer and [makss](https://github.com/makss) for adding the CLI installation facility to the setup installer back in 2017.\n\n\n## Changelog\n\n* v1.0 – Initial version – 20 Oct 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjools-r%2Ftextpattern-cli-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjools-r%2Ftextpattern-cli-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjools-r%2Ftextpattern-cli-install/lists"}