Introducing the new TrueNAS CLI

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
SCALE Users,

Pleased to let users of the nightly train know, that work on a new CLI interfaces has now landed in the SCALE nightly images, and will be available in the upcoming 21.02 release in the next few weeks.

So what is a CLI you may ask? Simply put, its a way from a command-line to interface directly with the TrueNAS middleware, using the same API calls which the Web interface uses. Of course a picture is worth a thousand words, and an animated picture even more-so:

cli_intro.gif


As the startup of the CLI tool indicated, this is still very early code and you should expect bugs. But we're eager to give users a sneak peak at what's coming and hope to hear your feedback as we rapidly continue development of this new tool.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,398
This is fantastic! @Kris Moore, will this be backported to Core/Enterprise? Having completion available would be a huge usability improvement from midclt calls or REST v2.0 API, where you have to keep referring to the API docs.
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
This is fantastic! @Kris Moore, will this be backported to Core/Enterprise? Having completion available would be a huge usability improvement from midclt calls or REST v2.0 API, where you have to keep referring to the API docs.

Yep, that is the intention eventually. :) We'll let it bake / mature in SCALE for a bit first, then figure out at what point we'd backport it.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,691
It will be interesting to see scripts for setting up standard configurations..... just edit specific text for unique names.
 
Last edited:

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
It will be interesting to see scripts for setting up standard configurations..... just edit specific test for uniqueness.

Yep, a lot of HOWTO / Recipes that can be copy-n-pasted are one thing we're picturing being very helpful here.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
I smell Corr... :smile: Great news, Kris! Thanks!
 

peter.m

Dabbler
Joined
Jan 1, 2021
Messages
41
That is pretty rad, reminds me unifi and cisco from the good old days. What are the planned capabilities? Also I'm guessing the normal user shell isn't getting restricted in any way?
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
That is pretty rad, reminds me unifi and cisco from the good old days. What are the planned capabilities? Also I'm guessing the normal user shell isn't getting restricted in any way?

At some point when you launch the shell on TrueNAS it'll default to the CLI. But the regular shell will be there as an option as well, or via SSH as usual. The CLI will be preferred of course, since far less ways to shoot your foot off vs just dropping somebody to zsh and seeing what happens :)
 

peter.m

Dabbler
Joined
Jan 1, 2021
Messages
41
At some point when you launch the shell on TrueNAS it'll default to the CLI. But the regular shell will be there as an option as well, or via SSH as usual.

That's good to hear

The CLI will be preferred of course, since far less ways to shoot your foot off vs just dropping somebody to zsh and seeing what happens :)

While I perfectly understand the sentiment, I'll nitpick and raise the argument that just maybe, you're selling your users short, especially once one looks at the threads that keep popping up here where they want more freedom and less hand holding :) Or maybe it's a difference in culture between FreeBSD and Linux users ¯\_(ツ)_/¯
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
That's good to hear



While I perfectly understand the sentiment, I'll nitpick and raise the argument that just maybe, you're selling your users short, especially once one looks at the threads that keep popping up here where they want more freedom and less hand holding :) Or maybe it's a difference in culture between FreeBSD and Linux users ¯\_(ツ)_/¯

Depends on the users of course. Always a place for power users to dive under the hood so to speak, but for mere mortals the more tools we can provide that give advanced functionality with less foot-shooting the better.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,691
While I perfectly understand the sentiment, I'll nitpick and raise the argument that just maybe, you're selling your users short, especially once one looks at the threads that keep popping up here where they want more freedom and less hand holding :) Or maybe it's a difference in culture between FreeBSD and Linux users ¯\_(ツ)_/¯

Everyone wants more freedom and fewer problems..... I'd also like a free lunch every day.
 

Chin-Fah HEOH

Dabbler
Joined
Dec 14, 2016
Messages
22
SCALE Users,

Pleased to let users of the nightly train know, that work on a new CLI interfaces has now landed in the SCALE nightly images, and will be available in the upcoming 21.02 release in the next few weeks.

So what is a CLI you may ask? Simply put, its a way from a command-line to interface directly with the TrueNAS middleware, using the same API calls which the Web interface uses. Of course a picture is worth a thousand words, and an animated picture even more-so:

View attachment 44794

As the startup of the CLI tool indicated, this is still very early code and you should expect bugs. But we're eager to give users a sneak peak at what's coming and hope to hear your feedback as we rapidly continue development of this new tool.

I absolutely freaking love it!!!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,455
that work on a new CLI interfaces has now landed in the SCALE nightly images
Where have we heard this before?

In seriousness, that was one of the better ideas in The Release That Must Not Be Named, though I don't think it was ever complete. Count another vote for backporting this to Core.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,599
Count me in for a CLI interface.

