Skip to main content

monk

MonkOS Command Line Interface

Usage

monk [GLOBAL OPTIONS] command [OPTIONS] [arguments...]

Global Flags

FlagDefaultDescription
--nofancyNo fancy output (emoji, formatting etc.)
--nocolorDo not color the output
--silentDo not print the log
--socket SOCKET, -s SOCKET/Users/nooga/.monk/monkd.sockSet TCP or UNIX SOCKET that monkd is listening on
--token-folder, --tf/Users/nooga/.monkSet the path to the token storage folder
--help, -hshow help
--skip-version-checkskip peer version mismatch in cluster
--dev-log PATH, -l PATH/Users/nooga/.monk/log/cli.logSet PATH to development log file

register

Register a new MonkOS account

login

Log in with your MonkOS account

Flags

FlagDefaultDescription
--email, -l, -e, -u``Email address
--password, -p``Password
--github, -ggithub

logout

Log out

Flags

FlagDefaultDescription
--full, -f, -alogout daemon too

reset

Reset your MonkOS account password

load

Load template YAML file(s) from disk.

Will not update a running workload. Use update after load to commit changes to the workload that is already running.

Flags

FlagDefaultDescription
--strict, -sFail on warnings

list

Aliases: ls

List available templates

Flags

FlagDefaultDescription
--runnables, -rOnly list runnables
--groups, -gOnly list groups
--local, -lOnly list local templates
--show-deprecatedList templates marked as deprecated

info

Print information about a template

Flags

FlagDefaultDescription
--table, -tPrint output in a table

actions

Aliases: list-actions

List actions exposed by a template

dump

Print template(s) in YAML format

Flags

FlagDefaultDescription
--output FILE, -o FILE``Save output to FILE

import

Aliases: clone

Combine existing templates into a new template

Usage

monk import --ns [namespace] -o [output] [SOURCE-TEMPLATE] ...

Flags

FlagDefaultDescription
--output FILE, -o FILE``Save output to a FILE
--ignore-missing, -mIgnore non-existent templates
--ns NAMESPACE, -n NAMESPACE``Target NAMESPACE name
--load, -lLoad output template after creating it

run

Run a template

Flags

FlagDefaultDescription
--tag TAG, -t TAG``Schedule run only on peers tagged with TAG in current cluster
--peer NAME, -p NAME``Schedule run on peer named NAME
--force-move, -fRe-schedule the workload if it's already running on a different tag/peer
--local, -lRun template locally even if a cluster is available
--local-only, -oSearch for templates only in local repository
--multiple, -mRun multiple templates at once
--autoload, -aAutomatically reload modified templates without prompting
--set VAR=VALUE, -s VAR=VALUESet runtime value for a variable
--variables-file FILE, --variable-file FILE, --vf FILELoad runtime values for variables from file

Runtime variables

It's possible to provide runtime values for some variables during monk run or monk update. It can be used to override default values defined in the template, or to provide values for variables that were declared without a default value, or to modify the value of a variable for monk update. Runtime variables can be set either using the --set flag for monk run or monk update, or listed in a YAML file and provided using the --variables-file flag.

E.g.:

monk run --set foo=somevalue --set somenamespace/somerunnable/bar=othervalue somenamespace/somegroup

