1.3.2 • Published 2 months ago

bilderhic v1.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
2 months ago

bilderhic

Bilderhic is a smart and simple command tool for automatization.

How does it work?

You have to create a pipe file. Bilderhic will run the commands inside your file. The commands of the pipe file can be Bilderhic commands, or bash / cmd commands. Bilderhic includes usefull commands for edit files.

Installation

npm i -g bilderhic

License

MIT

Third party licenses:

Usage

bhic <file> [-vb or --verbose] [-d or --debug]

or

bhic [-vb or --verbose] [-d or --debug] [-c or --command] <single line command>

~ Bilderhic Commands ~

> env command

Description

It allows you to create / load / edit environment variables (inside your process).

Usage

Set variable manually

env set <key> <value>

Set variable value (if the variable doesn't exists)

env set-default <key> <value>

Set variable from user input

env prompt <key> -m <message>

Adds a value to a numeric variable

env add <key> <value>

Load variables

env load <file.yml>

File.yml example

app:
    id: com.brand.app
    version: 2
    description: This is an awesome Android Application.
    name: Awesomapp

Usage of environment variables

env load File.yml

:open config.xml - set widget.id=app.id - set widget.android-versionCode=app.version - set widget.version=0.0.app.version - set widget>name=app.name - set widget>description=app.description - save - close

> Clear your environment
```bash
env clear

Change the debug mode

env debug <enable or disable>

> copy command

Description

Copies a file or a folder. Override the files if it exists.

Usage
copy <from> <to> [-i or --ignore <file or folder>] [-q or --quiet] [-e or --ignore-errors]

> sync command

Description

Synchronizes (mirror mode) two folders. Only writes the diferrences between the folders.

Usage
sync <source> <destination> [-i or --ignore <file or folder or wildcard>] [-q or --quiet] [-nd or --disable-delete]

> del command

Description

Deletes a file o a folder (recursively) if exists.

Usage
del <file or folder>

> cd command

DOC

Usage
cd
cd <folder>
cd --clear
cd --back

> log command

Writes a text to the configured loggers.

log [info | warn | debug | error | success] <text to log>

> mkdir command

DOC

> ren command

Renames a file o a folder.

Usage
ren <file or folder> <newName> [--skip-unexisting or -sk] [--overwrite or -o]

> base64 command

Description

Parses a base-64 string.

Usage
base64 <text>
or
base64 <text> > <filename>
or
base64 <text> >> <environment variable>
Example
base64 YmlsZGVyaGlj > mistery.txt

> cat command

Description

Reads a file and prints its content.

Usage
cat <filename>
or
cat <filename> > <filename>
or
cat <filename> >> <environment variable>
Example
base64 YmlsZGVyaGlj > mistery.txt

> run command

Description

Renames a file or a folder.

Usage
ren <origin> <target> [--overwrite or -w]

> exit command

Description

Stops the pipe or the process.

Usage
exit [pipe]
or
exit [<exit code>]

> sleep command

Description

Waits until timer ends.

Usage
sleep <time (ms)>

> beep command

Description

Makes a console beep sound.

Usage
beep [times] [delay between beeps]
Examples
echo Beep!
beep
echo Beep! Beep!
beep 2
echo Beep! ... Beep! ... Beep!
beep 3 1000

~ Special Commands ~

Pipe

Open a new pipe from a file

:pipe <file>

Pipe line

Open a new pipe from a line of code

:pipeline <code>

Each

Open a new pipe from a list of folders or files

:each folder [recursive] [async [limit x]] [filter]
:each file [recursive] [filter]

Example 1

:each folder
:begin
  echo [$currentFolder]
:end

Example 2

:each folder recursive
:begin
  echo [$currentFolder]
:end

Example 3

:each folder recursive **/node_*
:begin
  echo [$currentFolder]
:end

Example 4

:each folder **/node_*
:begin
  echo [$currentFolder]
:end

Example 5

:each folder async
:begin
  echo [$currentFolder]
:end

Example 6

:each folder async limit 5
:begin
  echo [$currentFolder]
:end

Logger

Adds a logger instance.

:logger add <logger type> [logger name]

Logger types:

  • File

Example:

:logger add file
- set file logs.txt

log Hello word!

Open

Open a file editor

:open <file> [force a file format]

Example 1: Open a JSON file.

:open settings.json
- close 

Example 2: Open a JSON file as a Text file.

:open settings.json txt
- close 

Eval

Run javacript code and saves the result to $eval (environment variable).

:eval <code>

Example:

:eval +(new Date())
echo [$eval]

If

If condition

:if <conditions>
:if <conditions>
:begin
    <instructions here>
:end

Await

Wait for all async commands to finish.

:await

If you want to start an async command, you need to start it with a ~ character.

Example:

run echo This is a sync command
~run echo This is an async command
:await

Bhic / Bilderhic

It does nothing. It's useful for ensure that you are running a file on Bilderhic.

!bhic
or
!bilderhic

File edition

Text editors: TXT Object editors: XML, HTML, JSON

~ Text editors ~

- append <text>
- set <line number> <text>
- replace <text> <replacement text>
- replaceone <text> <replacement text>
- replace:raw <text> <replacement text>
- replaceone:raw <text> <replacement text>
- save
- close

~ Object editors ~

- add <key>=<value>
- set <selector> = <value or variable>
- get <selector> > <variableName>
- save
- close

Examples

bhic pipe.txt bhic -c echo Hi world! bhic pipe.txt --set myVariable=myCustomValue

Misc

Multiple line command

bhic -c echo Running :eol: sleep 5000 :eol: beep :eol: echo Run finished

Timestamp

bhic -c echo My timestamp is [timestamp]

Date

bhic -c echo Today is [date]

Date (custom format)

bhic -c echo Today is [date:YYYY-MM-DD]

Time

bhic -c echo The current time is [hour]

Time (custom format)

bhic -c echo The current time is [hour:HH.MM]
1.3.2

2 months ago

1.3.1

2 months ago

1.2.5

3 months ago

1.3.0

3 months ago

1.2.4

4 months ago

1.2.3

7 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

1 year ago

1.1.16

1 year ago

1.1.17

1 year ago

1.1.12

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.11

2 years ago

1.1.9

2 years ago

1.1.10

2 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.78

3 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.73

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.69

3 years ago

1.0.70

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.51

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago