hookstride-cli 0.2.0__tar.gz → 0.3.0__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.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.5
2
+ Name: hookstride-cli
3
+ Version: 0.3.0
4
+ Summary: Manage Hookstride projects and destinations, inspect webhook activity and billing.
5
+ License: Proprietary
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: click<9,>=8.1
8
+ Requires-Dist: httpx<1,>=0.28
9
+ Requires-Dist: prompt-toolkit<4,>=3.0.52
10
+ Requires-Dist: rich<15,>=14
11
+ Requires-Dist: typer<1,>=0.20
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Hookstride CLI
15
+
16
+ Hookstride CLI lets you manage projects and webhook destinations, inspect delivery activity, and view billing records. It includes an interactive console with the same selected-project commands.
17
+
18
+ Version 0.3.0 adds project creation and updates, plus destination creation, updates, and pausing/resuming. Billing and credential changes, delivery replay, and destructive operations remain unavailable.
19
+
20
+ ## Installation
21
+
22
+ Requires Python 3.11 or later.
23
+
24
+ ```bash
25
+ uv tool install hookstride-cli
26
+ ```
27
+
28
+ Alternatively, use `pipx install hookstride-cli`.
29
+
30
+ ```bash
31
+ hookstride --version
32
+ hookstride status
33
+ hookstride console
34
+ ```
35
+
36
+ Upgrade an existing installation with `uv tool upgrade hookstride-cli`.
37
+
38
+ ## Authentication
39
+
40
+ Authenticated commands require a **Control API token** (`whrctl_`), available from your Hookstride dashboard. Project delivery API keys (`whrk_`) do not grant CLI access.
41
+
42
+ In an interactive console, run `auth login` and enter the token at the hidden prompt:
43
+
44
+ ```bash
45
+ hookstride console
46
+ ```
47
+
48
+ For one-off commands, set `HOOKSTRIDE_CONTROL_TOKEN` in your shell without entering it on the command line:
49
+
50
+ ```bash
51
+ read -rs "HOOKSTRIDE_CONTROL_TOKEN?Control token: "
52
+ echo
53
+ export HOOKSTRIDE_CONTROL_TOKEN
54
+ hookstride auth status
55
+ ```
56
+
57
+ The `read` example above works in **zsh**. In Bash, use `read -rs -p "Control token: " HOOKSTRIDE_CONTROL_TOKEN` followed by `echo` and `export HOOKSTRIDE_CONTROL_TOKEN`.
58
+
59
+ Tokens entered through `auth login` are retained only for the interactive console session. The CLI does not write tokens to its settings file.
60
+
61
+ ## Commands
62
+
63
+ ```bash
64
+ hookstride status
65
+ hookstride auth status
66
+ hookstride projects list
67
+ hookstride projects use PROJECT_UUID
68
+ hookstride projects create --account ACCOUNT_UUID --name "Staging" --slug staging
69
+ hookstride projects update PROJECT_UUID --name "Production EU"
70
+
71
+ hookstride destinations list
72
+ hookstride destinations create --name "Webhook receiver" --url "https://app.example.com/webhooks/hookstride"
73
+ hookstride destinations update DESTINATION_UUID --url "https://api.example.com/webhooks/hookstride"
74
+ hookstride destinations update DESTINATION_UUID --pause
75
+ hookstride destinations update DESTINATION_UUID --resume
76
+ hookstride keys list
77
+ hookstride events list --status failed
78
+ hookstride events show EVENT_UUID
79
+ hookstride stats
80
+
81
+ hookstride incoming sources
82
+ hookstride incoming routes
83
+ hookstride incoming bindings
84
+ hookstride incoming registration-keys
85
+
86
+ hookstride billing status
87
+ hookstride billing history
88
+ hookstride config show
89
+ ```
90
+
91
+ Replace the example UUIDs with identifiers from your account. Find your workspace's `account_id` with `hookstride --json projects list`; that ID is required for project creation. Project creation and renaming require an admin/owner role. Destination changes require developer access or higher.
92
+
93
+ Commands that operate on a project use the selected project. You can override the selection for an individual command:
94
+
95
+ ```bash
96
+ hookstride --project PROJECT_UUID events list
97
+ ```
98
+
99
+ ### Interactive console
100
+
101
+ ```bash
102
+ hookstride console
103
+ ```
104
+
105
+ Use `help` to view commands, Tab for completion, and `exit` or Ctrl+D to leave. The console also supports `show projects`, `show events`, `show destinations`, `use PROJECT_UUID`, `back`, and `set env dev|production`. The same `projects create/update` and `destinations create/update` commands work inside the console. Commands with customer-provided names and URLs are not saved to console history.
106
+
107
+ ### JSON output
108
+
109
+ Use `--json` before a command to retrieve structured data for scripts:
110
+
111
+ ```bash
112
+ hookstride --json projects list
113
+ hookstride --project PROJECT_UUID --json events list --status failed
114
+ hookstride --env production --json billing history
115
+ ```
116
+
117
+ Errors go to standard error; unsuccessful requests return a nonzero exit code. When creating a destination, the server returns a signing secret **once**. Save it securely immediately. Both terminal output and `--json` deliberately include that one-time secret, so avoid piping creation output into logs or public CI artifacts.
118
+
119
+ ## Environments and local settings
120
+
121
+ The CLI connects to the production API by default: `https://api.hookstride.com`.
122
+ A new release must be published to PyPI before existing installations receive this change.
123
+
124
+ To inspect the development API explicitly, select it:
125
+
126
+ ```bash
127
+ hookstride --env dev console
128
+ ```
129
+
130
+ Development requests use `https://api-dev.hookstride.com`. Use a Control API token issued for the selected environment. A custom HTTPS API origin can be supplied with `--api-url`.
131
+
132
+ Project selections are stored separately by environment in `~/.config/hookstride/settings.json`. This file contains project identifiers, **not authentication tokens**. Console tokens and command history remain in memory and are discarded at exit.
133
+
134
+ ## Documentation
135
+
136
+ Documentation: https://hookstride.com
@@ -0,0 +1,123 @@
1
+ # Hookstride CLI
2
+
3
+ Hookstride CLI lets you manage projects and webhook destinations, inspect delivery activity, and view billing records. It includes an interactive console with the same selected-project commands.
4
+
5
+ Version 0.3.0 adds project creation and updates, plus destination creation, updates, and pausing/resuming. Billing and credential changes, delivery replay, and destructive operations remain unavailable.
6
+
7
+ ## Installation
8
+
9
+ Requires Python 3.11 or later.
10
+
11
+ ```bash
12
+ uv tool install hookstride-cli
13
+ ```
14
+
15
+ Alternatively, use `pipx install hookstride-cli`.
16
+
17
+ ```bash
18
+ hookstride --version
19
+ hookstride status
20
+ hookstride console
21
+ ```
22
+
23
+ Upgrade an existing installation with `uv tool upgrade hookstride-cli`.
24
+
25
+ ## Authentication
26
+
27
+ Authenticated commands require a **Control API token** (`whrctl_`), available from your Hookstride dashboard. Project delivery API keys (`whrk_`) do not grant CLI access.
28
+
29
+ In an interactive console, run `auth login` and enter the token at the hidden prompt:
30
+
31
+ ```bash
32
+ hookstride console
33
+ ```
34
+
35
+ For one-off commands, set `HOOKSTRIDE_CONTROL_TOKEN` in your shell without entering it on the command line:
36
+
37
+ ```bash
38
+ read -rs "HOOKSTRIDE_CONTROL_TOKEN?Control token: "
39
+ echo
40
+ export HOOKSTRIDE_CONTROL_TOKEN
41
+ hookstride auth status
42
+ ```
43
+
44
+ The `read` example above works in **zsh**. In Bash, use `read -rs -p "Control token: " HOOKSTRIDE_CONTROL_TOKEN` followed by `echo` and `export HOOKSTRIDE_CONTROL_TOKEN`.
45
+
46
+ Tokens entered through `auth login` are retained only for the interactive console session. The CLI does not write tokens to its settings file.
47
+
48
+ ## Commands
49
+
50
+ ```bash
51
+ hookstride status
52
+ hookstride auth status
53
+ hookstride projects list
54
+ hookstride projects use PROJECT_UUID
55
+ hookstride projects create --account ACCOUNT_UUID --name "Staging" --slug staging
56
+ hookstride projects update PROJECT_UUID --name "Production EU"
57
+
58
+ hookstride destinations list
59
+ hookstride destinations create --name "Webhook receiver" --url "https://app.example.com/webhooks/hookstride"
60
+ hookstride destinations update DESTINATION_UUID --url "https://api.example.com/webhooks/hookstride"
61
+ hookstride destinations update DESTINATION_UUID --pause
62
+ hookstride destinations update DESTINATION_UUID --resume
63
+ hookstride keys list
64
+ hookstride events list --status failed
65
+ hookstride events show EVENT_UUID
66
+ hookstride stats
67
+
68
+ hookstride incoming sources
69
+ hookstride incoming routes
70
+ hookstride incoming bindings
71
+ hookstride incoming registration-keys
72
+
73
+ hookstride billing status
74
+ hookstride billing history
75
+ hookstride config show
76
+ ```
77
+
78
+ Replace the example UUIDs with identifiers from your account. Find your workspace's `account_id` with `hookstride --json projects list`; that ID is required for project creation. Project creation and renaming require an admin/owner role. Destination changes require developer access or higher.
79
+
80
+ Commands that operate on a project use the selected project. You can override the selection for an individual command:
81
+
82
+ ```bash
83
+ hookstride --project PROJECT_UUID events list
84
+ ```
85
+
86
+ ### Interactive console
87
+
88
+ ```bash
89
+ hookstride console
90
+ ```
91
+
92
+ Use `help` to view commands, Tab for completion, and `exit` or Ctrl+D to leave. The console also supports `show projects`, `show events`, `show destinations`, `use PROJECT_UUID`, `back`, and `set env dev|production`. The same `projects create/update` and `destinations create/update` commands work inside the console. Commands with customer-provided names and URLs are not saved to console history.
93
+
94
+ ### JSON output
95
+
96
+ Use `--json` before a command to retrieve structured data for scripts:
97
+
98
+ ```bash
99
+ hookstride --json projects list
100
+ hookstride --project PROJECT_UUID --json events list --status failed
101
+ hookstride --env production --json billing history
102
+ ```
103
+
104
+ Errors go to standard error; unsuccessful requests return a nonzero exit code. When creating a destination, the server returns a signing secret **once**. Save it securely immediately. Both terminal output and `--json` deliberately include that one-time secret, so avoid piping creation output into logs or public CI artifacts.
105
+
106
+ ## Environments and local settings
107
+
108
+ The CLI connects to the production API by default: `https://api.hookstride.com`.
109
+ A new release must be published to PyPI before existing installations receive this change.
110
+
111
+ To inspect the development API explicitly, select it:
112
+
113
+ ```bash
114
+ hookstride --env dev console
115
+ ```
116
+
117
+ Development requests use `https://api-dev.hookstride.com`. Use a Control API token issued for the selected environment. A custom HTTPS API origin can be supplied with `--api-url`.
118
+
119
+ Project selections are stored separately by environment in `~/.config/hookstride/settings.json`. This file contains project identifiers, **not authentication tokens**. Console tokens and command history remain in memory and are discarded at exit.
120
+
121
+ ## Documentation
122
+
123
+ Documentation: https://hookstride.com
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hookstride-cli"
7
- version = "0.2.0"
8
- description = "Readable, project-scoped Hookstride Control API terminal client."
7
+ version = "0.3.0"
8
+ description = "Manage Hookstride projects and destinations, inspect webhook activity and billing."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
11
  license = { text = "Proprietary" }
