Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Bash tab completion for cli API utilities

Mark Cunningham shared this idea 8 years ago
Open Discussion

As a sysadmin looking to maximize my interaction with the command line of the server, I would love to see the addition of bash tab complete capability with the CLI, API utilities: whmapi1, cpapi2, uapi. This would allow me to construct rich and complex API calls from the command line.


Being able to use the API more directly, and without the need to lookup each command and its options/parameters in the API documentation web pages would help me streamline my workflow by making the API more accessible in my day to day activities.

Best Answer
photo

Hey all! Internally we haven't added this capability yet, but one of our analysts has been working on this and has a post on the forums about it. Check it out here:


https://forums.cpanel.net/threads/tab-completion-for-the-api.596967/

Replies (2)

photo
1

+1

I too would make heavy use of this capability. Having to lookup all this information can be very time consuming and having something like this in place would certainly increase productivity when handling certain issues.


Example usage:


Displays a list of possible categorized functions like:

  1. $ whmapi1 <TAB>
  2. DNS: adddns addzonerecord dumpzone etc...
  3. Transfers: abort_transfer_session available_transfer_modules pause_transfer_session etc...
  4. ETC..

Displays a list of possible parameters to the current function like:

  1. $ whmapi1 abort_transfer_session <TAB>
  2. Parameter Type Description Possible values Example
  3. transfer_session_id string Required A valid string. exampleservercopya20140206192428NtyW
  4. The transfer
  5. session's ID
  6. List of active transfer sessions:
  7. exampleservercopya20140206192428NtyW1
  8. exampleservercopya20140206192428NtyW2
  9. exampleservercopya20140206192428NtyW3

This same process on all functions and parameters would be just fantastic. The above example is purely arbitrary for illustrative purposes.

photo
1

Hey all! Internally we haven't added this capability yet, but one of our analysts has been working on this and has a post on the forums about it. Check it out here:


https://forums.cpanel.net/threads/tab-completion-for-the-api.596967/

Leave a Comment
 
Attach a file