Skip to main content

Galaxie Shell is a autonomous shell ready for CI and low tech OS

Project description

https://codecov.io/gl/Tuuux/galaxie-shell/branch/master/graph/badge.svg?token=MK6WWGAL5M Documentation Status

GLXSH - Galaxie Shell

https://galaxie-shell.readthedocs.io/en/latest/_images/logo_galaxie.png

Make you own thing !!!

Galaxie Shell is a Reliable Event Logging Protocol (RELP) write with python based on top of cmd2 it self build on top of python builtins cmd.

The project provide a application class name GLXShell oriented unix SHELL. The goal is to permit everyone to start they own project around a SHELL as UI.

The Galaxie Shell use a plugin name builtins plugin it try to integrate python version of GNU Core Utils command’s set.

All ready implemented features

  • History files respect the Freedesktop requirements

  • All unknown command’s are send to the sub shell system

  • Capability to build a one-file static binary file

  • Can load a script file as argument

  • Can execute command from passing arguments

  • Interactive shell when call without arguments

  • Plugins Manager

  • Builtins Plugin (arch, cat, cd, mkdir, pwd, rmdir, uname, which, etc …)

  • Permit to start you own project with the GLXShell class

Application

Installation via pip

pip install galaxie-shell

Installation via pip (test)

pip install -i https://test.pypi.org/simple/ galaxie-shell

Next Step:

Now you can the start the glxsh entry point

$> glxsh
******************************* GLXSHELL V0.2 *******************************


GNU GENERAL PUBLIC LICENSE V3 OR LATER (GPLV3+)
LOADER #1 SMP DEBIAN 4.19.146-1 (2020-09-17)
EXEC (VENV) PYTHON 3.7.3
31.36GB RAM SYSTEM
18.29GB FREE
NO HOLOTAPE FOUND
LOAD PLUGINS(1): BUILTINS 0.2A

(venv) user@host:~/galaxie-shell $
>

or use the python package

#!/usr/bin/env python

import os
import sys
import argparse

from GLXShell.libs.shell import GLXShell

def main(argv=None):
    """Run when invoked from the operating system shell"""

    glxsh_parser = argparse.ArgumentParser(description="Commands as arguments")
    glxsh_parser.add_argument(
        "command",
        nargs="?",
        help="optional commands or file to run, if no commands given, enter an interactive shell",
    )
    glxsh_parser.add_argument(
        "command_args",
        nargs=argparse.REMAINDER,
        help="if commands is not a file use optional arguments for commands",
    )

    args = glxsh_parser.parse_args(argv)

    shell = GLXShell()
    shell.name = "supershell"
    shell.version = "0.1a"
    shell.authors = ["authors1"]
    shell.license = "WTFPL v2 - https://en.wikipedia.org/wiki/WTFPL"
    shell.description = "SuperShell example"

    sys_exit_code = 0
    if args.command:
        if os.path.isfile(args.command):
            # we have file to execute
            shell.onecmd_plus_hooks("@{command}".format(command=args.command))
        else:
            # we have a commands, run it and then exit
            shell.onecmd_plus_hooks(
                "{command} {args}".format(
                    command=args.command, args=" ".join(args.command_args)
                )
            )

    else:
        # we have no commands, drop into interactive mode
        sys_exit_code = shell.cmdloop()

    return sys_exit_code


if __name__ == "__main__":
    sys.exit(main())

Builtins Plugin implemented implemented command’s

  • arch

  • cat

  • cd

  • mkdir

  • pwd

  • rmdir

  • uname

  • which

Roadmap

  • implement the core util’s

  • plugins installation system based on pip

  • permit && and ||

  • deal with env and export

  • deal with exit code

  • better one-file binary distribution

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

galaxie-shell-0.2.tar.gz (28.9 kB view hashes)

Uploaded Source

Supported by

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