@temps-sdk/cli 0.1.38 → 0.2.0-beta.1
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.
- package/README.md +14 -0
- package/dist/index.js +10116 -996
- package/dist/skills/temps/SKILL.md +17 -9
- package/dist/skills/temps/evals/evals.json +23 -6
- package/dist/skills/temps/howtos/ci-automation.md +2 -3
- package/dist/skills/temps/howtos/curated-services.md +69 -0
- package/dist/skills/temps/howtos/deploy-application.md +8 -1
- package/dist/skills/temps/howtos/edge-rules.md +135 -0
- package/dist/skills/temps/howtos/managed-services.md +4 -4
- package/dist/skills/temps/howtos/projects-and-monorepos.md +2 -1
- package/dist/skills/temps/references/cli-runtime.md +10 -18
- package/dist/skills/temps/references/commands/INDEX.md +5 -0
- package/dist/skills/temps/references/commands/access.md +4 -0
- package/dist/skills/temps/references/commands/ai.md +4 -0
- package/dist/skills/temps/references/commands/alarms.md +4 -0
- package/dist/skills/temps/references/commands/analytics.md +199 -0
- package/dist/skills/temps/references/commands/apikeys.md +2 -0
- package/dist/skills/temps/references/commands/backups.md +6 -0
- package/dist/skills/temps/references/commands/cloud.md +14 -0
- package/dist/skills/temps/references/commands/configure.md +7 -0
- package/dist/skills/temps/references/commands/context.md +6 -0
- package/dist/skills/temps/references/commands/data.md +10 -13
- package/dist/skills/temps/references/commands/deploy.md +2 -0
- package/dist/skills/temps/references/commands/deployments.md +1 -0
- package/dist/skills/temps/references/commands/domains.md +1 -0
- package/dist/skills/temps/references/commands/drop.md +2 -0
- package/dist/skills/temps/references/commands/edge-rules.md +218 -0
- package/dist/skills/temps/references/commands/email-providers.md +5 -0
- package/dist/skills/temps/references/commands/env-pull.md +2 -0
- package/dist/skills/temps/references/commands/env-push.md +2 -0
- package/dist/skills/temps/references/commands/environments.md +250 -2
- package/dist/skills/temps/references/commands/errors.md +514 -1
- package/dist/skills/temps/references/commands/facets.md +6 -0
- package/dist/skills/temps/references/commands/flags.md +103 -0
- package/dist/skills/temps/references/commands/incidents.md +4 -0
- package/dist/skills/temps/references/commands/init.md +2 -0
- package/dist/skills/temps/references/commands/instances.md +6 -0
- package/dist/skills/temps/references/commands/instantiations.md +4 -0
- package/dist/skills/temps/references/commands/link.md +2 -0
- package/dist/skills/temps/references/commands/login.md +5 -0
- package/dist/skills/temps/references/commands/logs.md +133 -10
- package/dist/skills/temps/references/commands/mcp-servers.md +4 -0
- package/dist/skills/temps/references/commands/mcp.md +8 -1
- package/dist/skills/temps/references/commands/migrate.md +9 -0
- package/dist/skills/temps/references/commands/monitors.md +70 -0
- package/dist/skills/temps/references/commands/network-policy.md +120 -0
- package/dist/skills/temps/references/commands/nodes.md +54 -0
- package/dist/skills/temps/references/commands/notifications.md +24 -2
- package/dist/skills/temps/references/commands/open.md +2 -0
- package/dist/skills/temps/references/commands/otel-forward.md +16 -0
- package/dist/skills/temps/references/commands/platform.md +4 -0
- package/dist/skills/temps/references/commands/plugin.md +30 -1
- package/dist/skills/temps/references/commands/presets.md +2 -0
- package/dist/skills/temps/references/commands/project-groups.md +41 -4
- package/dist/skills/temps/references/commands/projects.md +63 -4
- package/dist/skills/temps/references/commands/providers.md +14 -1
- package/dist/skills/temps/references/commands/revenue.md +4 -0
- package/dist/skills/temps/references/commands/rollback.md +2 -0
- package/dist/skills/temps/references/commands/sandbox.md +91 -1
- package/dist/skills/temps/references/commands/secrets.md +16 -6
- package/dist/skills/temps/references/commands/services.md +6 -0
- package/dist/skills/temps/references/commands/session-replay.md +8 -0
- package/dist/skills/temps/references/commands/skills.md +6 -0
- package/dist/skills/temps/references/commands/start.md +1 -0
- package/dist/skills/temps/references/commands/status-pages.md +276 -9
- package/dist/skills/temps/references/commands/status.md +2 -0
- package/dist/skills/temps/references/commands/surveys.md +165 -0
- package/dist/skills/temps/references/commands/teams.md +14 -0
- package/dist/skills/temps/references/commands/templates.md +8 -2
- package/dist/skills/temps/references/commands/traces.md +58 -0
- package/dist/skills/temps/references/commands/traefik-discovery.md +10 -0
- package/dist/skills/temps/references/commands/tunnels.md +139 -0
- package/dist/skills/temps/references/commands/up.md +2 -0
- package/dist/skills/temps/references/commands/users.md +16 -0
- package/dist/skills/temps/references/commands/webhooks.md +6 -0
- package/dist/skills/temps/references/commands/workflow.md +2 -0
- package/dist/skills/temps/references/commands/workflows.md +216 -0
- package/dist/skills/temps/references/observability/analytics.md +2 -2
- package/dist/skills/temps/references/workflows/platform-operations.md +46 -36
- package/dist/skills/temps/scripts/test_validate_skill.py +25 -66
- package/dist/skills/temps/scripts/validate_skill.py +29 -43
- package/package.json +7 -2
- package/dist/skills/temps/scripts/__pycache__/generate_command_references.cpython-314.pyc +0 -0
- package/dist/skills/temps/scripts/__pycache__/test_generate_command_references.cpython-314.pyc +0 -0
- package/dist/skills/temps/scripts/__pycache__/test_validate_skill.cpython-314.pyc +0 -0
- package/dist/skills/temps/scripts/__pycache__/validate_skill.cpython-314.pyc +0 -0
|
@@ -2,83 +2,42 @@
|
|
|
2
2
|
# SPDX-FileCopyrightText: 2024-2026 Temps Contributors
|
|
3
3
|
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
4
|
|
|
5
|
-
"""Regression tests for the Temps skill validator."""
|
|
6
|
-
|
|
7
|
-
from __future__ import annotations
|
|
8
|
-
|
|
9
5
|
import tempfile
|
|
10
6
|
import unittest
|
|
11
7
|
from pathlib import Path
|
|
8
|
+
from validate_skill import CLI_SKILLS, check_cli_references
|
|
12
9
|
|
|
13
|
-
from validate_skill import GUARDED_SKILLS, check_integrity_pins
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
GUARD = """```bash
|
|
17
|
-
expected_temps_cli_integrity='{pin}'
|
|
18
|
-
actual_temps_cli_integrity="$(npm view @temps-sdk/cli@9.9.9 dist.integrity)"
|
|
19
|
-
```
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def write_skills(root: Path, pins: dict[str, str]) -> None:
|
|
24
|
-
for skill, pin in pins.items():
|
|
25
|
-
skill_root = root / skill
|
|
26
|
-
skill_root.mkdir(parents=True)
|
|
27
|
-
(skill_root / "SKILL.md").write_text(GUARD.format(pin=pin), encoding="utf-8")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class IntegrityPinTests(unittest.TestCase):
|
|
31
|
-
def test_accepts_skills_pinning_the_published_artifact(self) -> None:
|
|
32
|
-
with tempfile.TemporaryDirectory() as directory:
|
|
33
|
-
root = Path(directory)
|
|
34
|
-
write_skills(root, {skill: "sha512-current" for skill in GUARDED_SKILLS})
|
|
35
|
-
|
|
36
|
-
self.assertEqual(check_integrity_pins(root, "sha512-current"), [])
|
|
37
|
-
|
|
38
|
-
def test_rejects_a_pin_left_behind_by_a_version_bump(self) -> None:
|
|
39
|
-
with tempfile.TemporaryDirectory() as directory:
|
|
40
|
-
root = Path(directory)
|
|
41
|
-
write_skills(
|
|
42
|
-
root,
|
|
43
|
-
{
|
|
44
|
-
"temps": "sha512-previous",
|
|
45
|
-
"temps-cli": "sha512-current",
|
|
46
|
-
},
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
errors = check_integrity_pins(root, "sha512-current")
|
|
50
10
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
self.assertIn("sha512-previous", errors[0])
|
|
54
|
-
|
|
55
|
-
def test_rejects_a_skill_with_no_guard_at_all(self) -> None:
|
|
11
|
+
class CliReferenceTests(unittest.TestCase):
|
|
12
|
+
def test_latest_and_source_attribution_are_allowed_but_fixed_invocations_fail(self):
|
|
56
13
|
with tempfile.TemporaryDirectory() as directory:
|
|
57
14
|
root = Path(directory)
|
|
58
|
-
for skill in
|
|
59
|
-
(root / skill).mkdir(
|
|
60
|
-
(root / skill /
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
self.assertEqual(len(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def test_reports_a_missing_guarded_skill(self) -> None:
|
|
15
|
+
for skill in CLI_SKILLS:
|
|
16
|
+
(root / skill).mkdir()
|
|
17
|
+
(root / skill / 'SKILL.md').write_text(
|
|
18
|
+
'Generated from: @temps-sdk/cli@1.2.3\nbunx @temps-sdk/cli@latest --help')
|
|
19
|
+
self.assertEqual(check_cli_references(root), [])
|
|
20
|
+
(root / 'temps/SKILL.md').write_text('npx @temps-sdk/cli@1.2.3 --help')
|
|
21
|
+
self.assertEqual(len(check_cli_references(root)), 1)
|
|
22
|
+
|
|
23
|
+
def test_beta_is_allowed_but_mixing_channels_fails(self):
|
|
68
24
|
with tempfile.TemporaryDirectory() as directory:
|
|
69
25
|
root = Path(directory)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
26
|
+
for skill in CLI_SKILLS:
|
|
27
|
+
(root / skill).mkdir()
|
|
28
|
+
(root / skill / 'SKILL.md').write_text(
|
|
29
|
+
'Generated from: @temps-sdk/cli@0.2.0-beta.1\nbunx @temps-sdk/cli@beta --help')
|
|
30
|
+
self.assertEqual(check_cli_references(root), [])
|
|
31
|
+
(root / 'temps/SKILL.md').write_text('npx @temps-sdk/cli@latest --help')
|
|
32
|
+
errors = check_cli_references(root)
|
|
74
33
|
self.assertEqual(len(errors), 1)
|
|
75
|
-
self.assertIn(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
skills_root = Path(__file__).resolve().parents[2]
|
|
34
|
+
self.assertIn('mix channels', errors[0])
|
|
35
|
+
(root / 'temps/SKILL.md').write_text('npx @temps-sdk/cli@beta.1 --help')
|
|
36
|
+
self.assertIn('stale CLI invocation pin', check_cli_references(root)[0])
|
|
79
37
|
|
|
80
|
-
|
|
38
|
+
def test_checked_in_skills(self):
|
|
39
|
+
self.assertEqual(check_cli_references(Path(__file__).resolve().parents[2]), [])
|
|
81
40
|
|
|
82
41
|
|
|
83
|
-
if __name__ ==
|
|
42
|
+
if __name__ == '__main__':
|
|
84
43
|
unittest.main()
|
|
@@ -12,50 +12,41 @@ from pathlib import Path
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
LINK = re.compile(r"\[[^]]*\]\(([^)]+)\)")
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
errors: list[str] = []
|
|
33
|
-
pins = 0
|
|
34
|
-
for skill in GUARDED_SKILLS:
|
|
35
|
-
skill_root = skills_root / skill
|
|
36
|
-
if not skill_root.is_dir():
|
|
37
|
-
errors.append(f"guarded skill is missing: skills/{skill}")
|
|
15
|
+
CLI_SKILLS = ("temps", "temps-cli", "temps-platform-setup")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Dist-tags the skills may run: `latest` while the documented CLI is a release,
|
|
19
|
+
# `beta` while it is a prerelease. SDK release preparation moves them together.
|
|
20
|
+
CLI_CHANNEL = re.compile(r"@temps-sdk/cli@(latest|beta)(?![\w.-])")
|
|
21
|
+
FIXED_PIN = re.compile(r"(?:bunx|npx) @temps-sdk/cli@(?!(?:latest|beta)(?![\w.-]))[^\s`]+")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def check_cli_references(skills_root: Path) -> list[str]:
|
|
25
|
+
"""Reject fixed version pins and mixed channels while allowing source attribution."""
|
|
26
|
+
errors = []
|
|
27
|
+
channels: dict[str, str] = {}
|
|
28
|
+
for skill in CLI_SKILLS:
|
|
29
|
+
root = skills_root / skill
|
|
30
|
+
if not root.is_dir():
|
|
31
|
+
errors.append(f"missing skill: {skill}")
|
|
38
32
|
continue
|
|
39
|
-
for markdown in
|
|
40
|
-
text = markdown.read_text(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
errors.append(
|
|
50
|
-
"no expected_temps_cli_integrity guard found in "
|
|
51
|
-
f"{', '.join(f'skills/{skill}' for skill in GUARDED_SKILLS)}"
|
|
52
|
-
)
|
|
33
|
+
for markdown in root.rglob("*.md"):
|
|
34
|
+
text = markdown.read_text()
|
|
35
|
+
if FIXED_PIN.search(text):
|
|
36
|
+
errors.append(f"{markdown.relative_to(skills_root)}: stale CLI invocation pin")
|
|
37
|
+
for channel in CLI_CHANNEL.findall(text):
|
|
38
|
+
channels.setdefault(channel, str(markdown.relative_to(skills_root)))
|
|
39
|
+
if "expected_temps_cli_integrity=" in text:
|
|
40
|
+
errors.append(f"{markdown.relative_to(skills_root)}: stale static integrity guard")
|
|
41
|
+
if len(channels) > 1:
|
|
42
|
+
found = ", ".join(f"@{channel} in {path}" for channel, path in sorted(channels.items()))
|
|
43
|
+
errors.append(f"CLI invocations mix channels ({found}); use one channel everywhere")
|
|
53
44
|
return errors
|
|
54
45
|
|
|
55
46
|
|
|
56
47
|
def main() -> int:
|
|
57
48
|
root = Path(__file__).resolve().parents[1]
|
|
58
|
-
errors: list[str] =
|
|
49
|
+
errors: list[str] = check_cli_references(root.parent)
|
|
59
50
|
skill = root / "SKILL.md"
|
|
60
51
|
if len(skill.read_text(encoding="utf-8").splitlines()) > 500:
|
|
61
52
|
errors.append("SKILL.md exceeds 500 lines")
|
|
@@ -68,11 +59,6 @@ def main() -> int:
|
|
|
68
59
|
path_text = target.split("#", 1)[0]
|
|
69
60
|
if path_text and not (markdown.parent / path_text).resolve().exists():
|
|
70
61
|
errors.append(f"{markdown.relative_to(root)}: missing link target {target}")
|
|
71
|
-
for match in re.finditer(r"@temps-sdk/cli(?:@([0-9]+\.[0-9]+\.[0-9]+))?", text):
|
|
72
|
-
if match.group(0) != PINNED_CLI:
|
|
73
|
-
errors.append(
|
|
74
|
-
f"{markdown.relative_to(root)}: unpinned or unexpected CLI reference {match.group(0)}"
|
|
75
|
-
)
|
|
76
62
|
|
|
77
63
|
index = root / "references" / "commands" / "INDEX.md"
|
|
78
64
|
command_files = set((root / "references" / "commands").glob("*.md")) - {index}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temps-sdk/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.0-beta.1",
|
|
4
4
|
"description": "CLI for Temps deployment platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dev": "bun run src/index.ts",
|
|
14
14
|
"clean": "rm -rf dist",
|
|
15
15
|
"prepublishOnly": "bun run clean && bun run build",
|
|
16
|
-
"build": "bun
|
|
16
|
+
"build": "bun run scripts/build.ts",
|
|
17
17
|
"build:bin": "bun build src/index.ts --compile --outfile bin/temps",
|
|
18
18
|
"spec:update": "bun run scripts/update-openapi.ts",
|
|
19
19
|
"spec:check": "bun run scripts/check-openapi.ts",
|
|
@@ -49,5 +49,10 @@
|
|
|
49
49
|
"ora": "^9.0.0",
|
|
50
50
|
"react": "^19.2.3",
|
|
51
51
|
"ws": "^8.21.2"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/gotempsh/temps.git",
|
|
56
|
+
"directory": "apps/temps-cli"
|
|
52
57
|
}
|
|
53
58
|
}
|
|
Binary file
|
package/dist/skills/temps/scripts/__pycache__/test_generate_command_references.cpython-314.pyc
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|