-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from OpenFn/rearrannge_bin
Moved cli index to bin/
- Loading branch information
Showing
3 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,31 @@ the expression in this limited access Node VM. | |
|
||
## Getting Started | ||
|
||
Clone [openfn-devTools](https://github.com/OpenFn/openfn-devtools) for a quick | ||
setup environment on your machine. Use cli.js execute (described below) to run | ||
jobs. | ||
It's recommended to start by getting [openfn-devTools](https://github.com/OpenFn/openfn-devtools) | ||
setup for a quick development environment on your machine. | ||
|
||
### Execute | ||
After that you can use `core execute` to run your jobs. | ||
|
||
**Install via NPM** | ||
|
||
```sh | ||
npm install @openfn/core | ||
core | ||
``` | ||
|
||
`cli.js execute -l path/to/Adaptor -s ./tmp/state.json -e ./tmp/expression.js -o ./tmp/output.json` | ||
**Via git** | ||
|
||
```sh | ||
git clone [email protected]:OpenFn/core.git | ||
cd core | ||
./bin/core | ||
``` | ||
|
||
### Execute | ||
|
||
Used to convert an expression into an executable script. | ||
|
||
Options: | ||
**Options**: | ||
|
||
``` | ||
-l, --language resolvable language/adaptor path [required] | ||
|
@@ -26,18 +40,18 @@ Options: | |
-t, --test Intercepts and logs all HTTP requests to console | ||
``` | ||
|
||
Examples: | ||
**Examples** | ||
|
||
Use a module in the parent folder, and pick out the `Adaptor` member. | ||
|
||
``` | ||
cli.js execute -l ../language-http.Adaptor -e exp.js -s state.json | ||
core execute -l ../language-http.Adaptor -e exp.js -s state.json | ||
``` | ||
|
||
Use a npm installed module, and pick out the `Adaptor` member. | ||
|
||
``` | ||
cli.js execute -l language-http.Adaptor -e exp.js -s state.json | ||
core execute -l language-http.Adaptor -e exp.js -s state.json | ||
``` | ||
|
||
## Using Programmatically | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env node | ||
|
||
const yargs = require('yargs/yargs'); | ||
const { hideBin } = require('yargs/helpers'); | ||
|
||
yargs(hideBin(process.argv)) | ||
.command(require('./compile-command')) | ||
.command(require('./execute-command')) | ||
.command(require('../lib/cli/compile-command')) | ||
.command(require('../lib/cli/execute-command')) | ||
.demandCommand(1, 'must provide a command') | ||
.help('h') | ||
.alias('h', 'help') | ||
.epilog('OpenFn 2021').argv; | ||
.epilog('OpenFn 2021').argv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters