Community discussions

MikroTik App
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 539
Joined: Wed Mar 16, 2016 6:12 am

RouterOSv7 - Terminal is substantially worse to use?

Thu Feb 01, 2024 7:22 am

Am I missing something or the terminal/cli significantly worse in V7?
The ? key does nothing, making it difficult to see all valid commands. And tab completion seems to ignore A LOT of the possible commands, i.e. typing :pi<TAB> will autocomplete it as :ping yet ignore :pick as a possibility
Same with a lot of other commands such as :to which will autocomplete to :tool and not suggest any of the other possibilities :toarray :tobool :toid :toip etc

Is this truly desired behavior? Any way to adjust how it operates? I find it awful to try writing scripts, so much so that I fall back to V6 to write 99% of a script and then use a V7 device to finalize and check syntax
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11654
Joined: Thu Mar 03, 2016 10:23 pm

Re: RouterOSv7 - Terminal is substantially worse to use?

Thu Feb 01, 2024 8:47 am

The ? key does nothing
F1 key is supposed to do the same. The problem I observed is that some terminal programs don't send proper F1 key codes so sometimes F1 works and sometimes it doesn't.

The TAB autocomplete could definitely be better, I agree with that. I guess it only autocompletes the first level of commands, so if you try :to<TAB> when in root, then it'll see tool and won't go searching in all sublevels.
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 539
Joined: Wed Mar 16, 2016 6:12 am

Re: RouterOSv7 - Terminal is substantially worse to use?

Wed Feb 07, 2024 12:38 am

The other major pain in the ass is hiding of text when pasting in passwords etc. Surely there is a way to turn this off? It makes debugging frustrating as hell as I can't see the code block I've just pasted in
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3519
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: RouterOSv7 - Terminal is substantially worse to use?

Sat Feb 10, 2024 2:53 pm

I don't think V7 is "worse" than V6. Using "?" as help key, meant that the "?" needed to be escaped if used in command (e.g. like AT command to LTE e.g. "AT+COPS?"). So borrowing the F1 from "windows" kinda make more sense (although in some terminal, or laptop keyboards, F1 isn't so easy to press.

I'm not sure what you mean about the passwords. While be nice, Mikrotik does NOT uses hashes on password export/import like Cisco/etc. There is only ":export show-sensitive"

In terms of <tab> completion... it is actually entirely deterministic, but Mikrotik makes choices on the priorities. You can actually see the selection logic using /console/inspect – highest preference wins in tab completion. If highest preference has one match, it completes. If there multiple choices, at same preference, it print choices. If there are completions at lower preference, hitting <tab><tab> (tab twice) prints the "lower priority" choices. If you change the input= below, you can check any command.
/console/inspect request=completion input=":pi" 
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE        COMPLETION  STYLE         OFFSET  PREFERENCE  SHOW  TEXT                                             
completion  pick        cmd                1  95          yes   return range of string characters or array values
completion  ping        cmd                1  96          yes   Send ICMP Echo packets                           
completion              obj-inactive       1  -20         no    unknown command                                  
completion              none               3  64          no                                                     
completion              none               3  80          no    whitespace                                       
completion              none               3  80          no    whitespace           


"ping" is WAY more common than pick, so it's a reasonable choice IMO. But issue is completion is used by "hotlock", so there you'd like want "pi" to mean ping (two letters) and not have to type three letters...

I can see this being confusing, but "ping" is pretty common command, so it's given special preference since it so common.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3519
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: RouterOSv7 - Terminal is substantially worse to use?

Sat Feb 10, 2024 3:31 pm

And one note abut the F1 / help for the parameters. Just ":pick<F1>" will show general help, so you actually need a space to see docs are the arguments — that part is annoying.

What is more annoying about F1 / help IMO is that not argument have some descriptive text — often the arg help is blank... For :pick, they do have some help:
:pick <F1>                                             

<counter> -- array or string value
<begin> -- index of the first returned element
<end> -- index of the first element that should not be returned

