You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add service exec and resolve IDs from service (#173)
## Summary
- Add `zeabur service exec` command to run commands inside service
containers via the `executeCommand` GraphQL mutation
- Remove context-based ID resolution from all commands — when a service
ID is provided, environment and project IDs are now derived from the
service itself instead of relying on project context
- Add `ResolveEnvironmentIDByServiceID` helper to `internal/util/env.go`
## Motivation
The old design resolved environment IDs from the project context, which
could point to a completely different project than the service belongs
to, causing `NOT_RUNNING_SERVICE` errors even when the service is
active.
Now: service ID → fetch service → get project ID → resolve environment.
No more wrong env IDs.
## Changed commands (32 files)
- **New**: `service exec` — execute commands in service containers
- **Service**: restart, redeploy, suspend, delete, expose, get, metric,
instruction, network, update/tag, list, deploy
- **Domain**: create, list, delete
- **Variable**: create, list, update, delete, env
- **Deployment**: get, list, log
- **Other**: deploy, upload
## Test plan
- [ ] `go build ./...` and `go test ./...` pass
- [ ] `zeabur service exec --id <svc> -- ls` resolves env from service's
project
- [ ] `zeabur service restart --id <svc>` no longer requires project
context
- [ ] Interactive mode still prompts correctly when no flags provided
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added `service exec` command to execute commands inside service
containers with results and exit codes.
* Added `--region` flag to template deployment for automatic project
creation in specified regions.
* **Refactor**
* Simplified command parameter resolution and validation for improved
reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments