Skip to content

Orbital Shell is a command shell based inspired by bash and POSIX recommendations, coded in C# NET 5.0

License

Notifications You must be signed in to change notification settings

OrbitalShell/Orbital-Shell

Repository files navigation

Orbital Shell

Orbital Shell is a multi-platform (windows, linux, macos, arm) command shell (according to .Net Core supported platforms and APIs compatibilities), inspired by bash and POSIX recommendations.

It provides any usual bash shell feature (even if modernized) and 'user friendly' syntaxes allowing to access (get/set/call) C# objects.

Developed using C# 8 .NET 5.0 - compatible with modules and libraries targeting .NET Core 3.1 and .NET Standard 2.1



.NET last commit releasever releasedate
openi closei closei closei
toplanguage lngcount
codesize reposize
licence mit

NuGet packages

package ID type NuGet verion ID
libraries
OrbitalShell-ConsoleApp
OrbitalShell-Kernel
OrbitalShell-Kernel-Commands
net5.0 classlib
net5.0 classlib
net5.0 classlib

NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads

modules
OrbitalShell-PromptGitInfo
OrbitalShell-DoomFireAlgo
shell module (net5.0)
shell module (net5.0)

NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads

binaries
OrbitalShell
OrbitalShell-win-x64
OrbitalShell-linux-musl-x64
OrbitalShell-linux-x64
OrbitalShell-linux-arm
OrbitalShell-linux-arm64
OrbitalShell-osx-x64
CLI any dotnet platform*
CLI WIN x86
CLI linux MUSL x64
CLI linux x64
CLI linux ARM
CLI linux ARM x64
CLI OSX x64

NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads
NuGetVersion NuGetDownloads

Docker images

image ID description link
orbitalshell/orbital-shell Linux Ubuntu amd64 https://hub.docker.com/r/orbitalshell/orbital-shell

About the project

This shell integrates the most usefull shell commands, and is intented to be extended by coding new commands or downloading new commands modules within a repository of modules. Of course it can be entirely customized by using the features integrated to the shell (scripts, functions, commands, aliases, settings, parametrization,...). Having a strong ANSI/VT-100-220-300-500 support, it provides structured and colorized display of data and information (support of ASCII, Unicode and 24 bits colors).

Find any information and documentation about this project on the project's Web Site @ Orbital SHell Git-Pages

                     

Developers and users manuals are available in the project web site @ Orbital SHell Git-Pages (documentation)


Contribute !

😄 We are looking for collaborators 👯 to help for evolving this tool ! If you like the command line, the bash syntax, programming cli tools, parsers, data streams, ANSI, C# 8, batch, and so on... you may like to develop orbital shell! Any idea, suggest, code, feedback is welcomed ! You can directly FORK the project @ https://github.com/OrbitalShell/Orbital-Shell.git and start developing to prepare your first pull request, it will be well received. You can also peek an issue and start working on. Join the orbital shell team and get advantages of the team tools on github. We can contact 💬 by mail, skype and so on...

You can directly FORK the project @ https://github.com/OrbitalShell/Orbital-Shell.git and start developing to prepare your first pull request, it will be well received. You can also peek an issue and start working on.

Join the orbital shell team and get advantages of the team tools on github. We can contact 💬 by mail, skype and so on...

Join the project:

⏩ ⏩ Join the project. You can send a mail to the project team @ mailto://[email protected] or to the maintener me

  • Curious / beginner / intermediate / expert are all welcomed!
  • A simple hello from you part and you will be welcomed and invited to join the project 👍 !
  • A simple star on the project main repo and you will also be invited 👋 !

⏩ ⏩ This project is a collaborative work, any one can participate and do anything he wishes 😎 !

