Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 954e826

Browse files
Merge pull request #112 from Paperspace/feat/autocomplete
click_completion
2 parents db48f70 + 9f25363 commit 954e826

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@ Getting Started
1717
To install/update prerelease (Alpha/Beta) version version of paperspace-python, use:
1818

1919
`pip install -U --pre paperspace`
20-
21-
3. Download your api key by executing the following:
20+
3. Enable autocomplete:
21+
22+
Add following to your `.bashrc` (or `.zshrc`) to enable autocomplete anytime you activate your shell.
23+
24+
`eval $(_PAPERSPACE_PYTHON_COMPLETE=source paperspace-python)`
25+
26+
For other shell (eg. `zsh` or `fish`), use proper version of `source` (`source_zsh` and `source-fish` respectively)
27+
28+
Alternatively, you can create activation script by:
29+
30+
`(_PAPERSPACE_PYTHON_COMPLETE=source paperspace-python > ~/paperspace_complete.sh`
31+
32+
More: https://click.palletsprojects.com/en/7.x/bashcomplete/
33+
4. Download your api key by executing the following:
2234

2335
`paperspace-python login`
2436

@@ -33,7 +45,7 @@ Getting Started
3345

3446
`paperspace-python logout`
3547

36-
4. Run the sample script hello.py using Python:
48+
5. Run the sample script hello.py using Python:
3749

3850
`python hello.py`
3951

@@ -49,7 +61,7 @@ Getting Started
4961
5062
Note: the source is modified before transfer to the job cluster in order to remove imported `paperspace` references.
5163
52-
5. Use paperspace-python to run a python script remotely:
64+
6. Use paperspace-python to run a python script remotely:
5365
5466
`paperspace-python run myscript.py`
5567

paperspace/cli/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import click
2+
import click_completion
23

34
from paperspace import config
45
from paperspace.cli import common
56
from paperspace.commands import login as login_commands
67

8+
click_completion.init()
9+
710

811
@click.group(cls=common.ClickGroup, **config.HELP_COLORS_DICT)
912
def cli():

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
'terminaltables',
5050
'click-didyoumean',
5151
'click-help-colors',
52+
'click-completion',
5253
'colorama',
5354
'requests-toolbelt',
5455
'progressbar2',

0 commit comments

Comments
 (0)