🖥️ A cross-platform modern shell.

Overview

Ergonomica

WARNING: master on this repository is not the same as a stable release! Currently, this software is purely experimental, as I am cleaning it up substantially after a long hiatus. However, if you find bugs, feel free to file an issue.

Ergonomica is a cross-platform shell language implemented in Python that aims to redesign the shell in a more standard, easy-to-use, and powerful way than traditional shells. It is designed as a fully-functional S-expression based language with a few traditional shell features such as flags and piping to combine the functionality of a Lisp with the convenience of the UNIX shell.

Comments
  • UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal)

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal)

    When I press space, it will throw error $ Exception in thread Thread-16: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/home/wpm/.linuxbrew/Cellar/ergonomica/1.1.4/bin/lib/prompt_toolkit/intn completions = list(buffer.completer.get_completions(document, complete_even) File "/home/wpm/.linuxbrew/Cellar/ergonomica/1.1.4/bin/lib/interface/completes for result in complete(self.verbs, document.text): File "/home/wpm/.linuxbrew/Cellar/ergonomica/1.1.4/bin/lib/interface/completee options = [i for i in options if i.startswith(last_word)] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal)

    bug 
    opened by ResolveWang 4
  • Add Python2 support

    Add Python2 support

    With python 2, ergonomica can start but does near to nothing. At prompt, all the commands produce this output:

    super() takes at least 1 argument (0 given)
    [<current directory>]
    

    Ergonomica should either refuse to be installed in python 2 environment or be fixed for python 2 compatibility (I don't notice any statement about python compatibility in the documentation).

    Works fine (ls produce a correct output) with a python 3 environment.

    (version 2.0.5 installed in virtualenv environment)

    opened by lalmeras 3
  • Compatibility with prompt_toolkit 2.0

    Compatibility with prompt_toolkit 2.0

    This should do the most important changes for compatibility with prompt_toolkit 2.0, when this is released. This will also require ptpython 2.0 and pyvim 2.0 (both are also not yet released, but will be released together with prompt_toolkit 2.0).

    In the meantime, it could be good to pin the version of both these dependencies on the 1.0 version, so that when prompt_toolkit 2.0 is released, we're not going to break stuff right away.

    opened by jonathanslenders 2
  • Become PEP8-compliant through Pylint

    Become PEP8-compliant through Pylint

    PEP8 compliance is a mixed bowl. People like Raymond Hettinger have often mentioned not only the futility of PEP8 adherence, and the fact that good code is not necessarily solely PEP8 compliant, but also the fact that PEP8 compliance can be a massive time drain, taking time away from more important tasks (writing unittests! resolving bugs and feature requests!). On the other hand, PEP8 compliance, especially partial compliance by configuration of a pylintrc, is a nice way of standardizing code style and making it easier to read, and also enforcing certain universal rules (e.g., docstrings for every function).

    opened by lschumm 2
  • Default shell handler acts strangely on Arch Pacman

    Default shell handler acts strangely on Arch Pacman

    pacman acts strangely when invoking from ergonomica. For example, when running

    sudo pacman -S noto-fonts-emoji
    

    it first returns

    [sudo] password for lschumm: 
    resolving dependencies...
    looking for conflicting packages...
    :: Proceed with installation? [Y/n] 
    Packages (1) noto-fonts-emoji-20170519-1
    
    Total Download Size:   4.36 MiB
    Total Installed Size:  4.93 MiB
    
    

    No :: Proceed with installation? [Y/n] dialog is shown. After y is pressed, the downloading message is shown many times

    downloading noto-fonts-emoji-20170519-1-any.pkg.tar.xz...
    downloading noto-fonts-emoji-20170519-1-any.pkg.tar.xz...
    downloading noto-fonts-emoji-20170519-1-any.pkg.tar.xz...
    downloading noto-fonts-emoji-20170519-1-any.pkg.tar.xz...
    downloading noto-fonts-emoji-20170519-1-any.pkg.tar.xz...
    

    pacman is still functional (as in the package is installed, dependencies are properly resolved, etc.) but makes the interface less usable.

    opened by lschumm 2
  • Rewrite Docopt

    Rewrite Docopt

    Currently Docopt is a buggy mess while the creator refuses to take any suggestions. Make a fork with a rewrite of the parser in PLY and various other features.

    opened by lschumm 2
  • Use lisp-style stringly typing

    Use lisp-style stringly typing

    Proposal

    Make Ergonomica stringly typed, like so:

    set x 2
    => sets x to string 2
    set x '2
    => sets x to number 2
    

    Purpose

    Currently, Ergonomica's namespace (being a Python dictionary) can accept any type of variables. However, given the fact that Ergonomica is stringly typed, you cannot set these outside of Python. This would allow this so the advantages of a typed language could be accessible in Ergonomica.

    Feasability

    Very Feasible; just use eval within the Ergonomica namespace.

    opened by lschumm 2
  • Resolve Pylint Confusion

    Resolve Pylint Confusion

    Some files have pylint stuff, some don't, there's a lot of errors that are ignored in almost all files that should be put in a .pylintrc file. Do this and write a description of why the errors are ignored.

    opened by lschumm 2
  • Travis CI build broken after d323e05

    Travis CI build broken after d323e05

    The log gives

    Worker information
    
    hostname: i-03bc520-precise-production-2-worker-org-docker.travisci.net:40c0c808-8220-4d15-870b-44654306af79
    
    version: v2.5.0 https://github.com/travis-ci/worker/tree/da3a43228dffc0fcca5a46569ca786b22991979f
    
    instance: 4805c94:travis:python
    
    startup: 434.916264ms
    system_info
    
    Build system information
    
    Build language: python
    
    Build group: stable
    
    Build dist: precise
    
    Build id: 203680842
    
    Job id: 203680843
    
    travis-build version: 2b04abe3b
    
    Build image provisioning date and time
    
    Thu Feb  5 15:09:33 UTC 2015
    
    Operating System Details
    
    Distributor ID:	Ubuntu
    
    Description:	Ubuntu 12.04.5 LTS
    
    Release:	12.04
    
    Codename:	precise
    
    Linux Version
    
    3.13.0-29-generic
    
    Cookbooks Version
    
    a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e
    
    GCC version
    
    gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
    
    Copyright (C) 2011 Free Software Foundation, Inc.
    
    This is free software; see the source for copying conditions.  There is NO
    
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    LLVM version
    
    clang version 3.4 (tags/RELEASE_34/final)
    
    Target: x86_64-unknown-linux-gnu
    
    Thread model: posix
    
    Pre-installed Ruby versions
    
    ruby-1.9.3-p551
    
    Pre-installed Node.js versions
    
    v0.10.36
    
    Pre-installed Go versions
    
    1.4.1
    
    Redis version
    
    redis-server 2.8.19
    
    riak version
    
    2.0.2
    
    MongoDB version
    
    MongoDB 2.4.12
    
    CouchDB version
    
    couchdb 1.6.1
    
    Neo4j version
    
    1.9.4
    
    RabbitMQ Version
    
    3.4.3
    
    ElasticSearch version
    
    1.4.0
    
    Installed Sphinx versions
    
    2.0.10
    
    2.1.9
    
    2.2.6
    
    Default Sphinx version
    
    2.2.6
    
    Installed Firefox version
    
    firefox 31.0esr
    
    PhantomJS version
    
    1.9.8
    
    ant -version
    
    Apache Ant(TM) version 1.8.2 compiled on December 3 2011
    
    mvn -version
    
    Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
    
    Maven home: /usr/local/maven
    
    Java version: 1.7.0_76, vendor: Oracle Corporation
    
    Java home: /usr/lib/jvm/java-7-oracle/jre
    
    Default locale: en_US, platform encoding: ANSI_X3.4-1968
    
    OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"
    
    fix.CVE-2015-7547
    
    $ export DEBIAN_FRONTEND=noninteractive
    
    Reading package lists...
    
    Building dependency tree...
    
    Reading state information...
    
    The following extra packages will be installed:
    
      libc-bin libc-dev-bin libc6-dev
    
    Suggested packages:
    
      glibc-doc
    
    The following packages will be upgraded:
    
      libc-bin libc-dev-bin libc6 libc6-dev
    
    4 upgraded, 0 newly installed, 0 to remove and 258 not upgraded.
    
    Need to get 8,840 kB of archives.
    
    After this operation, 14.3 kB disk space will be freed.
    
    Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc6-dev amd64 2.15-0ubuntu10.15 [2,943 kB]
    
    Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc-dev-bin amd64 2.15-0ubuntu10.15 [84.7 kB]
    
    Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc-bin amd64 2.15-0ubuntu10.15 [1,177 kB]
    
    Get:4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc6 amd64 2.15-0ubuntu10.15 [4,636 kB]
    
    Fetched 8,840 kB in 0s (31.9 MB/s)
    
    Preconfiguring packages ...
    
    (Reading database ... 72431 files and directories currently installed.)
    
    Preparing to replace libc6-dev 2.15-0ubuntu10.10 (using .../libc6-dev_2.15-0ubuntu10.15_amd64.deb) ...
    
    Unpacking replacement libc6-dev ...
    
    Preparing to replace libc-dev-bin 2.15-0ubuntu10.10 (using .../libc-dev-bin_2.15-0ubuntu10.15_amd64.deb) ...
    
    Unpacking replacement libc-dev-bin ...
    
    Preparing to replace libc-bin 2.15-0ubuntu10.10 (using .../libc-bin_2.15-0ubuntu10.15_amd64.deb) ...
    
    Unpacking replacement libc-bin ...
    
    Processing triggers for man-db ...
    
    Setting up libc-bin (2.15-0ubuntu10.15) ...
    
    (Reading database ... 72430 files and directories currently installed.)
    
    Preparing to replace libc6 2.15-0ubuntu10.10 (using .../libc6_2.15-0ubuntu10.15_amd64.deb) ...
    
    Unpacking replacement libc6 ...
    
    Setting up libc6 (2.15-0ubuntu10.15) ...
    
    Setting up libc-dev-bin (2.15-0ubuntu10.15) ...
    
    Setting up libc6-dev (2.15-0ubuntu10.15) ...
    
    Processing triggers for libc-bin ...
    
    ldconfig deferred processing now taking place
    git.checkout
    
    0.42s$ git clone --depth=50 --branch=master https://github.com/ergonomica/ergonomica.git ergonomica/ergonomica
    
    Cloning into 'ergonomica/ergonomica'...
    
    remote: Counting objects: 718, done.
    
    remote: Compressing objects: 100% (410/410), done.
    
    remote: Total 718 (delta 329), reused 645 (delta 286), pack-reused 0
    
    Receiving objects: 100% (718/718), 702.25 KiB | 0 bytes/s, done.
    
    Resolving deltas: 100% (329/329), done.
    
    Checking connectivity... done.
    
    $ cd ergonomica/ergonomica
    
    $ git checkout -qf d323e055fd9aa6d604d33a80e1145394c468080e
    
    This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.
    
    If you require sudo, add 'sudo: required' to your .travis.yml
    
    See https://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
    
    0.00s$ source ~/virtualenv/python2.7/bin/activate
    
    $ python --version
    
    Python 2.7.9
    
    $ pip --version
    
    pip 6.0.7 from /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (python 2.7)
    install
    
    2.57s$ pip install -r requirements.txt
    
    Requirement already satisfied (use --upgrade to upgrade): pytest in /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (from -r requirements.txt (line 1))
    
    Collecting ptpython (from -r requirements.txt (line 2))
    
      Downloading ptpython-0.36-py2-none-any.whl (46kB)
    
        100% |################################| 49kB 4.4MB/s 
    
    Collecting pyflakes (from -r requirements.txt (line 3))
    
      Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
    
        100% |################################| 225kB 2.6MB/s 
    
    Collecting pyvim (from -r requirements.txt (line 4))
    
      Downloading pyvim-0.0.20-py2-none-any.whl (42kB)
    
        100% |################################| 45kB 2.3MB/s 
    
    Collecting colorama (from -r requirements.txt (line 5))
    
      Downloading colorama-0.3.7-py2.py3-none-any.whl
    
    Requirement already satisfied (use --upgrade to upgrade): py>=1.4.25 in /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (from pytest->-r requirements.txt (line 1))
    
    Collecting jedi>=0.9.0 (from ptpython->-r requirements.txt (line 2))
    
      Downloading jedi-0.10.0-py2.py3-none-any.whl (186kB)
    
        100% |################################| 188kB 2.2MB/s 
    
    Collecting docopt (from ptpython->-r requirements.txt (line 2))
    
      Downloading docopt-0.6.2.tar.gz
    
    Collecting pygments (from ptpython->-r requirements.txt (line 2))
    
      Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
    
        100% |################################| 843kB 653kB/s 
    
    Collecting prompt-toolkit<2.0.0,>=1.0.0 (from ptpython->-r requirements.txt (line 2))
    
      Downloading prompt_toolkit-1.0.13-py2-none-any.whl (247kB)
    
        100% |################################| 249kB 2.2MB/s 
    
    Collecting six>=1.9.0 (from prompt-toolkit<2.0.0,>=1.0.0->ptpython->-r requirements.txt (line 2))
    
      Downloading six-1.10.0-py2.py3-none-any.whl
    
    Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->ptpython->-r requirements.txt (line 2))
    
      Downloading wcwidth-0.1.7-py2.py3-none-any.whl
    
    Installing collected packages: wcwidth, six, prompt-toolkit, pygments, docopt, jedi, colorama, pyvim, pyflakes, ptpython
    
      Running setup.py install for docopt
    
    Successfully installed colorama-0.3.7 docopt-0.6.2 jedi-0.10.0 prompt-toolkit-1.0.13 ptpython-0.36 pyflakes-1.5.0 pygments-2.2.0 pyvim-0.0.20 six-1.10.0 wcwidth-0.1.7
    
    0.01s$ mkdir /home/travis/.ergo
    
    The command "mkdir /home/travis/.ergo" exited with 0.
    
    0.00s$ mkdir /home/travis/.ergo/packages
    
    The command "mkdir /home/travis/.ergo/packages" exited with 0.
    
    0.00s$ touch /home/travis/.ergo/.ergo_profile
    
    The command "touch /home/travis/.ergo/.ergo_profile" exited with 0.
    
    0.00s$ touch /home/travis/.ergo/.ergo_history
    
    The command "touch /home/travis/.ergo/.ergo_history" exited with 0.
    
    0.30s$ python -m unittest discover
    
    ]2;ergonomica[ergo: ArgumentError] Use the -s argument to run strings.
    
    E.......................
    
    ======================================================================
    
    ERROR: test_addline (tests.test.TestStringMethods)
    
    ----------------------------------------------------------------------
    
    Traceback (most recent call last):
    
      File "/home/travis/build/ergonomica/ergonomica/tests/test.py", line 68, in test_addline
    
        ergo('addline "TESTING this feature\n" "once again testing this feature" {file:"test-addline"}')
    
      File "/home/travis/build/ergonomica/ergonomica/ergonomica/ergo.py", line 102, in ergo
    
        return map(ergo, get_code_blocks(stdin))
    
      File "/home/travis/build/ergonomica/ergonomica/ergonomica/ergo.py", line 218, in ergo
    
        stdout = [handle_runtime_error(blocks[i], error)]
    
      File "/home/travis/build/ergonomica/ergonomica/ergonomica/lib/lang/error_handler.py", line 48, in handle_runtime_error
    
        raise error
    
    ErgonomicaError: [ergo: ArgumentError]: No file set for addline.
    
    ----------------------------------------------------------------------
    
    Ran 24 tests in 0.025s
    
    FAILED (errors=1)
    
    The command "python -m unittest discover" exited with 1.
    
    Done. Your build exited with 1.
    
    bug 
    opened by lschumm 2
  • install with brew on macOS Sierra fails

    install with brew on macOS Sierra fails

    Here is the last few lines of the install output

    ==> Installing mtklabs/tap/ergonomica 
    ==> Cloning https://github.com/ergonomica/ergonomica.git
    Cloning into '/Users/petar/Library/Caches/Homebrew/ergonomica--git'...
    remote: Counting objects: 101, done.
    remote: Compressing objects: 100% (85/85), done.
    remote: Total 101 (delta 20), reused 46 (delta 10), pack-reused 0
    Receiving objects: 100% (101/101), 121.86 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (20/20), done.
    ==> Checking out branch master
    Error: No such file or directory - lib/lib/version.py
    
    opened by pshomov 2
  • No module named pyvim.entry_points.run_pyvim

    No module named pyvim.entry_points.run_pyvim

    Installed on OSX as per instructions

    Get the error:

    Traceback (most recent call last):
      File "/usr/local/bin/ergonomica.py", line 55, in <module>
        from lib.lang.error_handler import handle_runtime_error
      File "/usr/local/Cellar/ergonomica/1.1.3/bin/lib/lang/error_handler.py", line 20, in <module>
        from lib.load.load_commands import verbs
      File "/usr/local/Cellar/ergonomica/1.1.3/bin/lib/load/load_commands.py", line 23, in <module>
        from lib.lib import verbs
      File "/usr/local/Cellar/ergonomica/1.1.3/bin/lib/lib/__init__.py", line 22, in <module>
        verbs.update(__import__('lib.lib.'+item, globals(), locals(), ['object'], 0).verbs)
      File "/usr/local/Cellar/ergonomica/1.1.3/bin/lib/lib/edit.py", line 36, in <module>
        from pyvim.entry_points.run_pyvim import run
    ImportError: No module named pyvim.entry_points.run_pyvim
    

    Tried installing pyvim at version 0.0.20 but still no luck.

    opened by funkotron 2
  • Migrate to Click for argument parsing

    Migrate to Click for argument parsing

    I use Click for all of my command-line stuff these days. Docopt is nice in that it's better than parsing the arguments manually, but Click is just a lot cleaner and allows for some cool verification functionality. Command-line usage specifications in text kind of adhere to a standard, but they're not as standardized and flexible as Click's decorator approach.

    Writing this for the sake of documentation as well as refreshing my understanding:

    • All Ergonomica commands are structured as individual files, with command-line argument handling. However, these are interpreted as Python files, and we peel out the functions so we can call them in the same Python interpreter (so we can pass Python data structures into them). We build up a namespace of these commands.
    • When you call a command that is found in Ergonomica's library, we'll pretend it's being called from the command line, and thus utilize argument parsing/verification.

    Hopefully Click will have some facilities with which I can more cleanly call Click-decorated functions from within Python, instead of needing to manipulate sys.argv.

    opened by hexdump 0
xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

xonsh xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.6+ with additio

xonsh 6.7k Jan 8, 2023
Kubernetes shell: An integrated shell for working with the Kubernetes

kube-shell Kube-shell: An integrated shell for working with the Kubernetes CLI Under the hood kube-shell still calls kubectl. Kube-shell aims to provi

CloudNative Labs 2.2k Jan 8, 2023
(BionicLambda Universal SHell) A simple shell made in Python. Docs and possible C port incoming.

blush ?? (BionicLambda Universal SHell) A simple shell made in Python. Docs and possible C port incoming. Note: The Linux executables were made on Ubu

null 3 Jun 30, 2021
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
ICMP Reverse Shell written in Python 3 and with Scapy (backdoor/rev shell)

icmpdoor - ICMP Reverse Shell icmpdoor is an ICMP rev shell written in Python3 and scapy. Tested on Ubuntu 20.04, Debian 10 (Kali Linux), and Windows

Jeroen van Kessel 206 Dec 29, 2022
iTerm2 Shell integration for Xonsh shell.

iTerm2 Shell Integration iTerm2 Shell integration for Xonsh shell. Installation To install use pip: xpip install xontrib-iterm2 # or: xpip install -U

Noorhteen Raja NJ 6 Dec 29, 2022
The project help you to quickly build layouts in terminal,cross-platform

