Skip to content

Commit

Permalink
docs: adds extensive CLI documentation
Browse files Browse the repository at this point in the history
The CLI has lacked extensive documentation for most part
and that leaves its users confused about its usage.

This commit attempts to solve that problem by adding some
elaborate docstrings to the commands with examples such
that the users can figure out things by reading it.
  • Loading branch information
pallabpain committed Oct 10, 2024
1 parent aa3f36b commit 2b79063
Show file tree
Hide file tree
Showing 149 changed files with 1,303 additions and 504 deletions.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contribution Guidelines
## Setup your development environment

The project uses [pipenv](https://pipenv.pypa.io/en/latest/) for
development. It needs to be installed to setup the development environment.

``` bash
pip install pipenv
```

Once Pipenv is installed, a Python virtual environment can be quickly
bootstrapped by running the following commands in the root of the repository.

``` bash
pipenv install --dev
```

This will create a virtual environment in the Pipenv's preconfigured location
(if one doesn't already exists). It will also install all the dependencies and
`riocli` package in the location.

To run the CLI (or any command) under the context of Pipenv's virtual
environment, prepend the commands with `pipenv run`

```bash
pipenv run rio
```

To run the RIO CLI from the source directly, you can use `riocli` module
directly.

``` bash
pipenv run python -m riocli
```

New dependencies can be installed directly using `pipenv`. This modifies the
`Pipfile` and `Pipfile.lock`.

``` bash
pipenv install {dependency}
```

But using the `pipenv` directly doesn't sync the dependencies in the
`setup.py` file. For this, the project uses a utility called `pipenv-setup`
which allows us to sync the dependencies.

``` bash
pipenv run pipenv-setup sync
```
92 changes: 29 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,61 @@
# Rapyuta CLI
# rapyuta.io CLI

Rapyuta CLI exposes features of Rapyuta.io platform on the command-line.
The rapyuta.io CLI exposes features of the rapyuta.io cloud platform on the command-line.

The application is written in Python 3 and it is distributed through PyPI for
Python 3 environments.
The application is written in Python 3, and it is distributed through PyPI for Python 3 environments.

For Reference on directory structure please refer Please have a look at the
corresponding article:
http://gehrcke.de/2014/02/distributing-a-python-command-line-application/

## Install
## Installation

Rio CLI is available on PyPI index and can be installed directly by running the
following command.
### [Recommended] Installing the `AppImage`

``` bash
pip install rapyuta-io-cli
You can install the latest `AppImage` using the following command.

```bash
curl -fSsL https://cli.rapyuta.io/install.sh | bash
```

> Note: The `AppImage` is a self-contained executable that can be run on any Linux distribution.
However, it is not supported for non-Linux systems.

### Installing via `pip`

```bash
pip install rapyuta-io-cli
```

On Unix-like systems it places the `rio` executable in the user's PATH. On
Windows it places the `rio.exe` in the centralized `Scripts` directory
which should be in the user's PATH.

### Installing from source

To install the CLI from source, you can use the `setup.py` script directly.
Clone the repository and from the root of the directory, run the following
command.

``` bash
```bash
git clone git@github.com:rapyuta-robotics/rapyuta-io-cli.git
cd rapyuta-io-cli
python setup.py install
```

## Getting Started

To begin using the CLI, it must be authenticated with the Platform.

``` bash
rio auth login
```

The Email and Password can either be given through flags (for scripting
purposes) or interactively through the Prompts.

NOTE: Entering password as a Flag is not recommended because it leaves the
Traces.
To begin using the CLI, it must be authenticated with rapyuta.io.

## Development

Rio CLI project uses [Pipenv](https://pipenv.pypa.io/en/latest/) for
development. It needs to be installed to setup the development environment.

``` bash
pip install pipenv
```

Once Pipenv is installed, a Python virtual environment can be quickly
bootstrapped by running the following commands in the root of the repository.

``` bash
pipenv install --dev
```

This will create a virtual environment in the Pipenv's preconfigured location
(if one doesn't already exists). It will also install all the dependencies and
`riocli` package in the location.

To run the CLI (or any command) under the context of Pipenv's virtual
environment, prepend the commands with `pipenv run`

```bash
pipenv run rio
```

To run the RIO CLI from the source directly, you can use `riocli` module
directly.

``` bash
pipenv run python -m riocli
rio auth login
```

New dependencies can be installed directly using `pipenv`. This modifies the
`Pipfile` and `Pipfile.lock`.
The `email` and `password` can either be given through flags (for scripting purposes) or interactively through the prompt.

``` bash
pipenv install {dependency}
```
> Note: Entering the password as a flag is not recommended because it leaves the traces.
But using the `pipenv` directly doesn't sync the dependencies in the
`setup.py` file. For this, the project uses a utility called `pipenv-setup`
which allows us to sync the dependencies.
Once set up, run `rio --help` to see the available commands.

``` bash
pipenv run pipenv-setup sync
```
## References
* [Development Guide](CONTRIBUTING.md)
Binary file removed docs/source/_static/logo-dark-mode.png
Binary file not shown.
14 changes: 14 additions & 0 deletions docs/source/_static/logo-dark-mode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/_static/logo-light-mode.png
Binary file not shown.
14 changes: 14 additions & 0 deletions docs/source/_static/logo-light-mode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/riocli-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/riocli-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import sys

project = u'rapyuta.io CLI'
project = u'CLI'
copyright = u'2024, Rapyuta Robotics'
author = u'Rapyuta Robotics'

Expand All @@ -26,8 +26,8 @@
html_favicon = 'favicon.ico'
html_static_path = ['_static']
html_theme_options = {
"light_logo": "logo-light-mode.png",
"dark_logo": "logo-dark-mode.png",
"light_logo": "logo-light-mode.svg",
"dark_logo": "logo-dark-mode.svg",
}
html_css_files = ['css/rio-sphinx.css']
html_js_files = ['js/rio-sphinx.js']
Expand Down
34 changes: 23 additions & 11 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,66 @@
Welcome to Rapyuta.io CLI documentation!
Welcome to rapyuta.io CLI documentation!
========================================

Rapyuta CLI exposes features of Rapyuta.io platform on the command-line.
The rapyuta.io CLI (aka riocli) exposes features of Rapyuta.io platform on the command-line.

The application is written in Python 3 and it is distributed through PyPI for
Python 3 environments.

Installation
--------------

It is recommended you install the latest Python SDK using pip
Installing the ``AppImage``
~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can install the latest ``AppImage`` on your Linux systems using the following command.

.. code:: bash
pip install rapyuta-io
curl -fSsL https://cli.rapyuta.io/install.sh | bash
Installing via ``pip``
~~~~~~~~~~~~~~~~~~~~~~

Rio CLI is available on PyPI index and can be installed directly by running the
following command.
Alternatively, you can install the CLI using ``pip``.

.. code:: bash
pip install rapyuta-io-cli
On Unix-like systems it places the ``rio`` executable in the user's PATH. On
Windows it places the ``rio.exe`` in the centralized ``Scripts`` directory which
should be in the user's PATH.

Installing from source
~~~~~~~~~~~~~~~~~~~~~~~

To install the CLI from source, you can use the ``setup.py`` script directly.
Clone the repository and from the root of the directory, run the following
command.

.. code:: bash
git clone git@github.com:rapyuta-robotics/rapyuta-io-cli.git
cd rapyuta-io-cli
python setup.py install
Getting Started
---------------

To begin using the CLI, it must be authenticated with the Platform.
To begin using the CLI, it must be authenticated with rapyuta.io.

.. code:: bash
rio auth login
The Email and Password can either be given through flags (for scripting
The ``email`` and ``password`` can either be given through flags (for scripting
purposes) or interactively through the Prompts.

NOTE: Entering password as a Flag is not recommended because it leaves the
Traces.
.. note::

Entering ``password`` as a flag is not recommended because it leaves the traces.

Commands
--------
Expand All @@ -66,7 +79,6 @@ Rapyuta CLI has commands for all rapyuta.io resources. You can read more about t
Device <device>
Disk <disk>
Hardware-in-Loop <hwil>
ManagedService <managedservice>
Network <network>
Organization <organization>
Package <package>
Expand Down
10 changes: 0 additions & 10 deletions docs/source/managedservice.rst

This file was deleted.

2 changes: 1 addition & 1 deletion riocli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Rapyuta Robotics
# Copyright 2024 Rapyuta Robotics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 2b79063

Please sign in to comment.