Skip to content

Commit

Permalink
Update gdrive.rst
Browse files Browse the repository at this point in the history
Copyediting
  • Loading branch information
alexryangregor authored Jun 12, 2023
1 parent 29479c3 commit 8ce7ee5
Showing 1 changed file with 51 additions and 54 deletions.
105 changes: 51 additions & 54 deletions docs/source/cli/gdrive.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
Google Drive
============


The `drive` CLI is a utility that allows managing the Google Drive account from the SEPAL console, to read the full documentation please refer to the Readme file directly in the GitHub repository https://github.com/odeke-em/drive.
The **Drive** CLI is a utility that allows managing a Google Drive account from the SEPAL console (for more information, see the Readme file directly in the GitHub repository https://github.com/odeke-em/drive).

Usage
-----

Initialize drive connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Before running any of the drive commands, you have to start a session, to do so, run the following line:
Before running any of the **Drive** commands, start a session by running the following line:

.. code-block:: bash
$ drive init
As result, an URL will be displayed in the terminal, visit it by copying and pasting it in your browser. Log-in to your Google account and, "trust the connection" by clicking the "allow" button. An authorization code will be displayed, copy it and paste it into the Sepal terminal. Now you are ready to use the :code:`drive` CLI tool.
Copy the URL that is displayed in the terminal and paste it into your browser. Log in to your Google account and "trust the connection" by selecting the "allow" button. An authorization code will be displayed; copy and paste it into the SEPAL terminal. You are now ready to use the :code:`Drive` CLI tool.

.. note::

The authorization token will expire on every session, this process has to be repeated each time you want to use the :code:`drive` command tool.
Since the authorization token will expire every session, this process has to be repeated each time you want to use the :code:`Drive` command tool.

Upload files
------------

You can upload files from your SEPAL environment by using the :code:`push` command.
You can upload files from your SEPAL environment by using the :code:`Push` command.

.. code-block:: bash
Expand All @@ -35,12 +34,10 @@ You can upload files from your SEPAL environment by using the :code:`push` comma
$ # check additional parameters by using -help flag
$ drive push -h
Download files
--------------

To download files, use the :code:`pull` command. This command will create files that doesn't exist locally but does remotely.
To download files, use the :code:`Pull` command. This command will create files that don't exist locally but do remotely.

.. code-block:: bash
Expand All @@ -50,55 +47,55 @@ To download files, use the :code:`pull` command. This command will create files
$ # check additional parameters by using -help flag
$ drive pull -h
This command will syncronize the files that are not present in your sepal session but are present in your Google Drive account folder.
This command will syncronize the files that are not present in your SEPAL session but are present in your Google Drive account folder.

Additional commands
^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
$ about # print out information about your Google drive
$ clashes # fix clashes by renaming or trashing files
$ copy # copy remote paths to a destination
$ cp # copy remote paths to a destination
$ deinit # removes the user's credentials and initialized files
$ del # deletes the items permanently. This operation is irreversible
$ delete # deletes the items permanently. This operation is irreversible
$ diff # compares local files with their remote equivalent
$ du # similar to util `du` gives you disk usage
$ edit-desc # edit the attributes of a file
$ edit-description # edit the attributes of a file
$ emptytrash # permanently cleans out your trash
$ features # returns information about the features of your drive
$ file-id # retrieve the fileId for the specified paths
$ help # Get help for a topic
$ id # retrieve the fileId for the specified paths
$ index # fetch indices from remote
$ init # initializes a directory and authenticates user
$ issue # report an issue to the project's issue tracker
$ list # lists the contents of remote path
$ ls # lists the contents of remote path
$ md5sum # prints a list compatible with md5sum(1)
$ move # move files/folders
$ mv # move files/folders
$ new # create a new file/folder
$ open # open a file in the appropriate filemanager or default browser
$ pub # publishes a file and prints its publicly available url
$ pull # pulls remote changes from Google Drive
$ push # push local changes to Google Drive
$ qr # open up the QR code for specified files
$ quota # prints out information related to your quota space
$ rename # renames a file/folder
$ report # report an issue to the project's issue tracker
$ report-issue # report an issue to the project's issue tracker
$ share # share files with specific emails giving the specified users specifies roles and permissions
$ star # star files
$ stat # display information about a file
$ touch # updates a remote file's modification time to that currently on the server
$ trash # moves files to trash
$ unpub # revokes public access to a file
$ unshare # revoke a user's access to a file
$ unstar # unstar files
$ untrash # restores files from trash to their original locations
$ url # returns the remote URL of each file
$ about # Print out information about your Google Drive.
$ clashes # Fix clashes by renaming or trashing files.
$ copy # Copy remote paths to a destination.
$ cp # Copy remote paths to a destination.
$ deinit # Removes the user's credentials and initialized files.
$ del # Deletes the items permanently. This operation is irreversible.
$ delete # Deletes the items permanently. This operation is irreversible.
$ diff # Compares local files with their remote equivalent.
$ du # Similarly to util `du`, gives you disk usage.
$ edit-desc # Edit the attributes of a file.
$ edit-description # Edit the attributes of a file.
$ emptytrash # Permanently cleans out your trash.
$ features # Returns information about the features of your Drive.
$ file-id # Retrieve the fileID for the specified paths.
$ help # Get help on a topic.
$ id # Retrieve the fileID for the specified paths.
$ index # Remotely fetch indices.
$ init # Initializes a directory and authenticates user.
$ issue # Report an issue to the project's issue tracker.
$ list # Lists the contents of a remote path.
$ ls # Lists the contents of a remote path.
$ md5sum # Prints a list compatible with md5sum(1).
$ move # Move files and folders.
$ mv # Move files and folders.
$ new # Create a new file or folder.
$ open # Open a file in the appropriate file manager or default browser.
$ pub # Publishes a file and prints its publicly available URL.
$ pull # Pulls remote changes from Google Drive.
$ push # Push local changes to Google Drive.
$ qr # Open up the QR code for specified files.
$ quota # Prints out information related to your quota space.
$ rename # Renames a file or folder.
$ report # Report an issue to the project's issue tracker.
$ report-issue # Report an issue to the project's issue tracker.
$ share # Share files with specific email addresses, giving specific users specified roles and permissions.
$ star # Star files.
$ stat # Display information about a file.
$ touch # Updates a remote file's modification time to that currently on the server.
$ trash # Moves files to trash.
$ unpub # Revokes public access to a file.
$ unshare # Revoke a user's access to a file.
$ unstar # Unstar files.
$ untrash # Restores files from trash to their original locations.
$ url # Returns the remote URL of each file.
$ version # 0.3.9

4 comments on commit 8ce7ee5

@alexryangregor
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@12rambau and @dfguerrerom:

This should be a PR draft on a separate branch. Can you please update? I will be editing the pages in phases, which will require reviewing PR drafts again before submitting the actual PRs.

Thank you!

Alex

@dfguerrerom
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @alexryangregor, the main branch wasn't protected to avoid direct pushes, I have protected it and I'm running the tests on it (with your latest changes), I hope there's nothing wrong.

@alexryangregor
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @alexryangregor, the main branch wasn't protected to avoid direct pushes, I have protected it and I'm running the tests on it (with your latest changes), I hope there's nothing wrong.

Thanks, @dfguerrerom. Only minor changes were made, mostly correcting grammatical errors, updating presentation for consistency across pages, and aligning with the style guide. I will be careful to avoid this in the future. My apologies again for any inconvenience. As @12rambau knows, I'm still new to GitHub, so if you notice anything I've done wrong, don't hesitate to let me know. I will continue editing the pages when I have breaks from more urgent tasks with the team. Thanks again!

@dfguerrerom
Copy link
Collaborator

@dfguerrerom dfguerrerom commented on 8ce7ee5 Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You committed this 8ce7ee5 directly to main branch, there was only one file modified docs/source/cli/gdrive.rst so not big deal. As mentioned before, I have protected the main branch to avoid this, and in the future, you won't be able to do that (directly modify the main branch) without a PR.

Please sign in to comment.