Skip to content

feat(cli): add beam project call - #4897

Open
ali-beamable wants to merge 1 commit into
mainfrom
claude/awesome-meitner-9jx5js-project-call
Open

ali-beamable wants to merge 1 commit into
mainfrom
claude/awesome-meitner-9jx5js-project-call

Conversation

@ali-beamable

Copy link
Copy Markdown
Collaborator

Ticket

None. This comes from an agent-friendliness review of building a web game with the CLI and Web SDK.

Brief Description

The command is beam project call <Service> <Method> [--payload <json>] [--as guest|<refresh-token>] [--target auto|local|remote]. It calls a [ClientCallable] endpoint as a player, so an agent can play a whole match from the CLI instead of automating a browser.

  • Request: POST /basic/{cid}.{pid}.micro_{service}/{method} with X-BEAM-SCOPE and the player's bearer token, matching the Web SDK's makeMicroServiceRequest.
  • --payload must be a JSON object keyed by parameter name (default {}). It is validated before any guest is created.
  • --as: guest (the default) creates a new guest player. Anything else is exchanged as a player refresh token.
  • --target:
    • local sends this machine's routing key.
    • remote sends none, so the call goes to the deployed service.
    • auto (the default) looks for about 1s for a locally running instance and uses it if found, otherwise the deployed service.
  • Result: status, body, target, routingKey, url, playerId, and refreshToken (pass it to --as to stay the same player). A non-2xx response is reported, then the command exits non-zero.
  • Sending: requests go through a new MicroserviceHttpCaller service, because CliRequester always signs as the CLI's admin user and can't use a player token.
  • Unity bindings: produced with generate-interface.

Checklist

  • Have you added appropriate text to the CHANGELOG.md files?

Notes

  • Tests: ProjectCallFlows covers a guest call with the route, payload and headers; a refresh token with local routing; a non-2xx status; invalid payloads; and the route/header builders.
  • Not tested: the auto discovery path, and calls against a live realm or a running service.
  • Follow-up: the MCP instructions and skill mentions are in the agent-docs PR.
  • Tech-debt: none.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SR1QFkbVnMgqpzAeej2HHv


Generated by Claude Code

Calling a [ClientCallable] endpoint as a player used to need a game
client or a browser. `beam project call <service> <method>` POSTs the
--payload JSON object to /basic/{cid}.{pid}.micro_{service}/{method}
with X-BEAM-SCOPE and the player's bearer token, matching the web SDK's
makeMicroServiceRequest.

--as guest (default) creates a new guest; any other value is exchanged
as a player refresh token. --target local sends this machine's routing
key (micro_{service}:{key}), remote sends none, and auto (default)
discovers a locally running instance for a second and uses its routing
key, falling back to the deployed service.

The result carries status, body, target, routingKey, url, playerId and
the refreshToken to reuse the same player. A non-2xx response is still
reported, then the command exits non-zero. An invalid --payload fails
before any guest is created. Covered by ProjectCallFlows; Unity bindings and
changelog are updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1QFkbVnMgqpzAeej2HHv
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Lightbeam link

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants