Juju has a new interactive shell.
It is available for testing in the 2.8 edge snap and upcoming 2.8.2 release candidate.
To invoke the shell, simply run juju
without any arguments. The prompt will tell you your current controller and model and who you are logged in as. You can run any Juju command, including those which require prompts, and coloured output also works as expected. There’s also support for command history search via Ctrl+R, Ctrl+S, line editing navigation via Ctrl+A and Ctrl+E etc, and other such shell key bindings.
Note: the shell currently requires at least one controller be available to work. You can bootstrap new controllers or destroy controllers from the shell, but the shell will exit if there’s no controller available.
$ juju
Welcome to the Juju interactive shell.
Type "help" to see a list of available commands.
Type "q" or ^D or ^C to quit.
admin@ctrl:mymodel$
admin@ctrl:mymodel$ controllers
Use --refresh option with this command to see the latest information.
Controller Model User Access Cloud/Region Models Nodes HA Version
ctrl* mymodel admin superuser microk8s/localhost 2 1 - 2.9-beta1
admin@ctrl:mymodel$
admin@ctrl:mymodel$ bootstrap lxd test
Creating Juju controller "test" on lxd/localhost
Looking for packaged Juju agent version 2.8.2 for amd64
No packaged binary found, preparing local Juju agent binary
Launching controller instance(s) on localhost/localhost...
- juju-6380b7-0 (arch=amd64)
Installing Juju agent on bootstrap instance
Fetching Juju Dashboard 0.2.0
Waiting for address
Attempting to connect to 10.115.246.87:22
Connected to 10.115.246.87
Running machine configuration script...
Bootstrap agent now started
Contacting Juju controller at 10.115.246.87 to verify accessibility...
Bootstrap complete, controller "test" is now available
Controller machines are in the "controller" model
Initial model "default" added
admin@test:default$
admin@test:default$ deploy mariadb
Located charm "cs:trusty/mariadb-7".
Deploying charm "cs:trusty/mariadb-7".
admin@test:default$ status
Model Controller Cloud/Region Version SLA Timestamp
default test localhost/localhost 2.8.2 unsupported 12:09:40+10:00
App Version Status Scale Charm Store Rev OS Notes
mariadb waiting 0/1 mariadb jujucharms 7 ubuntu
Unit Workload Agent Machine Public address Ports Message
mariadb/0 waiting allocating 0 waiting for machine
Machine State DNS Inst id Series AZ Message
0 pending pending trusty starting
admin@test:default$ switch
test:admin/default
admin@test:default$ switch ctrl
test:admin/default -> ctrl:admin/mymodel
admin@ctrl:mymodel$ whoami
Controller: ctrl
Model: mymodel
User: admin
admin@ctrl:mymodel$ show-model
mymodel:
name: admin/mymodel
short-name: mymodel
model-uuid: 9dcc1ecf-6ed4-4101-8a9b-4496b2a98955
model-type: caas
controller-uuid: 612965a0-fea6-449e-8a98-f0acdc161c43
controller-name: ctrl
is-controller: false
...