@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.
Files changed (86) hide show
  1. package/README.md +14 -0
  2. package/dist/index.js +10116 -996
  3. package/dist/skills/temps/SKILL.md +17 -9
  4. package/dist/skills/temps/evals/evals.json +23 -6
  5. package/dist/skills/temps/howtos/ci-automation.md +2 -3
  6. package/dist/skills/temps/howtos/curated-services.md +69 -0
  7. package/dist/skills/temps/howtos/deploy-application.md +8 -1
  8. package/dist/skills/temps/howtos/edge-rules.md +135 -0
  9. package/dist/skills/temps/howtos/managed-services.md +4 -4
  10. package/dist/skills/temps/howtos/projects-and-monorepos.md +2 -1
  11. package/dist/skills/temps/references/cli-runtime.md +10 -18
  12. package/dist/skills/temps/references/commands/INDEX.md +5 -0
  13. package/dist/skills/temps/references/commands/access.md +4 -0
  14. package/dist/skills/temps/references/commands/ai.md +4 -0
  15. package/dist/skills/temps/references/commands/alarms.md +4 -0
  16. package/dist/skills/temps/references/commands/analytics.md +199 -0
  17. package/dist/skills/temps/references/commands/apikeys.md +2 -0
  18. package/dist/skills/temps/references/commands/backups.md +6 -0
  19. package/dist/skills/temps/references/commands/cloud.md +14 -0
  20. package/dist/skills/temps/references/commands/configure.md +7 -0
  21. package/dist/skills/temps/references/commands/context.md +6 -0
  22. package/dist/skills/temps/references/commands/data.md +10 -13
  23. package/dist/skills/temps/references/commands/deploy.md +2 -0
  24. package/dist/skills/temps/references/commands/deployments.md +1 -0
  25. package/dist/skills/temps/references/commands/domains.md +1 -0
  26. package/dist/skills/temps/references/commands/drop.md +2 -0
  27. package/dist/skills/temps/references/commands/edge-rules.md +218 -0
  28. package/dist/skills/temps/references/commands/email-providers.md +5 -0
  29. package/dist/skills/temps/references/commands/env-pull.md +2 -0
  30. package/dist/skills/temps/references/commands/env-push.md +2 -0
  31. package/dist/skills/temps/references/commands/environments.md +250 -2
  32. package/dist/skills/temps/references/commands/errors.md +514 -1
  33. package/dist/skills/temps/references/commands/facets.md +6 -0
  34. package/dist/skills/temps/references/commands/flags.md +103 -0
  35. package/dist/skills/temps/references/commands/incidents.md +4 -0
  36. package/dist/skills/temps/references/commands/init.md +2 -0
  37. package/dist/skills/temps/references/commands/instances.md +6 -0
  38. package/dist/skills/temps/references/commands/instantiations.md +4 -0
  39. package/dist/skills/temps/references/commands/link.md +2 -0
  40. package/dist/skills/temps/references/commands/login.md +5 -0
  41. package/dist/skills/temps/references/commands/logs.md +133 -10
  42. package/dist/skills/temps/references/commands/mcp-servers.md +4 -0
  43. package/dist/skills/temps/references/commands/mcp.md +8 -1
  44. package/dist/skills/temps/references/commands/migrate.md +9 -0
  45. package/dist/skills/temps/references/commands/monitors.md +70 -0
  46. package/dist/skills/temps/references/commands/network-policy.md +120 -0
  47. package/dist/skills/temps/references/commands/nodes.md +54 -0
  48. package/dist/skills/temps/references/commands/notifications.md +24 -2
  49. package/dist/skills/temps/references/commands/open.md +2 -0
  50. package/dist/skills/temps/references/commands/otel-forward.md +16 -0
  51. package/dist/skills/temps/references/commands/platform.md +4 -0
  52. package/dist/skills/temps/references/commands/plugin.md +30 -1
  53. package/dist/skills/temps/references/commands/presets.md +2 -0
  54. package/dist/skills/temps/references/commands/project-groups.md +41 -4
  55. package/dist/skills/temps/references/commands/projects.md +63 -4
  56. package/dist/skills/temps/references/commands/providers.md +14 -1
  57. package/dist/skills/temps/references/commands/revenue.md +4 -0
  58. package/dist/skills/temps/references/commands/rollback.md +2 -0
  59. package/dist/skills/temps/references/commands/sandbox.md +91 -1
  60. package/dist/skills/temps/references/commands/secrets.md +16 -6
  61. package/dist/skills/temps/references/commands/services.md +6 -0
  62. package/dist/skills/temps/references/commands/session-replay.md +8 -0
  63. package/dist/skills/temps/references/commands/skills.md +6 -0
  64. package/dist/skills/temps/references/commands/start.md +1 -0
  65. package/dist/skills/temps/references/commands/status-pages.md +276 -9
  66. package/dist/skills/temps/references/commands/status.md +2 -0
  67. package/dist/skills/temps/references/commands/surveys.md +165 -0
  68. package/dist/skills/temps/references/commands/teams.md +14 -0
  69. package/dist/skills/temps/references/commands/templates.md +8 -2
  70. package/dist/skills/temps/references/commands/traces.md +58 -0
  71. package/dist/skills/temps/references/commands/traefik-discovery.md +10 -0
  72. package/dist/skills/temps/references/commands/tunnels.md +139 -0
  73. package/dist/skills/temps/references/commands/up.md +2 -0
  74. package/dist/skills/temps/references/commands/users.md +16 -0
  75. package/dist/skills/temps/references/commands/webhooks.md +6 -0
  76. package/dist/skills/temps/references/commands/workflow.md +2 -0
  77. package/dist/skills/temps/references/commands/workflows.md +216 -0
  78. package/dist/skills/temps/references/observability/analytics.md +2 -2
  79. package/dist/skills/temps/references/workflows/platform-operations.md +46 -36
  80. package/dist/skills/temps/scripts/test_validate_skill.py +25 -66
  81. package/dist/skills/temps/scripts/validate_skill.py +29 -43
  82. package/package.json +7 -2
  83. package/dist/skills/temps/scripts/__pycache__/generate_command_references.cpython-314.pyc +0 -0
  84. package/dist/skills/temps/scripts/__pycache__/test_generate_command_references.cpython-314.pyc +0 -0
  85. package/dist/skills/temps/scripts/__pycache__/test_validate_skill.cpython-314.pyc +0 -0
  86. 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
