tesh

Version, currently main branch1 version
  • main branchlatestMar 4, 2021

github.com/cardmagic/tesh

A highly dynamic shell/programming language environment with data structures written in Crystal

3 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  tesh:
    github: cardmagic/tesh
    branch: main

main is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.36.0
License
MIT
Author
Lucas Carlson
Target
  • tesh from src/tesh.cr

Dependencies

Runtime Dependencies

  • readline*github: crystal-lang/crystal-readline

README

tesh

A highly dynamic object-oriented shell environment built specifically for programmers

Installation

$ git clone git@github.com:cardmagic/tesh.git
$ cd tesh
$ crystal build
$ mv tesh /usr/local/bin
$ tesh

Usage

Tesh is built to look and feel like bash almost all the time.

$ echo hello world
hello world

But then add various programming primitives and object-oriented classes that engineers expect.

$ echo 1 + 2
3

Manipulating data becomes very natural for anyone familiar with Ruby, Javascript or Python.

$ ls
foo      bar     baz
$ ls.upcase
FOO      BAR     BAZ
$ ls.split[1]
bar
$ ls.split.map { |i| i.capitalize }
Foo      Bar     Baz
$ (ls -la).split.first
drwxr-xr-x
$ ls.split.last.class
Directory
$ if ls.split.last.present?; then
  cd ls.split.last
fi

A lot of the OO syntax and methods are borrowed from Ruby, but unlike using IRB, almost all primitive bash calls work out of the box as well.

You can override binaries and native keywords with your own custom functions, but still call back to the native binaries with the super call.

$ ls
foo      bar     baz
$ function ls { super.upcase }
$ ls
FOO      BAR     BAZ

Contributing

  1. Fork it (https://github.com/cardmagic/lucash/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors