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

Commit 4b44cdc

Browse files
committed
Restore apiKey command
1 parent 6c7433b commit 4b44cdc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

paperspace/cli/auth.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ def login(email, password, api_token_name):
3636
def logout():
3737
command = login_commands.LogOutCommand()
3838
command.execute()
39+
40+
41+
@cli.command("apiKey", help="Save your api key")
42+
@click.argument("api_key")
43+
def save_api_key(api_key):
44+
command = login_commands.SetApiKeyCommand()
45+
command.execute(api_key)

paperspace/commands/login.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from paperspace import login, logout
22
from paperspace.commands.common import CommandBase
3+
from paperspace.login import apikey, set_apikey
34
from paperspace.version import version
45

56

@@ -16,3 +17,8 @@ def execute(self):
1617
class ShowVersionCommand(CommandBase):
1718
def execute(self):
1819
self.logger.log(version)
20+
21+
22+
class SetApiKeyCommand(object):
23+
def execute(self, api_key):
24+
set_apikey(api_key)

0 commit comments

Comments
 (0)