Giter Site home page Giter Site logo

Tarsana

The Goal

The aim is to have an ecosystem in which developers can build and share command line apps (commands for short).

To acheive this goal, several components are needed:

  1. A framework to build commands.
  2. A command to create, install and publish commands (like composer and npm).
  3. A public repository to browse and search for commands (like packagist and npmjs.com).

The Framework

The PHP language was chosen simply because I wanted to rewrite my lumen-generators using this framework. Now I start to consider switching to Javascript...

To build a working version of the framwork, I need the following components:

  • filesystem to read, write and manipulate streams, files and directories.
  • syntax to parse structured strings (mainly used to parse command line args).
  • terminal to read from, write to, and handle interactions on the console.
  • command to build command line apps and test them easily.

In the process, I built these useful components:

  • functional because I liked functional programming and Ramda
  • Should create, copy, move and delete files and directories.
  • Should list and find files in directories.
  • Should read from and write to streams and files.
  • Should mock files and directories into memory (useful for testing).
  • Should parse and dump basic types: Boolean, Number, Array and Object.
  • Should define syntaxes using just a string.
  • Should define custom syntaxes easily.
  • Should write to console with formating and colors.
  • Should read inputs from the console: character, key, word, line.
  • Should handle interactive console.
  • Should mock interactive console (useful for testing).

A command should be able to:

  • Read from and write to console.
  • Easily define and parse command line args.
  • Show detailed help message.
  • Call another command and pass raw or parsed arguments.
  • Should be able to test any command.
  • Compose other commands (pipe, parallel, switch, ...).
  • Be lazy (writing changes to Filesystem only if everything goes well).
  • Auto complete command line args.
  • Should define useful functions (inspired from RamdaJS).
  • Should have a flexible and Lazy Stream class.
  • Should be as efficient as possible (sacrifice clean code).

The Tarsana Command

...

tarsana's Projects

command icon command

A library to build command line applications using PHP

filesystem icon filesystem

Simple classes to handle filesystem operations.

specs icon specs

Tarsana wants to be an ecosystem in which developers can build and share command line apps

syntax icon syntax

A tool to parse strings based on data structure definitions

terminal icon terminal

Flexible library to read from, write to, and handle interactions on the console.

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.