primitive 0.2.21__py3-none-any.whl → 0.2.22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
primitive/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@primitive.tech>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.2.21"
4
+ __version__ = "0.2.22"
primitive/auth/actions.py CHANGED
@@ -18,14 +18,12 @@ class Auth(BaseAction):
18
18
 
19
19
  def setup_config(
20
20
  self,
21
- username: str,
22
21
  token: str,
23
22
  host: str = "api.primitive.tech",
24
23
  transport: str = "https",
25
24
  ):
26
25
  full_config = read_config_file()
27
26
  new_host_config = {
28
- "username": username,
29
27
  "token": token,
30
28
  "transport": transport,
31
29
  }
@@ -1,6 +1,6 @@
1
1
  import os
2
- import typing
3
2
  import webbrowser
3
+ from typing import TYPE_CHECKING, Optional
4
4
 
5
5
  import click
6
6
 
@@ -8,7 +8,7 @@ from ..utils.config import PRIMITIVE_CREDENTIALS_FILEPATH
8
8
  from ..utils.printer import print_result
9
9
  from .actions import Auth
10
10
 
11
- if typing.TYPE_CHECKING:
11
+ if TYPE_CHECKING:
12
12
  from ..client import Primitive
13
13
 
14
14
 
@@ -34,13 +34,6 @@ def whoami_command(context):
34
34
 
35
35
  @cli.command("config")
36
36
  @click.pass_context
37
- @click.option(
38
- "--username",
39
- prompt=True,
40
- default=lambda: os.environ.get("PRIMITIVE_USER", ""),
41
- show_default="current user",
42
- help="Username for Primitive API",
43
- )
44
37
  @click.option(
45
38
  "--transport",
46
39
  required=False,
@@ -48,9 +41,16 @@ def whoami_command(context):
48
41
  show_default="https",
49
42
  help="Transport protocol for Primitive API",
50
43
  )
51
- def config_command(context, username: str, transport: str):
44
+ @click.option(
45
+ "--auth-token",
46
+ prompt=True,
47
+ default=lambda: os.environ.get("PRIMITIVE_TOKEN", ""),
48
+ hide_input=True,
49
+ help="Authentication token for Primitive API",
50
+ )
51
+ def config_command(context, transport: str, auth_token: Optional[str] = None):
52
52
  """Configure the CLI"""
53
- token = os.environ.get("PRIMITIVE_TOKEN", "")
53
+ token = os.environ.get("PRIMITIVE_TOKEN", auth_token)
54
54
  if not token and context.obj.get("YES"):
55
55
  raise click.ClickException(
56
56
  "PRIMITIVE_TOKEN environment variable is required for non-interactive mode"
@@ -73,6 +73,6 @@ def config_command(context, username: str, transport: str):
73
73
  )
74
74
 
75
75
  auth = Auth(primitive=None)
76
- auth.setup_config(username=username, token=token, host=host, transport=transport)
77
- message = f"Config created at '{PRIMITIVE_CREDENTIALS_FILEPATH}' for user '{username}' on host '{host}'" # noqa
76
+ auth.setup_config(token=token, host=host, transport=transport)
77
+ message = f"Config created at '{PRIMITIVE_CREDENTIALS_FILEPATH}' on host '{host}'" # noqa
78
78
  print_result(message=message, context=context, fg="green")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primitive
3
- Version: 0.2.21
3
+ Version: 0.2.22
4
4
  Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
5
5
  Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
6
6
  Project-URL: Source, https://github.com//primitivecorp/primitive-cli
@@ -127,10 +127,9 @@ source .venv/bin/activate
127
127
  source .venv/bin/activate.fish
128
128
 
129
129
  primitive --host localhost:8000 config --transport http
130
- Username []: <username> # find this on the frontend app at [http://localhost:3000](http://localhost:3000)
131
130
  You can find or create a Primitive API token at http://localhost:3000/account/tokens
132
131
  Please enter your Primitive API token: # create a token and copy the value here
133
- Config created at '/Users/<user>/.config/primitive/credentials.json' for user '<username>' on host 'localhost:8000'
132
+ Config created at '/Users/<user>/.config/primitive/credentials.json' on host 'localhost:8000'
134
133
 
135
134
  # verify the configuration worked via
136
135
  primitive --host localhost:8000 whoami
@@ -1,4 +1,4 @@
1
- primitive/__about__.py,sha256=2U8gKYr-8TF1aRgcwIlbm8S-74abcoIdCcPB08CEO3w,130
1
+ primitive/__about__.py,sha256=ywjcAnYCZQZHX2ntgK8cvx23rSS44olGihhJWtXvKaw,130
2
2
  primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
3
3
  primitive/cli.py,sha256=g7EtHI9MATAB0qQu5w-WzbXtxz_8zu8z5E7sETmMkKU,2509
4
4
  primitive/client.py,sha256=h8WZVnQylVe0vbpuyC8YZHl2JyITSPC-1HbUcmrE5pc,3623
@@ -8,8 +8,8 @@ primitive/agent/commands.py,sha256=cK7d3OcN5Z65gQWVZFQ-Y9ddw9Pes4f9OVBpeMsj5sE,2
8
8
  primitive/agent/runner.py,sha256=CoRyReO3jPV8B7vILVWdszFD4GVop7HsVEUo1hoRXjo,14556
9
9
  primitive/agent/uploader.py,sha256=ZzrzsajNBogwEC7mT6Ejy0h2Jd9axMYGzt9pbCvVMlk,3171
10
10
  primitive/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- primitive/auth/actions.py,sha256=MPsG9LcKcOPwA7gZ9Ewk0PZJhTQvIrGfODdz4GxSzgA,999
12
- primitive/auth/commands.py,sha256=2z5u5xX64n0yILucx9emtWh3uQXLvs2QQQQIldZGr94,2341
11
+ primitive/auth/actions.py,sha256=9NIEXJ1BNJutJs6AMMSjMN_ziONUAUhY_xHwojYJCLA,942
12
+ primitive/auth/commands.py,sha256=Krm38ioduDJZw0OIrIcb6eR2X6iECiWX0JPAI-2HNxY,2352
13
13
  primitive/auth/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  primitive/auth/graphql/queries.py,sha256=jhrr_VFzHIn8vcVprMIzUx7V4kkWYdR6CKMKPoVFv60,180
15
15
  primitive/daemons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -96,8 +96,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
96
96
  primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
97
97
  primitive/utils/shell.py,sha256=jWzb7ky7p987dJas6ZvarK3IJNZ5cwBXcryRWb9Uh6U,2072
98
98
  primitive/utils/text.py,sha256=XiESMnlhjQ534xE2hMNf08WehE1SKaYFRNih0MmnK0k,829
99
- primitive-0.2.21.dist-info/METADATA,sha256=MW7arn8ApaoBDQg0KJ494Yo4R5_uhUN4B5h-XdHNF-w,3733
100
- primitive-0.2.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
- primitive-0.2.21.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
- primitive-0.2.21.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
- primitive-0.2.21.dist-info/RECORD,,
99
+ primitive-0.2.22.dist-info/METADATA,sha256=GofUxo6eFljTu6xAmepzr8PsS3OlZcOaz-RLzyLgnxo,3605
100
+ primitive-0.2.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
+ primitive-0.2.22.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
+ primitive-0.2.22.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
+ primitive-0.2.22.dist-info/RECORD,,