There are a various subjects that can be treated:

  • .NET 5.0 (C# 8) programming
  • develop command line parser
  • develop shell commands (find,ls,grep,sed,..: add/improve any command you want!)
  • develop shell scripts (.orbsh/.sh)
  • Technical documentation
  • Automated Tests
  • Code review / validation of pull requests
  • Design any new feature
  • CI/CD (powered by GitHub workflows)
  • build binaries / distribs / .nupkg / setups / ...
  • Web site development (design, content update, ...)
  • Internationalization
  • Translates

The project team like to meet people and wish to share pleasure of programming and technology enthusiasm, with fun and good spirit



Features

a view of the shell running in Windows Terminal


  • Is a 'bash style' POSIX command shell
    done
  • The modules that are integrated into the shell provide the most usefull shell commands (ls/dir,rm,mv,cp,find,echo,clear,more,env,set,export,history,alias,...), tests commands, text editor command, and so on... , covering the fields of file system,text files,console output, data management, user input
    • modules can contains any item that the shell is intended to handle: commands, hooks, scripts/functions, settings, help, doc, assets, ...
      done
    • dedicated repositories are used to get known modules list
      done
    • modules are versioned and delivered throught nupkg packets, currently hosted at NuGet
      done
    • modules are installed into the binaries of the shell
      done issue
    • modules to be loaded are loaded by the shell kernel on user session startup
      done issue
  • The shell command engine implements:
    • A command line reader with:

      • usual input keyboard shortcuts
        done issue
      • auto completion
        todoissue
      • input feedback (colorization)
        todo issue
    • Streams standard input (stdIn), standard output (stdOut), and standard error (StdErr)
      done

    • Streams redirections ( < > )
      uncompleteissue

    • pipelines of commands:

      • sequences of commands ( | ) and conditional sequences of commands ( &&, || )
        uncompleteissue
      • groups of commands ( .. ; .. )
        todoissue
      • background execution ( & )
        todoissue
      • commands return a result code and can returns values
        done
        • When returning values and when specified, a pipe ( | ) between commands can pass objects instead of streams
          uncompleteissue
    • Cancellation of commands execution Task (Ctrl-Z)
      done

    • Batches of commands (scripts)

      • traditional batch of shell commands (.sh,.orbsh)
        uncompleteissue
      • C# language scripts (.cssh)
        todoissue
    • Variables

      • Variables can store any data of any C# object type
        • The command line syntax has been extended to support an object notation to indicate accessing an object member or invoking an object method
          uncompleteissue
        • Integrates the os shell environment variables (with type String)
          done
        • Are getted and setted with $ (in any command arg), set and =
          uncompleteissue
      • Functions can be defined by a shell script or by a C# compiled source
        todoissue
      • Aliases for command names
        done
      • Shell environment : the shell initialization feature deploy and setup a shell environment for the current user (profile folder and initialization scripts: .profile,.alias,.history,.orbsh)
        done
    • Extensibility:

      • The default command line grammar can be changed to get other syntaxes (zsh, DOS,...) or a new one
        done
      • The command line engine can be overriden and extended to enhance the existing features (auto complete inputs,parsing inputs,running commands,...)
        done
      • A simple way to define shell commands using C# method and parameters attributes, avoiding the developer to handle syntax analyzing and shell integration (command help, pipelines, standard stream redirections) councerns, allowing to support either simple values types (int,float,string,date time,..) and object types (even generic collection), and that can interacts together and with the shell throught data objects
        done
      // a Unix rm command implementation:
      [Command("remove file(s) and/or the directory(ies)")]
      public 
          CommandResult<(List<FileSystemPath> items, FindCounts counts)> 
          Rm(
              CommandEvaluationContext context,
              [Parameter("file or folder path")] WildcardFilePath path,
              [Option("r", "recurse", "also remove files and folders in sub directories")] bool recurse,
              [Option("i", "interactive", "prompt before any removal")] bool interactive,
              [Option("v", "verbose", "explain what is being done")] bool verbose,
              [Option("e", "delete-empty", "remove empty directories")] bool rmEmptyDirs,
              [Option("s", "short", "short display: do not print file system attributes when verbose")] bool noattributes,
              [Option("m", "simulate", "don't remove any file/or folder, just simulate the operation (enable verbose)")] bool simulate
          )
      {
          var r = new List<FileSystemPath>();
          var counts = new FindCounts();
          if (path.CheckExists(context))
          {
              var items = FindItems(context, path.FullName, path.WildCardFileName ?? "*", !recurse, true, false, !noattributes, !recurse, null, false, counts, false, false);
              
              /* ... */
              
              return new CommandResult<(List<FileSystemPath>, FindCounts)>((r, counts), ReturnCode.OK);
          }
          else
              return new CommandResult<(List<FileSystemPath>, FindCounts)>((r, counts), ReturnCode.Error);
      }
    • such a command will be auto documented like this by the shell help command:


Orbital shell uses these libraries:

  • Microsoft.CodeAnalysis.CSharp.Scripting
  • Microsoft.Extensions.ObjectPool
  • Microsoft.Extensions.Hosting
  • NewtonSoft.Json

notice / caveat

The project orbital shell was dependent of the project DotNetConsoleAppToolkit. Now the library DotNetConsoleAppToolkit project repository is ARCHIVED since it has been integrated into the orbital-shell project repository as project OrbitalShell-ConsoleApp, so it is still under development but code has been moved to this repository dot-net-console-app-toolkit last commit version

⚠️ this project might be considered as a toy for old developer



Warning: due to the average age of our main contributors, this project might contains vintage architecture,design and code. Nevertheless the source code is intensively based on young devs preferred patterns, C# 8 language usage (intellisense agrees), and it pretends to fit to good practices and architecture guidelines.