import { Split, Appear, Head, FullScreenCode, Image, } from 'mdx-deck' import { code, prism } from '@mdx-deck/themes'
export const themes = [ code, prism ]
import iterm from './images/iterm.png'
<title>CLI Tools at VIP</title>Command Line Interface
"...a means of interacting with a computer program where the user issues commands to the program in the form of successive lines of text."
- Control
- Repeatable
- Automation
- Shareable
- Speed
- Development Speed
- Basic Examples
- Shell Tricks
- WP CLI
- VIP CLI
- VIP Go CLI
- Q & A
$ ls
$ ls
README.md node_modules now.json package.json
deck.mdx notes.md package-lock.json theme.js
$ ls content
$ ls content
camels.mp4 camels.txt cats.gif otters.jpg
List all the files on your desktop via CLI
$ ls -l content
$ ls -l content
total 11624
-rw-rw-rw-@ 1 vip staff 431015 Oct 15 16:35 camels.mp4
-rw-r--r-- 1 vip staff 10155 Oct 15 16:55 camels.txt
-rw-rw-rw-@ 1 vip staff 4693925 Oct 15 16:33 cats.gif
-rw-rw-rw-@ 1 vip staff 141734 Oct 15 16:40 otters.jpg
$ ls -a content
$ ls -a content
. .. .hidden-file camels.mp4 camels.txt cats.gif otters.jpg
$ ls -la content
$ ls -la content
total 11624
drwxr-xr-x 6 vip staff 192 Oct 15 16:28 .
drwxr-xr-x 13 vip staff 416 Oct 15 16:27 ..
-rw-r--r-- 1 vip staff 0 Oct 15 16:28 .hidden-file
-rw-r--r-- 1 vip staff 0 Oct 15 16:26 camels.mp4
-rw-r--r-- 1 vip staff 10155 Oct 15 16:55 camels.txt
-rw-r--r-- 1 vip staff 0 Oct 15 16:26 cats.gif
-rw-r--r-- 1 vip staff 0 Oct 15 16:26 otters.jpg
$ ls content > files.txt
$ cat files.txt
$ cat files.txt
camels.mp4
cats.gif
otters.jpg
$ less < content/camels.txt
$ less < content/camels.txt
A camel is an even-toed ungulate...
:
$ less < content/camels.txt
A camel is an even-toed ungulate...
The word camel is derived via Latin
:
$ cat content/camels.txt | less
$ cat content/camels.txt | less
A camel is an even-toed ungulate...
:
$ cat content/camels.txt | less
A camel is an even-toed ungulate...
The word camel is derived via Latin
:
$ find content -name "*.mp4" | xargs -I % open %
$ find content -name "*.mp4" | xargs -tI % open %
Save typing with filename autocomplete
$ cat content/
$ cat content/
$ cat content/
.hidden-file camels.mp4 camels.txt cats.gif otters.jpg
$ cat content/ca
$ cat content/ca
camels.mp4 camels.txt cats.gif
$ cat content/camels.t
$ cat content/camels.txt
Use up/down arrows to access previous commands
Manual pages with commmand info
$ man curl
<Image src={ iterm } />
developer.wordpress.org/cli/commands
$ vipgo sandbox start vip-test.go-vip.co
$ wp help
$ wp help
NAME
wp
DESCRIPTION
Manage WordPress through the command-line.
SYNOPSIS
wp <command>
SUBCOMMANDS
akismet Filter spam comments.
cache Adds, removes, fetches, and flushes the WP Object Cache object.
cap Adds, removes, and lists capabilities of a user role.
cli Review current WP-CLI info, check for updates, or see defined aliases.
co-authors-plus Co-Authors Plus commands for the WP-CLI framework
:
$ wp help post
Save the ID and title of all posts as a CSV in post_ids.csv
Create new posts with dummy data
$ wp help post generate
Create new users
$ wp help user create
List all sites in a multisite environment
$ wp help site list
List the themes for each site on multisite-demo.go-vip.co using xargs
Execute arbitrary PHP code
$ wp shell
$ wp shell
wp>
$ wp shell
wp> get_post( 2323 );
$ wp shell
wp> get_post( 2323 );
class WP_Post#3083 (24) {
public $ID =>
int(2323)
public $post_author =>
string(1) "0"
public $post_date =>
string(19) "1999-01-19 18:01:13"
public $post_date_gmt =>
string(19) "1970-01-01 00:00:00"
public $post_content =>
$ vip @297.testing -- wp post get 2323
$ vip @297.testing -- wp
$ vip @297.testing -- wp
Welcome to the WP CLI shell for the testing environment of vip-test (vip-test.go-vip.co)!
vip-test.testing:~$
$ vip @297.testing -- wp
Welcome to the WP CLI shell for the testing environment of vip-test (vip-test.go-vip.co)!
vip-test.testing:~$ wp post list
Using vip
, get the value cached for the key "alloptions"
in the "options"
group on site 297 (vip-test.go-vip.co)
$ vipgo -h
$ vipgo api -h
$ vipgo api get "/sites?search=test&pagesize=3"
$ vipgo db vip-test.go-vip.co
$ vipgo probe memcached --container=42088
$ vipgo probe node --container=59291
$ vipgo probe list --type memcached --site 297