Welcome to
Help Desk

Product Updates
Training
Support
Ideas Contact Support

Mac Command Line Interface for Desktop App

The Desktop App 3.3.0 for Mac comes with a brand new Mac Command Line Interface (CLI) for Egnyte Admins and users. The CLI can be used to add, reconfigure, remove drives, setup Connected Folders, mark or unmark folders for offline access, adjust proxy settings, and more. It's easy and scriptable! Get started by opening your Terminal and typing in egnytecli.  

Commands 

egnytecli is self-documenting. Run egnytecli for a list of supported commands. You can also see them below.

Screen_Shot_2019-07-19_at_6.09.20_PM.png

Available Commands:
  + drives             drives operations like connect/disconnect/add/remove a drive 
  + uploads            information from uploading files like recently uploaded and skipped
  + offline            offline folders operations like mark/unmark folders for offline
  + connected-folders  setup Connected Folders
  + proxy              proxy settings
  + logs               turn on debug logging
+ settings modify Desktop app settings

At each sub-level command, type -- in the end to get additional documentation to guide you to the appropriate actions.

egnytecli drives add egnyte --

Screen_Shot_2019-05-10_at_1.42.09_PM.png 

This example below will launch the UI to add a new drive and configure the drive with these following parameters:

  • Drive label: Acme
  • Domain: thoangfiles
  • Username: thoang
  • Cloud start path: /Shared/
egnytecli drives add Acme --domain thoangfiles --username thoang --cloudStartPath /Shared/ --openSession

y86ZDquL8q.gif

Here is a different example to sync a local folder Documents with another folder on Egnyte.

egnytecli connected-folders add egnyte ~/Documents /Private/::egnyte_username::/Documents

 M2ryU4Ew4V.gif

CLI commands introduced to have control over setting Egnyte as a default handler.

egnytecli settings double-click show

Shows the status of the setting.

egnytecli settings double-click enable

Sets Egnyte as a default handler for MS Office files (default option).

egnytecli settings double-click disable

Unregisters Egnyte as a default handler for MS Office files.

If collaborative editing is enabled for the domain running following command will result in hiding double-click preferences in the configure drive view:

egnytecli settings, double-click disable 

Desktop_App_Mac_Command_Line_5.png

Troubleshoot

The default location for most application's CLI is in the /usr/local/bin folder. Sometimes, the CLI is not installed correctly due to permission issues on the bin folder in MacOS.

Egnyte CLI is installed as soon as the application starts. To verify that CLI was installed correctly, open terminal and run:

egnytecli

 If the output looks like this:

bash: egnytecli: command not found

It means that there were some issues while creating a link in the/usr/local/bin folder, which refers to the CLI binary. The most common reason for that is a lack of write permissions to the aforementioned folder. This can be verified by running the following in the terminal.

ls -l /usr/local | grep bin

 The output may look similar to:

drwxrwxr-x 99 kkapitan admin 3168 Jan 17 13:09 bin 

There are two possible cases here:

1) Incorrect Owner

The third column (in this case "kkapitan") signifies the owner of a folder, so if it differs from the user shown after typing:

whoami

It needs to be changed. One way to do that is to type (it may require an additional password. Try the one used to login to your account or contact your Administrator):

sudo chown [YOUR_USERNAME_GOES_HERE] /usr/local/bin 

 Verify if everything went correctly by typing: 

ls -l /usr/local | grep bin

The third column should now contain your username. Restart the Egnyte Connect application and the CLI tool should be installed correctly.

2) Missing Write Permissions

If the owner matches your username, it may be a case that your username lacks write permissions to that folder. To check that run:

ls -l /usr/local | grep bin

Now check the output which may look similar to:

drwxrwxr-x  99 kkapitan admin  3168 Jan 17 13:09 bin

Pay attention to the first column containing drwxrwxr-x. These letters signify the permissions to that folder.

If the first four characters of this sequence look like dr– or dr-x, it means that write permissions are missing. One way to change that is to run the following (it may require an additional password. Try the one used to login to your account or contact your Administrator):

sudo chmod u+w /usr/local/bin

 Type again:

ls -l /usr/local | grep bin

And check if the starting sequence of the first column is drwx. Restart the Egnyte Connect application and the CLI tool should be installed correctly.

Additional Note for Admins

If for any reason you'd like to change the installation path from/usr/local/bin to some other, the CLI binary is located under:

/Applications/Egnyte\ Connect.app/Contents/MacOS/EgnyteDriveCLI

You can create a symlink to this binary using:

ln -s /Applications/Egnyte\ Connect.app/Contents/MacOS/EgnyteDriveCLI [YOUR_DESIRED_LOCATION]

Keep in mind that the destination should be added to the $PATH environment variable. It can be checked by running:

echo $PATH

 

 

Was this article helpful?
0 out of 1 found this helpful

For technical assistance, please contact us.