orcli/src/bashly.yml

152 lines
4.3 KiB
YAML
Raw Normal View History

2022-03-25 11:16:02 +01:00
name: orcli
help: OpenRefine command-line interface written in Bash
version: 0.1.0
2022-04-04 23:00:37 +02:00
footer: https://github.com/opencultureconsulting/orcli
2022-03-25 11:16:02 +01:00
dependencies:
2022-03-25 22:02:28 +00:00
- curl
- jq
2022-03-25 11:16:02 +01:00
environment_variables:
2022-03-25 22:02:28 +00:00
- name: OPENREFINE_URL
help: URL to OpenRefine server
default: "http://localhost:3333"
2022-03-25 11:16:02 +01:00
examples:
2022-04-20 10:27:53 +00:00
- orcli import csv "https://git.io/fj5hF" --projectName "duplicates"
2022-04-14 10:06:54 +00:00
- orcli list
2022-04-20 10:27:53 +00:00
- orcli info "duplicates"
- orcli export tsv "duplicates"
- orcli export tsv "duplicates" --output "duplicates.tsv"
2022-10-16 21:13:59 +00:00
- orcli run --interactive
2022-04-20 10:27:53 +00:00
- |-
orcli run << EOF
2022-10-06 11:35:34 +00:00
orcli import csv "https://git.io/fj5hF" --projectName "duplicates"
orcli info "duplicates"
orcli export tsv "duplicates"
2022-10-06 11:28:47 +00:00
EOF
2022-03-25 11:16:02 +01:00
2022-10-07 09:02:05 +00:00
flags:
- long: --quiet
short: -q
help: suppress log output, print errors only
2022-03-25 11:16:02 +01:00
commands:
2022-10-04 21:19:18 +00:00
- name: completions
help: |-
Generate bash completions
Usage: eval "\$(orcli completions)"
2022-10-06 11:28:47 +00:00
2022-04-12 10:54:16 +00:00
- name: import
2022-04-13 11:36:23 +00:00
help: import commands
commands:
2022-04-13 21:55:47 +00:00
- name: csv
help: import comma-separated values (CSV)
args:
- name: file
help: Path to one or more files or URLs. When FILE is -, read standard input.
default: "-"
repeatable: true
flags:
- long: --separator
help: character(s) that separates columns
arg: separator
default: ","
- long: --encoding
help: set character encoding
arg: encoding
- long: --trimStrings
help: trim leading & trailing whitespace from strings
- long: --projectName
arg: projectName
help: set a name for the OpenRefine project
examples:
2022-04-20 10:27:53 +00:00
- orcli import csv "file"
- orcli import csv "file1" "file2"
- cat "file" | orcli import csv
- orcli import csv "https://git.io/fj5hF"
- |-
orcli import csv "file" \\\\
--separator ";" \\\\
--encoding "ISO-8859-1" \\\\
--trimStrings \\\\
--projectName "duplicates"
2022-04-12 10:54:16 +00:00
2022-03-25 22:02:28 +00:00
- name: list
help: list projects on OpenRefine server
2022-04-14 10:06:54 +00:00
- name: info
help: show project metadata
args:
- name: project
help: project name or id
required: true
examples:
2022-04-20 10:27:53 +00:00
- info "duplicates"
2022-04-14 10:06:54 +00:00
- info 1234567890123
- name: export
help: export commands
commands:
- name: tsv
help: export tab-separated values (TSV)
args:
- name: project
help: project name or id
required: true
flags:
- long: --output
help: Write to file instead of stdout
arg: file
- long: --encoding
help: set character encoding
arg: encoding
default: "UTF-8"
examples:
2022-04-20 10:27:53 +00:00
- orcli export tsv "duplicates"
- orcli export tsv "duplicates" --output "duplicates.tsv"
- name: run
help: run tmp OpenRefine workspace and execute shell script(s)
args:
- name: file
help: Path to one or more files. When FILE is -, read standard input.
default: "-"
repeatable: true
flags:
- long: --memory
help: maximum RAM for OpenRefine java heap space
arg: ram
default: "2048M"
- long: --port
help: PORT on which OpenRefine should listen
arg: port
default: "3333"
2022-10-16 21:13:59 +00:00
- long: --interactive
help: do not exit on error and keep bash shell open
examples:
2022-10-16 21:13:59 +00:00
- orcli run --interactive
- |-
orcli run << EOF
orcli import csv "https://git.io/fj5hF" --projectName "duplicates"
orcli info "duplicates"
orcli export tsv "duplicates"
EOF
- |-
orcli run --memory "2000M" --port "3334" << EOF
orcli import csv "https://git.io/fj5hF" --projectName "duplicates" &
orcli import csv "https://git.io/fj5hF" --projectName "copy" &
wait
echo "finished import"
orcli export csv "duplicates" --output duplicates.csv &
orcli export tsv "duplicates" --output duplicates.tsv &
wait
wc duplicates*
EOF
- |-
2022-10-16 21:13:59 +00:00
orcli run --interactive "file1.sh" "file2.sh" - << EOF
echo "finished in \$SECONDS seconds"
EOF