Skip to content

thefriendlybeasts/stag

 
 

Repository files navigation

STAG: A Statamic CLI

What is it?

It's the command line interface for Statamic. It can do all sorts of wonderful things for you like:

  • Deploy your code to a server (via git, rsync or ftp)
  • Pull your content down from a server (via git, rsync or ftp)
  • Clear your site cache -- locally or remotely
  • Set file permissions -- locally or remotely

Who is it for?

You're a good looking Statamic developer who loves the command line. You believe that stag clear_cache is much better than using Finder to clear those directories manually.

DISCLAIMER

Stag is in beta. It has been used on OSX to talk to an Ubuntu server.

It will be manipulating files and setting permissions on things, so if you aren't comfortable with the command line, or your site isn't under some sort of version control, then stag might not be for you... yet. Testers welcome!

Installing

  1. Download the repo, unzip and drop the stag directory into your _add-ons. (You'll need to rename stag-master to stag)
  2. If your Statamic installation isn't in the root folder, create .stag.php in your root and tell Stag the path to your add-ons directory.
    For example, if you keep your Statamic installation in ~/Sites/mysite/public_html, you should change the line to:
define("BASE_PATH", dirname("public_html/_add-ons"));

Using stag

You need to add the stag bin directory to your $PATH. In your .bash_profile (or your prefrerred shell's config) drop in this line:

export PATH=$PATH:_add-ons/stag/bin

You may need to tweak the path depending on your structure.

For example, if you keep your Statamic installation in ~/Sites/mysite/public_html, you should change the line to:

export PATH=$PATH:public_html/_add-ons/stag/bin

Reload your config file:

source ~/.bash_profile

Type stag in your Statamic root directory and if you are greeted by a couple of bucks, Congratulations! Stag is installed!

Getting Started

To list all the commands, type: stag help

For any command that will perform tasks on your server, you'll need to have setup passwordless ssh access. It's relatively easy-to-do and makes things much more secure. If that's ready to go, you'll need to configure stag to talk to your server. Copy the default config to _config/add-ons/stag.yaml

Server Configuration

You can read more in-depth about each command here: Wiki

Support

Again, stag is in beta, so if you encounter something not working properly, please create an issue and we'll to take a look.

Contribute

If you have an idea of something you'd like stag to do, suggest it here: [[email protected]](mailto:[email protected]?Subject=Stag Ideas) or feel free to fork, hack and pull request. Happy Hacking!

Packages

No packages published

Languages

  • PHP 100.0%