github.com/arr-ai/arrai@v0.319.0/README.md (about)

     1  # Arr.ai
     2  
     3  ![Go build status](https://github.com/arr-ai/arrai/workflows/Go/badge.svg)
     4  
     5  The ultimate data engine.
     6  
     7  ## Install
     8  
     9  On a Unix-like OS, [install Go](https://golang.org/doc/install) (1.15 or above),
    10  then:
    11  
    12  ```bash
    13  git clone https://github.com/arr-ai/arrai.git
    14  cd arrai
    15  make install
    16  ```
    17  
    18  On Windows, download the relevant ZIP file from the
    19  [Releases page](https://github.com/arr-ai/arrai/releases).
    20  
    21  ## Learn
    22  
    23  Follow the [Arr.ai tutorial](docs/tutorial/README.md) for a step by step guide
    24  into the world of arr.ai programming.
    25  
    26  See the [Introduction to Arr.ai](docs/README.md) to learn more about the arr.ai
    27  language.
    28  
    29  See the [Standard Library Reference](docs/std.md) to learn what batteries
    30  are included in arr.ai.
    31  
    32  ### Arr.ai Examples
    33  
    34  1. [Snippets](docs/example.md)
    35  2. [More complete examples](examples)
    36  
    37  ## Use
    38  
    39  ### Run the interactive shell
    40  
    41  ```arrai
    42  $ arrai i
    43  @> 6 * 7
    44  42
    45  @> //<tab>
    46  archive  bits     dict     encoding eval     fn       grammar  log
    47  math     net      os       re       reflect  rel      seq      str
    48  test     tuple    unicode  {
    49  @> //str.<tab>
    50  expand lower  repr   title  upper  
    51  @> //str.upper("hello")
    52  'HELLO'
    53  ```
    54  
    55  Ctrl+D to exit. or use the `/exit` command.
    56  
    57  ```bash
    58  @> /exit
    59  ```
    60  
    61  On Unix-like platforms, you can use the `ai` shortcut:
    62  
    63  ```bash
    64  $ ai
    65  @> _
    66  ```
    67  
    68  There are more features in the interactive shell. For more info please read the
    69  [shell tutorial](docs/tutorial/shell.md).
    70  
    71  ### Evaluate an expression
    72  
    73  (See [here](docs/cmdline/eval.md) for a full description of `eval`.)
    74  
    75  ```bash
    76  arrai eval '41 + 1'
    77  ```
    78  Run `arrai help` or `arrai help <command>` for more information.
    79  <!-- TODO: Uncomment once this works again.
    80  ### Transform a stream of values
    81  
    82  ```bash
    83  echo {0..10} | arrai transform '2^.'
    84  ```
    85  
    86  Use `ax` as shorthand for `arrai transform`:
    87  
    88  ```bash
    89  ln -s arrai "$GOPATH/bin/ax"
    90  echo {0..10} | ax '2^.'
    91  ```
    92  -->
    93  
    94  ### Run an arrai file
    95  
    96  (See [here](docs/cmdline/eval.md) for a full description of `run`.)
    97  
    98  ```bash
    99  arrai path/to/file.arrai
   100  ```
   101  
   102  or use the `run` command
   103  
   104  ```bash
   105  arrai run path/to/file.arrai
   106  ```
   107  
   108  `arrai run` can be used to avoid ambiguity between filename and a command.
   109  For example, running an arrai file named `run` (`arrai run run`). Alternatively, include a
   110  subdirectory component in the filename (`arrai ./run`).
   111  
   112  ### Start a server
   113  
   114  ```bash
   115  arrai serve --listen localhost
   116  ```
   117  
   118  ### Observe a server
   119  
   120  ```bash
   121  arrai observe localhost '$'
   122  ```
   123  
   124  ### Update a server
   125  
   126  ```bash
   127  arrai update localhost '(a: {1, 2, 3}, b: "hello")'
   128  arrai u localhost '$ + (a: $.a | {4, 5, 6})'
   129  ```