Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soanvig/cli-file
Tool for easy and programming language-agnostic command-line interfaces for executing commands.
https://github.com/soanvig/cli-file
Last synced: about 16 hours ago
JSON representation
Tool for easy and programming language-agnostic command-line interfaces for executing commands.
- Host: GitHub
- URL: https://github.com/soanvig/cli-file
- Owner: soanvig
- Created: 2021-08-14T10:57:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-29T21:20:42.000Z (about 3 years ago)
- Last Synced: 2025-01-09T15:54:50.162Z (2 days ago)
- Language: Haskell
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cli-file
*Alpha version, API subjected to change*
Tool for easy and programming language-agnostic command-line interfaces for executing commands.
It's built to provide accessible and extensible interface to building projects, running tests,
managing deployments and so on, without relying on poor tools like `npm scripts`.It offers domain-specific language - configuration file containing lines with commands like:
```
myEcho :: value = "World" -> echo Hello $value
```that can be executed using
`cli-file myEcho` resulting in `Hello World`
or
`cli-file myEcho John` resulting in `Hello John`
Any shell command can be called that way.
## How to use
By default `cli-file` looks for a file `commands.cli` in current directory.
That is the file containing configured commands.Syntax:
1. Command without any arguments: `myEcho -> echo Hello World`
2. Command with required argument: `myEcho :: value -> echo Hello $value`
3. Command with optional argument: `myEcho :: value = "World" -> echo Hello $value`
4. Command with multiple arguments: `myEcho :: first, second = "World" -> echo $first $second`
5. Comment (only on newline): `# This is comment`At this point `cli-file` doesn't support default values longer than one word (on TODO list).
`cli-file` substitutes only known `$param` names, therefore if there is any conflict between a parameter name,
and shell variable, just use different name for the parameter.### Switches
1. `-c ` or `--commands ` - change default commands file location (e.g. `cli-file -c /tmp/commands myEcho John`)
2. `-h` or `--help` - (needs to be first) show help
3. `-v` or `--version` - (needs to be first) print version