Coder Social home page Coder Social logo

elliot40404 / cli2cloud Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 17.33 MB

A command line utility written in go to pipe stdout to a web interface

Home Page: https://cli2cloud.herokuapp.com/

License: MIT License

HTML 3.32% Vue 39.90% CSS 3.61% JavaScript 31.45% Shell 1.33% Go 20.39%
golang vue node socket-io cli linux

cli2cloud's Introduction

CLI2CLOUD - pipe stdout to web

GitHub release (latest by date) GitHub Workflow Status GitHub Repo stars GitHub repo size

      _ _ ____      _                 _
  ___| (_)___ \ ___| | ___  _   _  __| |
 / __| | | __) / __| |/ _ \| | | |/ _` |
| (__| | |/ __/ (__| | (_) | |_| | (_| |
 \___|_|_|_____\___|_|\___/ \__,_|\__,_|

cli2cloud - A command line utility to pipe stdout to a web interface
Version: 0.1.0

Web interface

https://cli2cloud.herokuapp.com/

Installation

Clone the repo

git clone https://github.com/elliot40404/cli2cloud
cd cli2cloud/cli
go install
# The binaries are also available in the bin directory

or

Direcly download the binary for linux with curl or wget

  wget https://github.com/elliot40404/cli2cloud/releases/latest/download/c2c
  curl -L -o c2c https://github.com/elliot40404/cli2cloud/releases/latest/download/c2c
  chmod +x c2c
  sudo ln -s $(pwd)/c2c /usr/local/bin/c2c

Direcly download the binary for windows

Windows-Binary

Checkout all releases

Releases

Usage

1. Download/Build the binary and add it to your PATH

2. When using for the first time run c2c

This should generate a 8 character long key.

$ c2c
No key found
Creating new key...
Created key: 4MQrxK9p

3. Now if you run c2c again it should show the key along with the instructions

$ c2c
Cli-2-Cloud
A command line interface for piping output to web
Key: 4MQrxK9p
Web-UI: https://cli2cloud.herokuapp.com/4MQrxK9p
Version: 0.1.0
Usage:
    $ command | c2c     - pipe stdout to web
    $ command | c2c -q  - pipe stdout to web quite mode
    $ c2c           - print this help menu
                      also generates a new key if none exists

4. Now you can use the key to pipe the output to the web

Open up a browser and go to https://cli2cloud.herokuapp.com/#/cli?id=<key>

5. Pipe the stdout to the web

echo "Hello World" | c2c

5. Pipe the stdout and stderr to the web

echo "Hello World" |& c2c

5. Pipe the stderr to the web

echo "Hello World" 2>&1 >/dev/null | c2c

Advanced Usage

Continous Mode

Put this snippet in a file. I am calling mine term.sh

#!/bin/bash
while true
do
  read -p "$USER@c2c in $(basename $PWD)\$ " p
  $p |& c2c -q
done
sudo chmod +x term.sh
sudo ./term.sh

This should run the command in a loop and give you a terminal like interface and piping to the web withouth the need to pipe.

This is in no way an actual terminal interface. It is just a way/hack to pipe to the web without the need to pipe every command. This lacks basic terminal features like history and tab completion, ability backout of a dir. But it is a start.

cli2cloud web interface

I am working on an actual way to pipe stdout and stderr with the actual terminal interface.

Screenshots

cli2cloud web interface cli2cloud web interface

Default example

cli2cloud cli interface

Passing the -q flag to c2c will not print the url

cli2cloud cli interface

NOTE: Your key is stored in the ~/c2c.dat file. If you want to change the key you can delete the file and run c2c again.

License

MIT

cli2cloud's People

Contributors

elliot40404 avatar

Stargazers

Craig Conway avatar Victor Polo de Gyves avatar

Watchers

 avatar

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.