Guessing it can be launched from the console, which helps those with IPMI / BMC and network problems. If an admin ends up trouble shooting via normal shell, and figures out what is need, they can go back to the CLI interface to make the change. And the change will then be permanent.

I personally would make the network config, especially things like tagged VLANs or LACP, a priority. If the network is dead, the first thing someone will likely want to do is fix the network. Even if they don't have remote console access, through IPMI / BMC.


We should all be grateful no one has mentioned the actual name of "The Release That Must Not Be Named". We all have to be careful, if invoked, the CLI and potentially the whole project of TrueNAS Scale will die off too.
 
Joined
Jul 2, 2019
Messages
648
Is calling "The Release That Must Not Be Named" Lord Voldemort okay?

Seriously, though, easy access to the network setting via CLI would be great!
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,903
The first scenario that came to my mind was about user on-boarding. Like a new user needs to be created (UID perhaps needs to comply with some convention), a home directory be created (optional), and SMB access to a set of shares be granted, incl. ACL setup.
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
SCALE Users,

Pleased to let users of the nightly train know, that work on a new CLI interfaces has now landed in the SCALE nightly images, and will be available in the upcoming 21.02 release in the next few weeks.

So what is a CLI you may ask? Simply put, its a way from a command-line to interface directly with the TrueNAS middleware, using the same API calls which the Web interface uses. Of course a picture is worth a thousand words, and an animated picture even more-so:

View attachment 44794

As the startup of the CLI tool indicated, this is still very early code and you should expect bugs. But we're eager to give users a sneak peak at what's coming and hope to hear your feedback as we rapidly continue development of this new tool.


very good news !

if I may suggest : please have a deep look at the design phylosophy of the CLI on juniper devices, I had to swallow way to many cli already and their design is for me the most clear, consistent and advanced : here's some examples why

  • never work of the running config, you work on a candidate configuration :
    • automatic check of the changes before commit
    • commit can includes changes some that will cut your network connection to the device
    • possibility to commit-rollback automatically after X seconds if there is no manual confirmation (you already did that on the network configuration on truenas -> very nice feature)
    • possibility to compare commits with different versions of the configuration (running or past-running)
    • the configuration is sub-divided is different sections
      • very readable even for a first timer
      • 'entering' a section reduce the lenght of your commands ->commands don't have to be so much abbreviated -> makes it again more clear to understand
      • those sections can be temporarely 'locked' and be configured by different sysadmin simultaneously
      • can setup a very fine tuned AAA
  • you can see the configuration in a indented way (very easy to read) or in "flat way" (still readable but just copy and paste the all text file will completely reconfigure the device from scratch)
  • all (almost all) the settings are visible in the configuration, if it exists you can see it there, no hidden defaults
  • 3 types of help : basic explanations of X, command structure of X, all the commands with X
  • you can make comments

I still have my notes on this, msg me if you are interested I'll be happy to send it to you.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
I'll nitpick and raise the argument that just maybe, you're selling your users short, especially once one looks at the threads that keep popping up here where they want more freedom and less hand holding :)
I don't get you, its not "extra handholding" it's just an actually human readable way of executing commands which intends just to replace the
midclt calls we often use.


Everyone wants more freedom and fewer problems..... I'd also like a free lunch every day.
Isn't lunch included in your executive package? Really should go renegotiate Morgan ;-)


We all have to be careful, if invoked, the CLI and potentially the whole project of TrueNAS Scale will die off too.
The difference with the "The Release That Must Not Be Named " is how SCALE for a significant part is additive to the core project or reusing assets already present in the core package. The k8s thing is already solid. The only thing that could now significantly crash is the clustering of storage and to be fair: that still wouldn't kill SCALE.


Is calling "The Release That Must Not Be Named" Lord Voldemort okay?
Lord Cordamort


The first scenario that came to my mind was about user on-boarding. Like a new user needs to be created (UID perhaps needs to comply with some convention), a home directory be created (optional), and SMB access to a set of shares be granted, incl. ACL setup.
Thats mostly external systems that need to create storage/shares, thats what the API is for. This is mainly a replacement of midclt (and I guess you aren't using that for those goals, arn't you? ;-) )


never work of the running config, you work on a candidate configuration :
It's not a config editor, it's a midclt alternative/replacement. So it's also (or even mostly) used to triggering certain actions like syncs, checks etc.
 

peter.m

Dabbler
Joined
Jan 1, 2021
Messages
41
I don't get you, its not "extra handholding" it's just an actually human readable way of executing commands which intends just to replace the
midclt calls we often use.
Because that wasn't what I was referring to, but the "cli is scary" assertion by Kris. I said it's a pretty neat idea and reminds me of vyatta
 
Top