{"id":14955122,"url":"https://github.com/roots/trellis-cli","last_synced_at":"2025-04-04T08:05:20.198Z","repository":{"id":37979859,"uuid":"164352322","full_name":"roots/trellis-cli","owner":"roots","description":"A CLI to manage Trellis projects","archived":false,"fork":false,"pushed_at":"2025-03-29T19:43:40.000Z","size":1290,"stargazers_count":170,"open_issues_count":31,"forks_count":26,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-30T17:46:34.788Z","etag":null,"topics":["ansible","cli","roots","trellis","trellis-cli","wordpress"],"latest_commit_sha":null,"homepage":"https://roots.io/trellis/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roots.png","metadata":{"funding":{"github":"roots"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-01-06T22:49:12.000Z","updated_at":"2025-03-29T19:42:46.000Z","dependencies_parsed_at":"2023-12-07T17:48:42.532Z","dependency_job_id":"3c290658-8baf-4257-b27c-110e30fd0332","html_url":"https://github.com/roots/trellis-cli","commit_stats":{"total_commits":495,"total_committers":20,"mean_commits":24.75,"dds":0.5212121212121212,"last_synced_commit":"1e3341c6eaf69fca0cb47939c7fe21f5fc6cb2a8"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roots%2Ftrellis-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roots%2Ftrellis-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roots%2Ftrellis-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roots%2Ftrellis-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roots","download_url":"https://codeload.github.com/roots/trellis-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142049,"owners_count":20890652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ansible","cli","roots","trellis","trellis-cli","wordpress"],"created_at":"2024-09-24T13:10:33.111Z","updated_at":"2025-04-04T08:05:20.192Z","avatar_url":"https://github.com/roots.png","language":"Go","readme":"# trellis-cli\n\n[![Build status]( https://img.shields.io/github/actions/workflow/status/roots/trellis-cli/ci.yml?branch=master\u0026style=flat-square)](https://github.com/roots/trellis-cli/actions)\n![GitHub release](https://img.shields.io/github/release/roots/trellis-cli?style=flat-square)\n\nA command-line interface (CLI) to manage [Trellis](https://roots.io/trellis/) projects via the `trellis` command. It includes:\n* Smart autocompletion (based on your defined environments and sites)\n* Automatic Virtualenv integration for easier dependency management\n* Easy [DigitalOcean](https://roots.io/r/digitalocean) droplet creation\n* Better Ansible Vault support for encrypting files\n\n\n## Sponsors\n\n**trellis-cli** is an open source project and completely free to use.\n\nHowever, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider [sponsoring Roots](https://github.com/sponsors/roots).\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/sponsors/roots\"\u003e\u003cimg height=\"32\" src=\"https://img.shields.io/badge/sponsor%20roots-525ddc?logo=github\u0026logoColor=ffffff\u0026message=\" alt=\"Sponsor Roots\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://carrot.com/\"\u003e\u003cimg src=\"https://cdn.roots.io/app/uploads/carrot.svg\" alt=\"Carrot\" width=\"148\" height=\"111\"\u003e\u003c/a\u003e \u003ca href=\"https://wordpress.com/\"\u003e\u003cimg src=\"https://cdn.roots.io/app/uploads/wordpress.svg\" alt=\"WordPress.com\" width=\"148\" height=\"111\"\u003e\u003c/a\u003e \u003ca href=\"https://worksitesafety.ca/careers/\"\u003e\u003cimg src=\"https://cdn.roots.io/app/uploads/worksite-safety.svg\" alt=\"Worksite Safety\" width=\"148\" height=\"111\"\u003e\u003c/a\u003e \u003ca href=\"https://www.itineris.co.uk/\"\u003e\u003cimg src=\"https://cdn.roots.io/app/uploads/itineris.svg\" alt=\"Itineris\" width=\"148\" height=\"111\"\u003e\u003c/a\u003e \u003ca href=\"https://bonsai.so/\"\u003e\u003cimg src=\"https://cdn.roots.io/app/uploads/bonsai.svg\" alt=\"Bonsai\" width=\"148\" height=\"111\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Quick Install (macOS and Linux via Homebrew)\n\n`brew install roots/tap/trellis-cli`\n\n## Quick Install (Unstable - macOS and Linux via Homebrew)\n\n```bash\n# Cleanup previous versions (if installed)\nbrew uninstall roots/tap/trellis-cli\n\n# Install\nbrew install --HEAD roots/tap/trellis-cli-dev\n\n# Upgrade\nbrew upgrade --fetch-HEAD roots/tap/trellis-cli-dev\n```\n\n### Script\n\nWe also offer a quick script version:\n\n```bash\n# You might need sudo before bash\ncurl -sL https://roots.io/trellis/cli/get | bash\n\n# Turns on debug logging\ncurl -sL https://roots.io/trellis/cli/get | bash -s -- -d\n\n# Sets bindir or installation directory, Defaults to '/usr/local/bin'\ncurl -sL https://roots.io/trellis/cli/get | bash -s -- -b /path/to/my/bin\n```\n\n## Manual Install\n\ntrellis-cli provides binary releases for a variety of OSes. These binary versions can be manually downloaded and installed.\n\n1. Download the [latest release](https://github.com/roots/trellis-cli/releases/latest) or any [specific version](https://github.com/roots/trellis-cli/releases)\n2. Unpack it (`tar -zxvf trellis_1.0.0_Linux_x86_64.tar.gz`)\n3. Find the `trellis` binary in the unpacked directory, and move it to its desired destination (`mv trellis_1.0.0_Darwin_x86_64/trellis /usr/local/bin/trellis`)\n4. Make sure the above path is in your `$PATH`\n\n## Windows Install\ntrellis-cli does offer a native Windows exe but we [recommend you use\nWSL](https://roots.io/trellis/docs/installation/#local-development-requirements) for Trellis. The above install methods will work for WSL as well.\n\nIf you do want to use the native Windows exe, you'll need to do the following\nsetup after downloading the Windows build:\n\n1. Open system properties\n2. Open environment variables\n3. Under system variables add new variable, `TRELLIS`, pointing to the location of the `trellis.exe` file, like `C:\\trellis_1.0.0`\n4. Edit path from system variables and add new named `%TRELLIS%`\n5. Save the changes\n\n## Verify Attestation\ntrellis-cli artifacts can be [cryptographically verified via GitHub CLI](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#verifying-artifact-attestations-with-the-github-cli).\n\n```console\n# The archive with both predicates\n$ gh attestation verify --repo roots/trellis-cli /path/to/trellis_Darwin_arm64.tar.gz\n## ...snipped...\n✓ Verification succeeded!\n\nsha256:xxx was attested by:\nREPO                   PREDICATE_TYPE                  WORKFLOW\nroots/trellis-cli  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/tags/v9.8.7\nroots/trellis-cli  https://spdx.dev/Document/v2.3  .github/workflows/release.yml@refs/tags/v9.8.7\n\n# The binary\n$ gh attestation verify --repo roots/trellis-cli /path/to/trellis\n## ...snipped...\n✓ Verification succeeded!\n\nsha256:xxx was attested by:\nREPO                   PREDICATE_TYPE                  WORKFLOW\nroots/trellis-cli  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/tags/v9.8.7\n\n# The SBOM\n$ gh attestation verify --repo roots/trellis-cli /path/to/trellis_Darwin_arm64.tar.gz.sbom.json\n## ...snipped...\n✓ Verification succeeded!\n\nsha256:xxx was attested by:\nREPO                   PREDICATE_TYPE                  WORKFLOW\nroots/trellis-cli  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/tags/v9.8.7\n```\n\n## Shell Integration\n\n### Autocompletes\n\nHomebrew installs trellis-cli's shell completion automatically by default. If shell completions aren't working, or you installed manually not using Homebrew, you'll need to install the completions manually.\n\nTo use the trellis-cli's autocomplete via Homebrew's shell completion:\n\n1. Follow Homebrew's install instructions https://docs.brew.sh/Shell-Completion\n\n    Note: For zsh, as the instructions mention, be sure compinit is autoloaded and called, either explicitly or via a framework like oh-my-zsh.\n\n2. Then run:\n\n    ```bash\n    brew reinstall trellis-cli\n    ```\n\nTo install shell completions manually, run the following:\n\n```bash\ntrellis --autocomplete-install\n```\n\nIt should modify your `.bash_profile`, `.zshrc` or similar.\n\n### Virtualenv\n\ntrellis-cli uses [Virtualenv](https://virtualenv.pypa.io) to manage dependencies such as Ansible which it automatically activates and uses when running any `trellis` command.\nBut there's still a lot of times you may want to run `ansible-playbook` or `pip` manually in your shell. To make this experience seamless, trellis-cli\noffers shell integration which automatically activates the Virtualenv when you enter a Trellis project, and deactivates when you leave it.\n\n![venv integration](https://user-images.githubusercontent.com/295605/84097210-d8df6700-a9d1-11ea-9eaf-fbdbd6632d34.gif)\n\nTo enable this integration, add the following to your shell profile:\n\nBash (`~/.bash_profile`):\n```bash\neval \"$(trellis shell-init bash)\"\n```\n\nZsh (`~/.zshrc`):\n```bash\neval \"$(trellis shell-init zsh)\"\n```\n\n## Usage\n\nRun `trellis` for the complete usage and help.\n\nSupported commands so far:\n\n| Command | Description |\n| --- | --- |\n| `alias` | Generate WP CLI aliases for remote environments |\n| `check` | Checks if Trellis requirements are met |\n| `db` | Commands for database management |\n| `deploy` | Deploys a site to the specified environment |\n| `dotenv` | Template .env files to local system |\n| `down` | Stops the Vagrant machine by running `vagrant halt`|\n| `droplet` | Commands for DigitalOcean Droplets |\n| `exec` | Exec runs a command in the Trellis virtualenv |\n| `galaxy` | Commands for Ansible Galaxy |\n| `info` | Displays information about this Trellis project |\n| `init` | Initializes an existing Trellis project |\n| `key` | Commands for managing SSH keys |\n| `logs` | Tails the Nginx log files |\n| `new` | Creates a new Trellis project |\n| `open` | Opens user-defined URLs (and more) which can act as shortcuts/bookmarks specific to your Trellis projects |\n| `provision` | Provisions the specified environment |\n| `rollback` | Rollsback the last deploy of the site on the specified environment |\n| `ssh` | Connects to host via SSH |\n| `up` | Starts and provisions the Vagrant environment by running `vagrant up` |\n| `valet` | Commands for Laravel Valet |\n| `vault` | Commands for Ansible Vault |\n| `xdebug-tunnel` | Commands for managing Xdebug tunnels |\n\n## Configuration\nThere are three ways to set configuration settings for trellis-cli and they are\nloaded in this order of precedence:\n\n1. global config (`$HOME/.config/trellis/cli.yml`)\n2. project config (`trellis.cli.yml`)\n3. project config local override (`trellis.cli.local.yml`)\n4. env variables\n\nThe global CLI config (defaults to `$HOME/.config/trellis/cli.yml`)\nand will be loaded first (if it exists).\n\nNext, if a project is detected, the project CLI config will be loaded if it\nexists at `trellis.cli.yml`. A Git ignored local override config is also\nsupported at `trellis.cli.local.yml`.\n\nFinally, env variables prefixed with `TRELLIS_` will be used as\noverrides if they match a supported configuration setting. The prefix will be\nstripped and the rest is lowercased to determine the setting key.\n\nNote: only string, numeric, and boolean values are supported when using environment\nvariables.\n\nCurrent supported settings:\n\n| Setting | Description | Type | Default |\n| --- | --- | -- | -- |\n| `allow_development_deploys` | Whether to allows deploy to the `development` env | boolean | false |\n| `ask_vault_pass` | Set Ansible to always ask for the vault pass | boolean | false |\n| `check_for_updates` | Whether to check for new versions of trellis-cli | boolean | true |\n| `database_app` | Database app to use in `db open` (Options: `tableplus`, `sequel-ace`)| string | none |\n| `load_plugins` | Load external CLI plugins | boolean | true |\n| `open` | List of name -\u003e URL shortcuts | map[string]string | none |\n| `virtualenv_integration` | Enable automated virtualenv integration | boolean | true |\n| `vm` | Options for dev virtual machines | Object | see below |\n\n### `vm`\n| Setting | Description | Type | Default |\n| --- | --- | -- | -- |\n| `manager` | VM manager (Options: `auto` (depends on OS), `lima`)| string | \"auto\" |\n| `ubuntu` | Ubuntu OS version (Options: `18.04`, `20.04`, `22.04`, `24.04`)| string |\n| `hosts_resolver` | VM hosts resolver (Options: `hosts_file`)| string |\n| `instance_name` | Custom name for the VM instance | string | First site name alphabetically |\n| `images` | Custom OS image | object | Set based on `ubuntu` version |\n\n#### `images`\n| Setting | Description | Type | Default |\n| --- | --- | -- | -- |\n| `location` | URL of Ubuntu image | string | none |\n| `arch` | Architecture of image (eg: `x86_64`, `aarch64`) | string | none |\n\nExample config:\n\n```yaml\nask_vault_pass: false\ncheck_for_updates: true\nload_plugins: true\nopen:\n  site: \"https://mysite.com\"\n  admin: \"https://mysite.com/wp/wp-admin\"\nvirtualenv_integration: true\nvm:\n  manager: \"lima\"\n  instance_name: \"custom-instance-name\"  # Optional: Set a specific VM instance name\n```\n\nExample env var usage:\n```bash\nTRELLIS_ASK_VAULT_PASS=true trellis provision production\n```\n\n## Development\n\ntrellis-cli requires Go \u003e= 1.18 (`brew install go` on macOS)\n\n```bash\n# Clone the repo\ngit clone https://github.com/roots/trellis-cli\ncd trellis-cli\n\n# Build the binary for your machine\ngo build\n\n# Run tests (without integration tests)\ngo test -v -short ./...\n\n# (Optional) Build the docker image for testing (requires `docker`)\nmake docker\n# Alternatively, do not use cache when building the doccker image (requires `docker`)\nmake docker-no-cache\n\n# Run all tests (requires `docker`)\nmake test\n```\n\n## Releasing Docker Images\n\n*This section only intended for the maintainers*\n\n```bash\nmake docker-no-cache\n\n# docker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:YYYY.MM.DD.N\n# where N is a sequential integer, starting from 1.\ndocker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:2019.08.12.1\n\n# docker push rootsdev/trellis-cli-dev:YYYY.MM.DD.N\ndocker push rootsdev/trellis-cli-dev:2019.08.12.1\ndocker push rootsdev/trellis-cli-dev:latest\n```\n\n## Contributing\n\nContributions are welcome from everyone. We have [contributing guidelines](https://github.com/roots/guidelines/blob/master/CONTRIBUTING.md) to help you get started.\n\n## Community\n\nKeep track of development and community news.\n\n- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)\n- Participate on the [Roots Discourse](https://discourse.roots.io/)\n- Follow [@rootswp on Twitter](https://twitter.com/rootswp)\n- Read and subscribe to the [Roots Blog](https://roots.io/blog/)\n- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)\n","funding_links":["https://github.com/sponsors/roots"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froots%2Ftrellis-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froots%2Ftrellis-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froots%2Ftrellis-cli/lists"}