e.g. Note the ":pick " has the args but ":pick" just has space, so F1 will show the "arg" type's text only if there are args:
 > /console/inspect request=completion input="pick"
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE        COMPLETION  STYLE        OFFSET  PREFERENCE  SHOW  TEXT                                             
completion  pick        cmd               0          95  yes   return range of string characters or array values
completion              none              4          80  no    whitespace                                       
completion  ;           syntax-meta       4          40  no    end of command                                   

 > /console/inspect request=completion input=":pick "
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE        COMPLETION  STYLE        OFFSET  PREFERENCE  SHOW  TEXT                                                                                 
completion  !           none              6  80          no    whitespace                                                                           
completion  begin       arg               6  96          yes   index of the first returned element                                                  
completion  counter     arg               6  96          yes   array or string value                                                                
completion  end         arg               6  96          yes   index of the first element that should not be returned                               
completion              none              6  64          no                                                                                         
completion  [           syntax-meta       6  75          no    start of command substitution                                                        
completion  (           syntax-meta       6  75          no    start of expression                                                                  
completion  $           syntax-meta       6  75          no    substitution                                                                         
completion  "           syntax-meta       6  75          no    start of quoted string                                                               
completion  {           syntax-meta       6  75          no    start of array value                                                                 
completion  <value>     none              6  -1          no    literal value that consists only of digits, letters and characters -.,:<>/|+_*&^%#@!~
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: RouterOSv7 - Terminal is substantially worse to use?

Sat Feb 10, 2024 7:40 pm

Another problem with the F1 is that its mapped to system settings for the laptop.
So to get F1, you need to press FN F1 or go trough system settings and turn this off.
That may not be easy for may that have computer controlled by company and are blocking bios settings.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3519
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: RouterOSv7 - Terminal is substantially worse to use?

Sat Feb 10, 2024 7:54 pm

Ironically, always works on Mac with "fn" key. Now...let's say you can hit F1, somehow. You very quickly run into a lot of stuff that has not text describing parameters/"args".

e.g. "/interface/wifi add<F1>" – nearly all the new wi-fi setting are missing ANY text/help & that's EXACTLY where some help be useful...
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: RouterOSv7 - Terminal is substantially worse to use?

Sat Feb 10, 2024 11:17 pm

An interesting question here is how many use terminal vs gui to configure the router.
I do most config from gui when play around to test stuff.
For setting opp multiple routers, terminal is used with copy past, so do not really need all that help.
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 539
Joined: Wed Mar 16, 2016 6:12 am

Re: RouterOSv7 - Terminal is substantially worse to use?

Mon Feb 12, 2024 12:18 am

I don't think V7 is "worse" than V6. Using "?" as help key, meant that the "?" needed to be escaped if used in command (e.g. like AT command to LTE e.g. "AT+COPS?"). So borrowing the F1 from "windows" kinda make more sense (although in some terminal, or laptop keyboards, F1 isn't so easy to press.
? has been used all the way up to v6 and is used in the vast majority of routers for context sensitive help. It should not have been changed, at the very least made an option such as ctrl+shift+? to toggle its behavior, or a command that can be entered to be more script friendly

The passwords thing is this, if you include anything in a line that contains a password parameter, it completely blanks that line out. I.e. /interface wifi conf set [find] ssid=$WifiiName security.passphrase=$WifiPassword
it doesn't just blank out the password it blanks the entire line. Thus debugging is an enormous pain in the ass as you can't just scroll up and see there's a typo in there 'WifiiName' not 'WifiName'
And when trying to paste in a large code block that contains a password field it can actually block out the ENTIRE block, not just that 1 line

Again, there should absolutely be a toggle to disable this behavior. It is a nightmare to deal with when writing and pasting in scripts
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 539
Joined: Wed Mar 16, 2016 6:12 am

Re: RouterOSv7 - Terminal is substantially worse to use?

Mon Feb 12, 2024 4:07 am

An interesting question here is how many use terminal vs gui to configure the router.
I do most config from gui when play around to test stuff.
For setting opp multiple routers, terminal is used with copy past, so do not really need all that help.
UI is great for individual configuration except in the case of scripting where its not a question of 1 or the other as a preference. It's literally not possible to use the UI to do logic operations
The terminal is mandatory, and so is using it to do debugging. You can write out whatever you want initially in notepad if you so choose, but when it comes time to executing and testing? Needs to be done in MikroTik as there is no IDE I know of that supports RouterOS (wouldn't care if there was anyway, as it still needs to be properly tested on RouterOS itself)

V7 however does a really good job of making this process significantly more painful than V6, hence this thread
If i'm wrong and there's a way to remove the bubble wrap and safety tape that is getting in the way of me actually using the tools, then i'm all ears. Otherwise if a MikroTik dev glances over this thread, please for the love of god adjust the current behavior or at least add overrides

Who is online

Users browsing this forum: No registered users and 4 guests