will set the variable foo on runnable somenamespace/somegroup to somevalue, and variable bar on a runnable somenamespace/somerunnable (which is presumably a part of somegroup's runnable-list) to othervalue.

The same can be achieved by putting those values in a YAML file:

vars.yaml
foo: somevalue
somenamespace:
somerunnable:
bar: othervalue
monk run --variables-file vars.yaml somenamespace/somegroup

describe

Describe a running workload

Flags

FlagDefaultDescription
--multiple, -mDescribe multiple workloads

update

Update a running workload with new template definition

Flags

FlagDefaultDescription
--tag TAG, -t TAG``Consider only workloads running on peers tagged with TAG
--peer NAME, -p NAME``Consider only workloads running on peer named NAME
--multiple, -mUpdate multiple templates
--autoload, -aAutomatically reload modified templates without prompting
--set VAR=VALUE, -s VAR=VALUESet runtime value for a variable
--variables-file FILE, --variable-file FILE, --vf FILELoad runtime values for variables from file

Runtime variables

See Runtime variables.

restart

Restart a running workload

Flags

FlagDefaultDescription
--multiple, -mRestart multiple workloads

stop

Stop a running workload

Flags

FlagDefaultDescription
--template TEMPLATE``Name of the TEMPLATE to stop
--all, -aStop all running workloads
--tag TAG, -t TAG``Stop workloads on peers tagged with TAG
--multiple, -mStop multiple workloads

purge

Stop, remove and clean up workloads and templates

Flags

FlagDefaultDescription
--excise, -xRemove template definitions from the namespace
--all, -aPurge all running workloads
--no-confirmDon't ask for confirmation
--ignore-volumesDon't remove cloud volumes

ps

List running workloads

Flags

FlagDefaultDescription
--filter TEMPLATE, -f TEMPLATE``Filter by TEMPLATE name
--local, -lShow only local workloads
--all, -aShow all workloads with any status (stopped etc.)
--tag TAG, -t TAG``Filter by TAG
--peer NAME, -p NAME``Filter by peer NAME

stats

Print CPU, memory and disk used by workload(s)

Flags

FlagDefaultDescription
--all, -aShow stats for all running workloads

do

Run an action from a running workload

exec

Execute command in a container

Flags

FlagDefaultDescription
--container ID, -c ID``Container ID
--peer, -p``Peer ID or NAME
--interactive, -iStart interactive session with pseudo-TTY

shell

Open an interactive shell in a container; alias for monk exec -i [RUNNABLE] /bin/sh

Flags

FlagDefaultDescription
--container ID, -c ID``Container ID
--peer, -p``Peer ID or NAME
--shell SHELL, -b SHELL/bin/shPath to SHELL to run inside container

logs

Aliases: log

Print log stream from a running container

Flags

FlagDefaultDescription
--follow, -fPrint the log continuously
--container ID, -c ID``Container ID
--peer ID, -p ID``Peer ID
--last N, -l N10Print N last lines of the log
--tail, -tPrint 10 last lines of the log, equivalent to -l 10
--all, -aPrint logs from all running containers at the same time

port-forward

Forward local port to a running container

Flags

FlagDefaultDescription
--container ID, -c ID``Container ID
--peer ID, -p ID``Peer ID

registry

Aliases: docker-login

Add a container registry

Flags

FlagDefaultDescription
--username, -l, -e, -u``Username
--password, -p``Password
--server URL, -s URL``Registry URL

tutorial

Start the MonkOS interactive tutorial

Flags

FlagDefaultDescription
--exit, -e, -xExit the tutorial

gui

Start, upgrade or stop MonkOS GUI

Flags

FlagDefaultDescription
--start
--stop
--update
--port PORT44004Listen on PORT

status

Print MonkOS's status

version

Print versions of this CLI and connected daemon

cluster

Aliases: c, cloister

Set up and manage clusters

new

Create a new cluster

Flags

FlagDefaultDescription
--name, -n``Name for the new cluster
--link, -lStore cluster Monkcode in your MonkOS account

grow

Provision and connect new peers to current cluster

Flags

FlagDefaultDescription
--provider CLOUD, -p CLOUD``The CLOUD to provision instances on: GCP, AWS, Azure or DigitalOcean
--name, -n``Instance name
--tag TAG, -t TAG``Tag new instances with TAG
--instance-type, -i``Instance type
--region, -r``Instance region
--zone, -z``Instance zone (GCP only)
--disk-size, -d0Disk Size (in GBs)
--num-instances NUMBER, -m NUMBER0Provision NUMBER instances
--grow-timeout TIMEOUT10Wait for TIMEOUT minutes before failing (must be more than 10)
--security-key-pair NAME, --kp NAME``Security key-pair NAME (AWS and DigitalOcean only)

shrink

Remove idle peers from current cluster

Flags

FlagDefaultDescription
--force, -fDon't ask for confirmation

join

Aliases: switch

Join a cluster, or switch current cluster

Flags

FlagDefaultDescription
--name NAME, -n NAME``Target cluster NAME
--password PASSWORD, -p PASSWORD``Target cluster PASSWORD
--peers MULTIADDRS, -b MULTIADDRS``Target cluster node MULTIADDRS
--monkcode MONKCODE, -m MONKCODE``Target cluster MONKCODE

exit

Exit from current cluster into local-only mode

Flags

FlagDefaultDescription
--no-confirm, --force, -fDon't ask for confirmation

nuke

Tear down current cluster removing all resources

Flags

FlagDefaultDescription
--force, -fDon't ask for confirmation
--verbose, -iShow list of cloud resources which will be removed
--email, -l, -e, -u``Email address
--password, -p``Password
--ignore-volumes, -vDon't remove existing cloud volumes

info

Print information about current cluster

peers

List peers in current cluster

Flags

FlagDefaultDescription
--order, -snameorder peers (valid options: name, tag, provider, containers)
--name, -n``filter peers by name
--tag, -t``filter peers by tag
--provider, -p``filter peers by provider
--active, -afilter only active peers

volumes

List cloud volumes attached to current cluster

balancers

List cloud balancers attached to current cluster

providers

List cloud providers installed in current cluster

stats

List resource usage by peer

Flags

FlagDefaultDescription
--json, -jprint as raw json

peer-duplicate

Provision and connect a new peer based on existing one

Flags

FlagDefaultDescription
--id, -i``Peer ID or NAME create duplicate
--name NAME, -n NAME``NAME for the new peer
--tag TAG, -t TAG``Tag the new peer with TAG

peer-remove

Terminate and remove peer(s) from current cluster

Flags

FlagDefaultDescription
--id, -i``ID or NAME of the peer to terminate
--tag TAG, -t TAG``Terminate all peers tagged with TAG
--force, -fTerminate even if running containers are present

peer-tags

Aliases: peer-tag

Edit tags on a peer

Flags

FlagDefaultDescription
--id ID, -i ID``Peer ID to edit
--tag TAGS, -t TAGS``Comma separated TAGS to tag the peer with

cloud-resources

List cloud resources of the cluster

Flags

FlagDefaultDescription
--provider CLOUD, -p CLOUD``The CLOUD: GCP, AWS, Azure or DigitalOcean

snapshots

List snapshots for given provider

Flags

FlagDefaultDescription
--provider NAME, -p NAME``Provider NAME: GCP, AWS, Azure or Digitalocean

provider

Aliases: p

Manage cloud providers

user

Aliases: u

Manage users and their access

add

add cluster user(s)

Flags

FlagDefaultDescription
--email, -e``Email

remove

remove cluster user(s)

Flags

FlagDefaultDescription
--email, -e``Email

list

list cluster users

system

Aliases: s

Manage and debug MonkOS internals (be careful!)

logs

Aliases: log

Print monkd logs from a specified peer

Flags

FlagDefaultDescription
--follow, -fPrint the log continuously
--last N, -l N0Print N last lines of the log
--tail, -tPrint 10 last lines of the log, equivalent to -l 10

jobs

get list of jobs

Flags

FlagDefaultDescription
--order, -onameorder jobs (valid options: id, title, status, peer, started,ended)
--all, -aPrint all jobs including inactive
--title TITLE, -t TITLE``Filter by job TITLE
--status STATUS, -s STATUS``Filter by job STATUS (idle, running, failed, success, cancelled)
--peer, -p``Filter by peer name or id

events

List events

Flags

FlagDefaultDescription
--event, -e``Filter by EVENT-TYPE
--peer-id``Filter by PEER-ID

ns-list

List the contents of a namespace

Flags

FlagDefaultDescription
--depth, -d2147483647Max depth of the tree

ns-get

Get a value from namespace

down

Aliases: bye

Stop monkd on this machine

up

Aliases: hi

Launch monkd on this machine

upgrade

Aliases: update

Upgrade MonkOS on selected node(s)

Flags

FlagDefaultDescription
--peer-id, -p, --peer``Upgrade a specific node with PEER-ID
--full, -fUpgrade all nodes in the cluster
--version, -c, --custom, -vUpgrade to a specific VERSION
--local, -lUpgrade only this node
--url, -u``Url to archive containing a specific version

consensus

Aliases: consensus-info

Print consensus state for debugging

help

Aliases: h

Shows a list of commands or help for one command

Usage

monk help [OPTIONS] [COMMAND]
Rate this page