Commands

How to use commands

The minimal unit of information in Puff is tasks. You define them in the puff.yml (Puff File).

Each task is an object with the following fields:

  • optional description – Task description.

  • optional arguments – CLI arguments. (see Variables)

  • commands – An array of commands.

πŸ’» Commands

default:
  commands:
    - echo 'Hello world'
    - ls -la | grep libssl.so < output.txt

As you can see, the syntax is simple and clear. Commands in the default task will execute sequentially β€” one after another in order.

If you need multithreading β€” see (Multithreading)

default:
  description: Compiles project
  commands:
    - async: gcc main.cpp
    - await: 'project builded successfully'

πŸ§‘β€πŸ’» Arguments

default:
  description: Outputs text in console
  arguments:
    - name: prefix # required
    - name: text # optional, has default value
      default: Hello, world!
  commands:
    - echo [${prefix}] ${text}
$ puff hi
[hi] Hello, world!
$ puff hi i\'am bob
[hi] i'am bob

Last updated