Code Monkey home page Code Monkey logo

pywebsh's Introduction

๐Ÿ pywebsh

A small command-line websh client written in Python

Features

  • Run shell command without huge Docker image
  • Save the execution result images
  • Open execution result images with your default browser
  • Upload local images

Usage

usage: pywebsh [-h] [-v] [-o] [-i IMAGES] code

positional arguments:
  code                  code to execute on websh

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         output verbose information
  -o, --open            open execution result images with your default browser
  -i IMAGES, --images IMAGES
                        images to upload

Examples

Run commands

Just specify the command you want to execute in the first argument.

$ pywebsh 'uname -a'
Linux efa5b0542de5 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Save (then Open) execution result images

To save images, output the image files to /images/ on the websh environment. When the -o / --open flag is enabled, the saved image will open in your system's default browser.

$ pywebsh --open 'screenfetch | textimg -o /images/out.png'

Upload local images

You can upload and use local images. If you specify the image path in the -i / --images option and execute it, it will be saved in 0, 1, ... files under the /media/ directory on the websh environment.

$ pywebsh --images foo.png --images bar.png 'ls -lA /media'
ๅˆ่จˆ 176
-rw-r--r-- 1 root root    908 10ๆœˆ 20 20:28 0
-rw-r--r-- 1 root root 175821 10ๆœˆ 20 20:28 1

Installation

Requires Python (testing on v3.9.7). Clone or this repository or download archive from releases page then run below:

sudo make install

License

The Unlicense

pywebsh's People

Stargazers

 avatar  avatar

Watchers

 avatar

pywebsh's Issues

`setup.py` ใ‚’ๆ›ธใ

setup.py ใ‚’ๆ›ธใ„ใฆ็ฐกๅ˜ใซใ‚คใƒณใ‚นใƒˆใƒผใƒซใงใใ‚‹ใ‚ˆใ†ใซใ™ใ‚‹ใ€‚

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.