The project help you to quickly build layouts in terminal,cross-platform

gojuukaze 133 Nov 30, 2022
liquidctl – liquid cooler control Cross-platform tool and drivers for liquid coolers and other devices

Cross-platform CLI and Python drivers for AIO liquid coolers and other devices

null 1.7k Jan 8, 2023
Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems.

Baselining, on steroids! Baseline is a cross-platform library and command-line utility that creates file-oriented baselines of your systems. The proje

Nelson 4 Dec 9, 2022
TUIFIManager - A cross-platform terminal-based file manager

TUIFI Manager A cross-platform terminal-based file manager (and component), mean

null 142 Dec 26, 2022
adds flavor of interactive filtering to the traditional pipe concept of UNIX shell

percol __ ____ ___ ______________ / / / __ \/ _ \/ ___/ ___/ __ \/ / / /_/ / __/ / / /__/ /_/ / / / .__

Masafumi Oyamada 3.2k Jan 7, 2023
Fetch is use to get information about anything on the shell using Wikipedia.

Fetch Search wikipedia article on command line [Why This?] [Support the Project] [Installation] [Configuration] Why this? Fetch helps you to quickly l

Yash Singh 340 Dec 18, 2022
A simple reverse shell in python

RevShell A simple reverse shell in python Getting started First, start the server python server.py Finally, start the client (victim) python client.py

Lojacopsen 4 Apr 6, 2022
a-shell: A terminal for iOS, with multiple windows

a-shell: A terminal for iOS, with multiple windows

Nicolas Holzschuch 1.7k Jan 2, 2023
A simple python implementation of a reverse shell

llehs A python implementation of a reverse shell. Note for contributors The project is open for contributions and is hacktoberfest registered! llehs u

Archisman Ghosh 2 Jul 5, 2022
Just a shell writed on Python

HIGHSHELL (also hSH or HS) Just a shell writed on Python Send bug report • How to use the shell • Broked features • Licenses How to use the shell Inst

0LungSkill0 2 Jan 4, 2022
A Reverse Shell Python Packages

A Reverse Shell Python Packages

null 1 Nov 3, 2021
The Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the targetPythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Boy From Future 15 Sep 16, 2022