Skip to content

MikeiLL/trellis-cli

Repository files navigation

trellis-cli

CircleCI GitHub release

A command-line interface (CLI) for Trellis with autocompletion.

Manage your Trellis projects via the trellis command.

Quick Install (macOS and Linux via Homebrew)

brew install roots/tap/trellis-cli

Quick Install (Unstable - macOS and Linux via Homebrew)

# Cleanup previous versions (if installed)
brew uninstall roots/tap/trellis-cli

# Install
brew install --HEAD roots/tap/trellis-cli-dev

# Upgrade
brew upgrade --fetch-HEAD roots/tap/trellis-cli-dev

Script

We also offer a quick script version:

curl -sL https://roots.io/trellis/cli/get | bash

Installation

trellis-cli provides binary releases for a variety of OSes. These binary versions can be manually downloaded and installed.

  1. Download the latest release or any specific version
  2. Unpack it (tar -zxvf trellis_0.3.1_Linux_x86_64.tar.gz)
  3. Find the trellis binary in the unpacked directory, and move it to its desired destination (mv trellis_0.3.1_Darwin_x86_64/trellis /usr/local/bin/trellis)
  4. Make sure the above path is in your $PATH
  5. Run trellis --autocomplete-install to install shell autocompletions

Usage

Run trellis for the complete usage and help.

Supported commands so far:

Command Description
alias Generate WP CLI aliases for remote environments
check Checks if Trellis requirements are met
deploy Deploys a site to the specified environment
dotenv Template .env files to local system
down Stops the Vagrant machine by running vagrant halt
droplet Commands for DigitalOcean Droplets
exec Exec runs a command in the Trellis virtualenv
galaxy Commands for Ansible Galaxy
exec Exec runs a command in the Trellis virtualenv
info Displays information about this Trellis project
init Initializes an existing Trellis project
new Creates a new Trellis project
provision Provisions the specified environment
rollback Rollsback the last deploy of the site on the specified environment
ssh Connects to host via SSH
up Starts and provisions the Vagrant environment by running vagrant up
valet Commands for Laravel Valet
vault Commands for Ansible Vault

Development

trellis-cli requires Go >= 1.13 (brew install go on macOS)

# Clone the repo
git clone https://github.com/roots/trellis-cli
cd trellis-cli

# Build the binary for your machine
go build

# Run tests (without integration tests)
go test -v -short ./...

# (Optional) Build the docker image for testing (requires `docker`)
make docker
# Alternatively, do not use cache when building the doccker image (requires `docker`)
make docker-no-cache

# Run all tests (requires `docker`)
make test

Releasing Docker Images

This section only intended for the maintainers

make docker-no-cache

# docker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:YYYY.MM.DD.N
# where N is a sequential integer, starting from 1.
docker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:2019.08.12.1

# docker push rootsdev/trellis-cli-dev:YYYY.MM.DD.N
docker push rootsdev/trellis-cli-dev:2019.08.12.1
docker push rootsdev/trellis-cli-dev:latest

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Trellis sponsors

Help support our open-source development efforts by becoming a patron.

Kinsta KM Digital Scale Dynamix

Community

Keep track of development and community news.

About

A CLI to manage Trellis projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.1%
  • Shell 4.1%
  • Other 0.8%