Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dev/cli_md_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ pip install cortex

## Install the CLI without Python Client

### Mac/Linux OS

```bash
# Replace `INSERT_CORTEX_VERSION` with the complete CLI version (e.g. 0.18.1):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/vINSERT_CORTEX_VERSION/get-cli.sh)"

# For example to download CLI version 0.18.1 (Note the 'v'):
# For example to download CLI version 0.18.1 (Note the "v"):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/v0.18.1/get-cli.sh)"
```

### Windows

To install the Cortex CLI on a Windows machine, follow [this guide](../guides/windows-cli.md).

## Command overview
24 changes: 14 additions & 10 deletions dev/generate_cli_md.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ set -e

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null && pwd)"

cat $ROOT/dev/cli_md_template.md
out_file=$ROOT/docs/miscellaneous/cli.md
rm -f $out_file

echo "building cli..."
make --no-print-directory -C $ROOT cli
echo

# Clear default environments
cli_config_backup_path=$HOME/.cortex/cli-bak-$RANDOM.yaml
mv $HOME/.cortex/cli.yaml $cli_config_backup_path

cat $ROOT/dev/cli_md_template.md >> $out_file

commands=(
"deploy"
"get"
Expand All @@ -47,17 +50,18 @@ commands=(
"completion"
)

echo "## Command overview"
echo
echo "running help commands..."

for cmd in "${commands[@]}"; do
echo "### ${cmd}"
echo
echo -n '```text'
$ROOT/bin/cortex help ${cmd}
echo '```'
echo
echo '' >> $out_file
echo "### ${cmd}" >> $out_file
echo '' >> $out_file
echo -n '```text' >> $out_file
$ROOT/bin/cortex help ${cmd} >> $out_file
echo '```' >> $out_file
done

# Bring back CLI config
mv -f $cli_config_backup_path $HOME/.cortex/cli.yaml

echo "updated $out_file"
2 changes: 1 addition & 1 deletion docs/guides/windows-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pip install cortex
# Replace `INSERT_CORTEX_VERSION` with the complete CLI version (e.g. 0.18.1):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/vINSERT_CORTEX_VERSION/get-cli.sh)"

# For example to download CLI version 0.18.1 (Note the 'v'):
# For example to download CLI version 0.18.1 (Note the "v"):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/v0.18.1/get-cli.sh)"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/miscellaneous/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pip install cortex
# Replace `INSERT_CORTEX_VERSION` with the complete CLI version (e.g. 0.18.1):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/vINSERT_CORTEX_VERSION/get-cli.sh)"

# For example to download CLI version 0.18.1 (Note the 'v'):
# For example to download CLI version 0.18.1 (Note the "v"):
$ bash -c "$(curl -sS https://raw.githubusercontent.com/cortexlabs/cortex/v0.18.1/get-cli.sh)"
```

Expand Down