@@ -1,3 +1,3 @@
1
1
  """Hookstride developer CLI."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.3.0"
@@ -1,8 +1,7 @@
1
- """Interactive, read-only Hookstride console.
1
+ """Interactive Hookstride console with allowlisted project and destination writes.
2
2
 
3
- The console intentionally does not execute shell commands. It uses the same
4
- project-scoped Control API commands as the CLI, keeps tokens only in memory,
5
- and stores no history on disk.
3
+ The console never executes shell commands, retains tokens only in memory,
4
+ and stores no command history on disk.
6
5
  """
7
6
 
8
7
  from __future__ import annotations
@@ -25,11 +24,11 @@ from typer.main import get_command
25
24
  from . import main as cli
26
25
 
27
26
  # Only these typed commands may execute through the console.
28
- # Future write actions must be explicitly reviewed, not implicitly unlocked.
29
- READ_COMMANDS: dict[str, set[str]] = {
27
+ # Write actions are intentionally allowlisted, never automatically unlocked.
28
+ ALLOWED_COMMANDS: dict[str, set[str]] = {
30
29
  "auth": {"status"},
31
- "projects": {"list", "use"},
32
- "destinations": {"list"},
30
+ "projects": {"list", "use", "create", "update"},
31
+ "destinations": {"list", "create", "update"},
33
32
  "keys": {"list"},
34
33
  "events": {"list", "show"},
35
34
  "billing": {"status", "history"},
@@ -38,7 +37,7 @@ READ_COMMANDS: dict[str, set[str]] = {
38
37
  }
39
38
  ROOT_COMMANDS = {"status", "stats"}
40
39
 
41
- # Aliases that feel like a familiar operator console, but remain read-only.
40
+ # Aliases that feel like a familiar operator console.
42
41
  SHOW_TARGETS: dict[str, tuple[str, ...] | None] = {
43
42
  "options": None,
44
43
  "projects": ("projects", "list"),
@@ -72,6 +71,8 @@ COMMAND_COMPLETIONS = sorted(
72
71
  *SAFE_HISTORY_COMMANDS,
73
72
  "use ", "projects use ", "events show ", "events list --status ",
74
73
  "events list --origin ", "events list --page ", "set project ",
74
+ "projects create --name ", "projects update ",
75
+ "destinations create --name ", "destinations update ",
75
76
  "set env ", "json ", "show ", "auth ",
76
77
  }
77
78
  )
@@ -194,6 +195,8 @@ class HookstrideConsole:
194
195
  "[bold]help[/bold] Show console help\n"
195
196
  "[bold]show options[/bold] Display environment, project and authentication\n"
196
197
  "[bold]show projects[/bold] List accessible projects\n"
198
+ "[bold]projects create --name N --account UUID[/bold] Create a project\n"
199
+ "[bold]projects update UUID --name N[/bold] Rename a project\n"
197
200
  "[bold]use UUID[/bold] Select a project (also saves preference)\n"
198
201
  "[bold]back[/bold] Leave the active project context\n"
199
202
  "[bold]set env dev[/bold] Switch to development API\n"
@@ -202,6 +205,8 @@ class HookstrideConsole:
202
205
  "[bold]auth logout[/bold] Clear the current environment's session token\n"
203
206
  "[bold]auth status[/bold] Validate current token\n"
204
207
  "[bold]show destinations[/bold] Inspect outgoing webhooks\n"
208
+ "[bold]destinations create --name N --url HTTPS_URL[/bold] Add receiver\n"
209
+ "[bold]destinations update UUID --pause[/bold] Pause a receiver\n"
205
210
  "[bold]show events[/bold] View recent events\n"
206
211
  "[bold]events list --status failed[/bold] Filter delivery history\n"
207
212
  "[bold]events show UUID[/bold] Inspect a delivery and attempts\n"
@@ -223,7 +228,6 @@ class HookstrideConsole:
223
228
  ["API", self.session.origin],
224
229
  ["Project", project],
225
230
  ["Authenticated token", "configured" if self._current_token() else "missing"],
226
- ["Mode", "read-only"],
227
231
  ]
228
232
  cli._table(_FakeContext(self.session), "Session options", ["Setting", "Value"], rows)
229
233
 
@@ -294,7 +298,7 @@ class HookstrideConsole:
294
298
  self._write("[green]✓[/green] Signed out for this console environment.")
295
299
 
296
300
  def _execute_cli(self, args: list[str], *, json_output: bool = False) -> None:
297
- """Invoke existing read-only Click/Typer commands, never a shell."""
301
+ """Invoke explicitly allowed Click/Typer commands, never a shell."""
298
302
  if not _allowed_cli(args):
299
303
  raise cli.CLIError("Unknown or unavailable command. Type 'help'.")
300
304
  group = args[0]
@@ -382,7 +386,7 @@ class HookstrideConsole:
382
386
 
383
387
  def run(self) -> None:
384
388
  self._write(
385
- "\n[bold cyan]HOOKSTRIDE[/bold cyan] [dim]CONSOLE v0.2[/dim]\n"
389
+ f"\n[bold cyan]HOOKSTRIDE[/bold cyan] [dim]CONSOLE v{cli.VERSION}[/dim]\n"
386
390
  "[dim]Type 'help' for commands, 'auth login' for a token, "
387
391
  "or 'exit' to quit.[/dim]\n"
388
392
  )
@@ -431,8 +435,8 @@ def _allowed_cli(parts: list[str]) -> bool:
431
435
  return len(parts) == 1
432
436
  return (
433
437
  len(parts) >= 2
434
- and parts[0] in READ_COMMANDS
435
- and parts[1] in READ_COMMANDS[parts[0]]
438
+ and parts[0] in ALLOWED_COMMANDS
439
+ and parts[1] in ALLOWED_COMMANDS[parts[0]]
436
440
  )
437
441
 
438
442