feat: project type (Gateway/Outpost/Console), gateway gating, whoami/list/use updates#237
Open
leggetter wants to merge 3 commits intoclaude/hookdeck-gateway-mcp-Xe6WQfrom
Open
feat: project type (Gateway/Outpost/Console), gateway gating, whoami/list/use updates#237leggetter wants to merge 3 commits intoclaude/hookdeck-gateway-mcp-Xe6WQfrom
leggetter wants to merge 3 commits intoclaude/hookdeck-gateway-mcp-Xe6WQfrom
Conversation
…list/use updates - Add project_type to config (gateway, outpost, console) with fallback from project_mode - whoami: show Project type line - project list: show type column; --output json with id, org, project, type, current; --type filter - project use: use normalized list, match by id or org/project display - gateway: PersistentPreRunE requires Gateway project; block on Outpost/Console with clear error - MCP: tool_projects returns type; tool_login persists type; outbound excluded - Acceptance: project list tests require HOOKDECK_CLI_TESTING_CLI_KEY, auth via login --api-key Made-with: Cursor
…ests - TestProjectListFilterByType: project list --type gateway --output json, assert all items type gateway - TestProjectListFilterByOrgProject: project list <org_substring> --output json, assert org contains substring Both require HOOKDECK_CLI_TESTING_CLI_KEY (skip with clear message when unset). Made-with: Cursor
…tests - TestProjectListInvalidType: project list --type invalid returns error (no CLI key) - TestProjectListFilterByOrgAndProject: project list <org> <project> --output json filters by both substrings Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds project type (Gateway, Outpost, Console) across the CLI: config, whoami, project list/use, and gateway gating so that Event Gateway commands only run when the current project is a Gateway project. It also updates MCP tools to expose type and excludes outbound projects from the list.
Changes
project_type(gateway, outpost, console) with fallback from legacyproject_mode; set on login (interactive, client, CI, MCP).Project type: Gateway(or Outpost/Console) line.Org / Project (current?) | Type;--output jsonreturnsid,org,project,type,current;--type gateway|outpost|consolefilter.hookdeck gateway ...subcommands runrequireGatewayProjectinPersistentPreRunE; if the current project is not Gateway, the command fails with a clear error (see below).tool_projectsreturnstype;tool_loginpersists type; outbound projects excluded from list.HOOKDECK_CLI_TESTING_CLI_KEY+hookdeck login --api-keyfor list tests only).Example: whoami
hookdeck whoaminow includes the current project type:Example: project list (human)
Default output format:
Org / Project (current?) | Type.Filter by type:
Example: project list (JSON)
--output jsonreturns an array of objects withid,org,project,type, andcurrent:[ { "id": "proj_abc123", "org": "Acme", "project": "Ecommerce Production", "type": "gateway", "current": true }, { "id": "proj_def456", "org": "Acme", "project": "Ecommerce Staging", "type": "gateway", "current": false }, { "id": "proj_ghi789", "org": "Acme", "project": "Outpost Sender", "type": "outpost", "current": false } ]Example: project use
Switching by project id or by org/project name:
Gateway restriction (only Gateway projects)
All commands under
hookdeck gateway(e.g.gateway connection list,gateway source create,gateway mcp) only run when the current project is a Gateway project. If the current project is Outpost or Console, the command fails before calling the API.This avoids running Event Gateway–specific operations against non-Gateway projects and gives a clear, actionable error.
Example: running a gateway command on a non-Gateway project
If the current project is an Outpost (or Console) project and you run any gateway subcommand:
Same idea for Console:
The user can run
hookdeck project list(optionally with--type gateway) andhookdeck project use <id-or-org/project>to switch to a Gateway project, then re-run the gateway command.Acceptance tests
New in this PR: 7 acceptance tests — 1 whoami subtest and 6 project-list tests (list human, list JSON, invalid --type, filter by type, filter by org, filter by org+project). The table below lists every test that exercises this PR’s behavior (including 2 existing project_use tests in the same file that are not new).
hookdeck whoamiProject type: ...and one of Gateway, Outpost, or Console.hookdeck project use --localwith--hookdeck-config.hookdeck/config.tomland reading it back yields the expected project_id (no API). (existing)hookdeck project listhookdeck project list --output jsonid,org,project,type(gateway, outpost, or console), andcurrent.hookdeck project list --type invalidhookdeck project list --type gateway --output jsontypeequal to"gateway"(filter by type).hookdeck project list <org_substring> --output jsonorgcontains the substring (filter by org).hookdeck project list <org_sub> <project_sub> --output jsonorgandprojectcontain the substrings (filter by org and project).Project list tests (the six
hookdeck project list*rows above, except invalid --type) require a CLI key (HOOKDECK_CLI_TESTING_CLI_KEY), because API and CI keys cannot list or switch projects. When that env var is unset, those tests are skipped with a clear message. When set, the test runner authenticates viahookdeck login --api-key $HOOKDECK_CLI_TESTING_CLI_KEY. Seetest/acceptance/README.mdfor setup.