Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-user

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-user

send commands into system terminal

  • 0.1.3
  • Source
  • PyPI
  • Socket score

Maintainers
1

Ver/TestedPython Ver/Os
repo/Created Commit/Last Tests/GitHubWorkflowStatus Tests/GitHubWorkflowStatus
repo/Size Commit/Count/t Commit/Count/y Commit/Count/m

cli_user (current v0.1.3/Ver/Pypi Latest)

DESCRIPTION_SHORT

send commands into system terminal

DESCRIPTION_LONG

Designed to send commands into OS terminal

Features

  1. send commands into OS terminal
  2. check if cli commands are accessible (special utilities is installed)
  3. access to standard parts of result in a simple ready-to-use form (stdout/stderr/retcode/full state)
  4. use batch timeout for list
  5. till_first_true
  6. counter/counter_in_list

License

See the LICENSE file for license rights and limitations (MIT).

Release history

See the HISTORY.md file for release history.

Installation

pip install cli-user

Import

from cli_user import *

USAGE EXAMPLES

See tests, sourcecode and docstrings for other examples.


1. example1.py

from cli_user import *

print()
print()
print()
print()
victim = CliUser()
victim.send("ping localhost", timeout=0.1)
print()
# victim.print_state()
"""
[CLI_SEND] [ping localhost]
....
==================================================
[#####################ERROR#####################]
self.counter=1
self.counter_in_list=0
self.last_cmd='ping localhost'
self.last_duration=1.041
self.last_finished=True
self.last_finished_success=False
self.last_retcode=None
--------------------------------------------------
self.last_stdout=
	|''
	|'Обмен пакетами с starichenko.corp.element-t.ru [::1] с 32 байтами данных:'
	|'Ответ от ::1: время<1мс '
	|'Ответ от ::1: время<1мс '
	|''
--------------------------------------------------
self.last_stderr=
--------------------------------------------------
self.last_exx_timeout=Exx_CliTimeout()
==================================================
"""

print()
print()
print()
print()
victim.send(["python --version", ("ping localhost", 0.1), ])
"""
[CLI_SEND] [python --version]
.
[CLI_SEND] [('ping localhost', 0.1)]
....
==================================================
[#####################ERROR#####################]
self.counter=3
self.counter_in_list=2
self.last_cmd='ping localhost'
self.last_duration=1.042
self.last_finished=True
self.last_finished_success=False
self.last_retcode=None
--------------------------------------------------
self.last_stdout=
	|''
	|'Обмен пакетами с starichenko.corp.element-t.ru [::1] с 32 байтами данных:'
	|'Ответ от ::1: время<1мс '
	|'Ответ от ::1: время<1мс '
	|''
--------------------------------------------------
self.last_stderr=
--------------------------------------------------
self.last_exx_timeout=Exx_CliTimeout()
==================================================
[ERROR] cmd_item=('ping localhost', 0.1) in full sequence cmd=['python --version', ('ping localhost', 0.1)]
"""

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc