Skip to main content

A SMERSH command-line client

Project description

smersh-cli

smersh-cli is a command line client for the SMERSH API fully written in Python. It is an easy to use interactive command line made with CRUD in mind.

Usage

To run smersh-cli, you simply have to invoke the main.py script with your SMERSH API url has single argument:

python main.py <smersh api url>

You will then be asked to enter your credentials before having an interactive command line interface (see below for an example).

Example of a smersh-cli session

Commands

smersh-cli implements every single builtin cmd2 command (see the cmd2 documentation for more information about these commands). However, please think twice before using commands like py or ipy because you can easily break something.

In addition to these commands, smersh-cli implements the following ones:

  • show
  • use
  • assign
  • save
  • delete
  • exit

Please note that every command is documented. The documentation can be shown with the help command.

Commands and contexts

Some commands require a 'context' to be used. This is the case for the assign, save and delete commands. A context is used to tell the program about which object the operation you want to perform refers to. To change the context you need to use the use command. You can see at any time which context is active thanks to the prompt of the interactive command line. In order to exit the active context, use the exit command (warning: every unsaved modification will be lost).

Installation

Via Docker

This project includes a Dockerfile that you can build using the following command:

cd <project folder>
docker image build -t smershcli:v1.0 .

Once the image is built, you can simply run smersh-cli using the following command:

docker run -it <container id> <smersh api url>

Via Pip

You can also install the latest release directly from PyPI using the following command:

pip install smersh_cli

Manually

smersh-cli requires at least Python 3.5 because of the usage of typing (see PEP 484 for more information). However, we recommend Python 3.8 to avoid using a hack to get the project working (see issue #12). If you have an older Python version, you will need to upgrade as we won't support any version below 3.5.

smersh-cli also depends on the following libraries:

  • rich
  • cmd2
  • requests
  • dataclasses_json
  • pydantic
  • importlib_metadata

If you have setuptools installed you can use the following command to install all dependencies and the package at once:

python setup.py install

You can then use smersh-cli simply by using the command smersh-cli.

License

This license has no yet been chosen. We will update this section when we know which license to use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smersh_cli-0.1.dev1.tar.gz (198.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smersh_cli-0.1.dev1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file smersh_cli-0.1.dev1.tar.gz.

File metadata

  • Download URL: smersh_cli-0.1.dev1.tar.gz
  • Upload date:
  • Size: 198.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for smersh_cli-0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 b5fa8effb03232c32d02237e422c09cd7d01fae2099f7db52a20006ebe44482a
MD5 40ac4c2f54c0643dd3192494fd6239b3
BLAKE2b-256 e824ce2895aca3b513e1c03ec0f25418ce9e61182217b1cf0cbc2f67480ceb70

See more details on using hashes here.

File details

Details for the file smersh_cli-0.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: smersh_cli-0.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for smersh_cli-0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 b629283c6012d50fdd7bfd6b2e701e2ea19ea28bf48c2682d5116c6d8e42b840
MD5 8c708d33d38ec9dd3343123260ee9caf
BLAKE2b-256 c7da71475a44f443d4fb42a066695aa31d3db45751621dc60106583d3fa12d66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page