current-cli 0.1.0__tar.gz → 0.1.1__tar.gz
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.
- {current_cli-0.1.0 → current_cli-0.1.1}/PKG-INFO +4 -2
- {current_cli-0.1.0 → current_cli-0.1.1}/README.md +3 -1
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/config.py +1 -1
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/docs.py +6 -3
- {current_cli-0.1.0 → current_cli-0.1.1}/llms.txt +6 -3
- {current_cli-0.1.0 → current_cli-0.1.1}/pyproject.toml +1 -1
- current_cli-0.1.1/scripts/bump_version.py +33 -0
- current_cli-0.1.1/tests/test_bump_version.py +51 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/test_requests.py +1 -1
- {current_cli-0.1.0 → current_cli-0.1.1}/.gitignore +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/__init__.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/build.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/http.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/main.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/schema.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/current_cli/schema.yml +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/__init__.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/conftest.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/test_auth.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/test_command_tree.py +0 -0
- {current_cli-0.1.0 → current_cli-0.1.1}/tests/test_docs.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: current-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Command line interface for the Current API, generated from its OpenAPI schema at runtime
|
|
5
5
|
Author-email: Orin <your-email@example.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -32,7 +32,6 @@ cd cli && uv sync
|
|
|
32
32
|
## Usage
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
current config set base_url https://your-api.example.com
|
|
36
35
|
current login you@example.com
|
|
37
36
|
current config set default_workspace <workspace-uuid>
|
|
38
37
|
|
|
@@ -42,6 +41,9 @@ current tasks create --data '{"name": "Order beams", "workspace": "..."}'
|
|
|
42
41
|
current workspaces members list <workspace_id>
|
|
43
42
|
```
|
|
44
43
|
|
|
44
|
+
The CLI points at `https://api.current.orinlabs.ai` by default. For local
|
|
45
|
+
development, run `current config set base_url http://localhost:8000`.
|
|
46
|
+
|
|
45
47
|
Run `current --help` (or `--help` on any subcommand) to see everything the
|
|
46
48
|
API exposes. `current docs` prints a markdown reference of every command;
|
|
47
49
|
the committed copy lives at [llms.txt](llms.txt) — hand it to an LLM that
|
|
@@ -19,7 +19,6 @@ cd cli && uv sync
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
current config set base_url https://your-api.example.com
|
|
23
22
|
current login you@example.com
|
|
24
23
|
current config set default_workspace <workspace-uuid>
|
|
25
24
|
|
|
@@ -29,6 +28,9 @@ current tasks create --data '{"name": "Order beams", "workspace": "..."}'
|
|
|
29
28
|
current workspaces members list <workspace_id>
|
|
30
29
|
```
|
|
31
30
|
|
|
31
|
+
The CLI points at `https://api.current.orinlabs.ai` by default. For local
|
|
32
|
+
development, run `current config set base_url http://localhost:8000`.
|
|
33
|
+
|
|
32
34
|
Run `current --help` (or `--help` on any subcommand) to see everything the
|
|
33
35
|
API exposes. `current docs` prints a markdown reference of every command;
|
|
34
36
|
the committed copy lives at [llms.txt](llms.txt) — hand it to an LLM that
|
|
@@ -20,11 +20,14 @@ generated from the API's OpenAPI schema, so every API operation is available.
|
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
pip install current-cli
|
|
23
|
-
current
|
|
24
|
-
current
|
|
25
|
-
current config set default_workspace <workspace-uuid> # used when --workspace is omitted
|
|
23
|
+
current login you@example.com # magic-link sign in, stores the token
|
|
24
|
+
current config set default_workspace <workspace-uuid> # used when --workspace is omitted
|
|
26
25
|
```
|
|
27
26
|
|
|
27
|
+
The CLI speaks to `https://api.current.orinlabs.ai` by default. For another
|
|
28
|
+
server (for example local development), set
|
|
29
|
+
`current config set base_url http://localhost:8000`.
|
|
30
|
+
|
|
28
31
|
The auth token is stored in `~/.config/current-cli/config.json` and sent as
|
|
29
32
|
`Authorization: Token <token>`. `CURRENT_API_URL` overrides the base URL.
|
|
30
33
|
|
|
@@ -7,11 +7,14 @@ generated from the API's OpenAPI schema, so every API operation is available.
|
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
pip install current-cli
|
|
10
|
-
current
|
|
11
|
-
current
|
|
12
|
-
current config set default_workspace <workspace-uuid> # used when --workspace is omitted
|
|
10
|
+
current login you@example.com # magic-link sign in, stores the token
|
|
11
|
+
current config set default_workspace <workspace-uuid> # used when --workspace is omitted
|
|
13
12
|
```
|
|
14
13
|
|
|
14
|
+
The CLI speaks to `https://api.current.orinlabs.ai` by default. For another
|
|
15
|
+
server (for example local development), set
|
|
16
|
+
`current config set base_url http://localhost:8000`.
|
|
17
|
+
|
|
15
18
|
The auth token is stored in `~/.config/current-cli/config.json` and sent as
|
|
16
19
|
`Authorization: Token <token>`. `CURRENT_API_URL` overrides the base URL.
|
|
17
20
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Write a bumped patch version into pyproject.toml and print it.
|
|
3
|
+
|
|
4
|
+
Usage: bump_version.py [pyproject-path] [version-to-bump-from]
|
|
5
|
+
|
|
6
|
+
Bumps the patch of the given version (default: the version in the file) and
|
|
7
|
+
rewrites the file's version. Used by publish-cli.yml to publish the next
|
|
8
|
+
patch after the latest release on PyPI, without committing to the repo.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import sys
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
import tomllib
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def bump(path: Path, from_version: str | None = None) -> str:
|
|
18
|
+
current = tomllib.loads(path.read_text())["project"]["version"]
|
|
19
|
+
major, minor, patch = (from_version or current).split(".")
|
|
20
|
+
new_version = f"{major}.{minor}.{int(patch) + 1}"
|
|
21
|
+
|
|
22
|
+
text = path.read_text()
|
|
23
|
+
new_text = text.replace(f'version = "{current}"', f'version = "{new_version}"', 1)
|
|
24
|
+
if new_text == text:
|
|
25
|
+
raise SystemExit(f'could not find version = "{current}" in {path}')
|
|
26
|
+
path.write_text(new_text)
|
|
27
|
+
return new_version
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
target = Path(sys.argv[1]) if len(sys.argv) > 1 else Path("pyproject.toml")
|
|
32
|
+
base = sys.argv[2] if len(sys.argv) > 2 else None
|
|
33
|
+
print(bump(target, base))
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""The release pipeline's version bump must produce a valid, incremented version."""
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
import tomllib
|
|
7
|
+
|
|
8
|
+
from .conftest import REPO_ROOT
|
|
9
|
+
|
|
10
|
+
SCRIPT = REPO_ROOT / "cli" / "scripts" / "bump_version.py"
|
|
11
|
+
PYPROJECT = REPO_ROOT / "cli" / "pyproject.toml"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def run_script(*args):
|
|
15
|
+
result = subprocess.run(
|
|
16
|
+
[sys.executable, str(SCRIPT), *args],
|
|
17
|
+
capture_output=True,
|
|
18
|
+
text=True,
|
|
19
|
+
check=True,
|
|
20
|
+
)
|
|
21
|
+
return result.stdout.strip()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_bump_patch_of_file_version(tmp_path):
|
|
25
|
+
target = tmp_path / "pyproject.toml"
|
|
26
|
+
target.write_text(PYPROJECT.read_text())
|
|
27
|
+
old = tomllib.loads(target.read_text())["project"]["version"]
|
|
28
|
+
|
|
29
|
+
printed = run_script(str(target))
|
|
30
|
+
|
|
31
|
+
major, minor, patch = old.split(".")
|
|
32
|
+
assert printed == f"{major}.{minor}.{int(patch) + 1}"
|
|
33
|
+
assert tomllib.loads(target.read_text())["project"]["version"] == printed
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_bump_patch_of_pypi_version(tmp_path):
|
|
37
|
+
"""CI passes the latest PyPI version; the file version is replaced with its successor."""
|
|
38
|
+
target = tmp_path / "pyproject.toml"
|
|
39
|
+
target.write_text(PYPROJECT.read_text())
|
|
40
|
+
|
|
41
|
+
printed = run_script(str(target), "0.1.7")
|
|
42
|
+
|
|
43
|
+
assert printed == "0.1.8"
|
|
44
|
+
assert tomllib.loads(target.read_text())["project"]["version"] == "0.1.8"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_real_pyproject_version_is_bumpable():
|
|
48
|
+
"""The committed version must be plain X.Y.Z or the auto-bump breaks."""
|
|
49
|
+
version = tomllib.loads(PYPROJECT.read_text())["project"]["version"]
|
|
50
|
+
assert all(part.isdigit() for part in version.split("."))
|
|
51
|
+
assert len(version.split(".")) == 3
|
|
@@ -23,7 +23,7 @@ def test_list_with_workspace_option(cli, runner, transport_factory):
|
|
|
23
23
|
assert result.exit_code == 0, result.output
|
|
24
24
|
request = transport.requests[0]
|
|
25
25
|
assert request.method == "GET"
|
|
26
|
-
assert request.url == "
|
|
26
|
+
assert request.url == "https://api.current.orinlabs.ai/api/projects/projects/?workspace=ws-uuid"
|
|
27
27
|
assert request.headers["Authorization"] == "Token tok123"
|
|
28
28
|
|
|
29
29
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|