Skip to content
/ specs Public

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

Notifications You must be signed in to change notification settings

tarsana/specs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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

...

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published