squiggle/packages/cli/README.md

23 lines
913 B
Markdown
Raw Permalink Normal View History

2022-06-18 04:45:58 +00:00
## Squiggle CLI
This package can be used to incorporate a very simple `import` system into Squiggle.
2022-06-20 13:35:25 +00:00
To use, write special files with a `.squiggleU` file type. In these files, you can write lines like,
2022-06-18 04:45:58 +00:00
```
@import(models/gdp_over_time.squiggle, gdpOverTime)
gdpOverTime(2.5)
```
2022-06-20 13:35:25 +00:00
The imports will be replaced with the contents of the file in `models/gdp_over_time.squiggle` upon compilation. The `.squiggleU` file will be converted into a `.squiggle` file with the `import` statement having this replacement.
2022-06-18 04:45:58 +00:00
## Running
### `npx squiggle-cli-experimental compile`
2022-06-20 13:35:25 +00:00
2022-06-18 04:45:58 +00:00
Runs compilation in the current directory and all of its subdirectories.
### `npx squiggle-cli-experimental watch`
2022-06-20 13:35:25 +00:00
Watches `.squiggleU` files in the current directory (and subdirectories) and rebuilds them when they are saved. Note that this will _not_ rebuild files when their dependencies are changed, just when they are changed directly.