- self.assertEqual(len(errors), 1)
52
- self.assertIn("temps/SKILL.md", errors[0])
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 GUARDED_SKILLS:
59
- (root / skill).mkdir(parents=True)
60
- (root / skill / "SKILL.md").write_text("no guard", encoding="utf-8")
61
-
62
- errors = check_integrity_pins(root, "sha512-current")
63
-
64
- self.assertEqual(len(errors), 1)
65
- self.assertIn("no expected_temps_cli_integrity guard", errors[0])
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
- write_skills(root, {GUARDED_SKILLS[0]: "sha512-current"})
71
-
72
- errors = check_integrity_pins(root, "sha512-current")
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(f"skills/{GUARDED_SKILLS[1]}", errors[0])
76
-
77
- def test_the_checked_in_skills_pin_the_published_artifact(self) -> None:
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
- self.assertEqual(check_integrity_pins(skills_root), [])
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__ == "__main__":
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
- PINNED_CLI = "@temps-sdk/cli@0.1.38"
16
- # sha512 of the published tarball for PINNED_CLI, as reported by
17
- # `npm view @temps-sdk/cli@<version> dist.integrity`. Refresh it in the same
18
- # commit that bumps PINNED_CLI, once the release is actually on npm — the value
19
- # has no version substring, so a find-and-replace bump silently leaves it stale
20
- # and every preflight guard below fails closed against the new release.
21
- PINNED_CLI_INTEGRITY = "sha512-JMAlVb21dV5UKXg64xoL0bEAzTa0XUEsO6e8Az4jNRy31MaiXqYtgQkcVviC/fgzZqmvdnpHt+K8N5gw6WYL7A=="
22
- INTEGRITY_PIN = re.compile(r"expected_temps_cli_integrity='([^']*)'")
23
- # Skills whose preflight guard installs the pinned CLI. They embed the same
24
- # hash independently, so they are validated together.
25
- GUARDED_SKILLS = ("temps", "temps-cli")
26
-
27
-
28
- def check_integrity_pins(
29
- skills_root: Path, expected: str = PINNED_CLI_INTEGRITY
30
- ) -> list[str]:
31
- """Every CLI preflight guard must pin the same, current package integrity."""
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 sorted(skill_root.rglob("*.md")):
40
- text = markdown.read_text(encoding="utf-8")
41
- for pin in INTEGRITY_PIN.findall(text):
42
- pins += 1
43
- if pin != expected:
44
- errors.append(
45
- f"{markdown.relative_to(skills_root)}: integrity pin {pin} "
46
- f"does not match the published {PINNED_CLI} artifact"
47
- )
48
- if not pins:
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] = check_integrity_pins(root.parent)
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.38",
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 build src/index.ts --outdir dist --target node && sed -i '' '1s|#!/usr/bin/env bun|#!/usr/bin/env node|' dist/index.js && chmod +x dist/index.js && rm -rf dist/skills && mkdir -p dist/skills && cp -R ../../skills/temps dist/skills/temps",
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
  }