Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
.DS_Store

/swagger/
openapi*
openapi*
internal/workflow_client/*.md
46 changes: 19 additions & 27 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stable `--json` output, config comes from env vars, and `skill/SKILL.md`
documents the CLI's contract for AI agents driving it. The primary
agent-facing scenario is *ship a vibe-coded app*: `eds repo create` +
`git push` gets code hosted, `eds wf app create` publishes it (auto-deploy
on create), and `eds wf app status` (or the lower-level `eds wf run`/
on create), and `eds wf app show` (or the lower-level `eds wf run`/
`eds wf job`) tracks the rollout.

## Commands
Expand Down Expand Up @@ -59,19 +59,20 @@ genuinely internal and not tied to where the repo lives.

## Architecture

Cobra-based CLI, one command per file under `cmd/`, thin API clients under
`internal/repoapi/` (Repo product) and `internal/workflowapi/` (Workflow
Studio).
Cobra-based CLI, one command per file under `cmd/`, thin API client under
`internal/repoapi/` (Repo product) and generated OpenAPI client under
`internal/workflow_client/` (Workflow Studio).

- `main.go` — entry point, wires `main.version` (ldflags) into `cmd.SetVersion`.
- `cmd/root.go` — builds the root `eds` command, registers global persistent
flags. Product-scoped: `--repo-api-url`, `--repo-git-host`
(Repo product); `--wf-api-url` (Workflow Studio). Platform-level (shared,
unprefixed): `--project`, `--api-key`. Plus `--json`, `--quiet`.
the API client and printer.
- `cmd/helpers.go` — `resolveContext(cmd)` is the entry point every subcommand
calls first. It loads config, layers flag overrides on top (flags > env >
file > defaults), and builds a `runtimeContext{Cfg, API, WorkflowAPI,
Printer, Quiet}`. `requireAPIKey()` guards Repo-product commands.
file > defaults), and builds a `runtimeContext{Cfg, API, Printer, Quiet,
ProjectID, WorkflowClient}`. `requireAPIKey()` guards Repo-product commands.
`ensureWorkflowAuth(ctx)` guards Workflow Studio commands: it validates
that `APIKey` is set (the same key is used for both products). Both helpers
return the same friendly error when the key is missing.
Expand All @@ -84,15 +85,11 @@ Studio).
`newRunCmd()`, `newJobCmd()` as children. Doesn't hold any logic itself.
- `cmd/app.go`, `cmd/run.go`, `cmd/job.go` — Workflow Studio subcommand
trees, nested under `eds wf`. `app.go` holds `eds wf app create|list|show|
update|delete|deploy|deployments|status` (an **application** wires a
update|delete|deploy|deployments` (an **application** wires a
repo+branch to a deploy pipeline; a **deployment** runs that pipeline and
publishes it). `app create --repository` reuses `resolveRepoID` from
`repo.go` to accept either a Repo-product UUID or name. `app status` is a
convenience wrapper: it fetches the application (whose `run` field already
embeds stage/job status) plus its most recent deployment (for the live
URL) in one call. `run.go`/`job.go` are the lower-level primitives behind
it. `job.go`'s `logs` command reads the job-logs endpoint as SSE and
prints each `data:` line to stdout.
`repo.go` to accept either a Repo-product UUID or name. `run.go`/`job.go`
are the lower-level primitives behind it.
Note (observed empirically, not documented in the spec): `application.status`
and `application.run.status` are separate lifecycles. Creating an
application auto-triggers its first run; even after `run.status` reaches
Expand Down Expand Up @@ -133,18 +130,13 @@ Studio).
`/project/{projectID}/repository[ies]`. `ListRepositories` omits the
`search` query param entirely when empty — the API treats an empty string
as a literal (matches nothing) rather than a wildcard.
- `internal/workflowapi/client.go` — the Workflow Studio counterpart to
`repoapi/client.go`: same `Do`/`APIError`/request-id shape, sends
`X-API-KEY` (the same key as Repo), has no built-in request timeout
(bounded by the caller's context instead, since `logs` can stay open for
a running job), and adds `Stream` for reading an SSE response body
line-by-line.
- `internal/workflowapi/application.go`, `run.go`, `job.go` —
application/deployment, run/stage, and job request/response types plus
the API calls, all scoped under `/project/{projectID}/...`.
- `openapi-user.yaml` — OpenAPI (Swagger 2.0) spec for the Workflow Studio
user API; the source of truth for request/response shapes when extending
- `internal/workflow_client/` — generated OpenAPI client for the Workflow
Studio user API (from `openapi-public.yaml`). Covers services, pipelines,
and workflows APIs. `cmd/` calls into this instead of the older hand-written
`internal/workflowapi`.
- `openapi-public.yaml` — OpenAPI (Swagger 2.0) spec for the Workflow Studio
user API; the source of truth for request/response shapes and for regenerating
`internal/workflow_client`.
- `swagger/swagger.yaml` — OpenAPI spec for the upstream Repo API; the source
of truth for request/response shapes when extending `internal/repoapi`.
`swagger/swagger.ru.yaml` is a Russian-translated copy (all `summary`/
Expand All @@ -167,9 +159,9 @@ Studio).
If it hits a Repo-product API, call `ctx.requireAPIKey()`. If it hits a
Workflow Studio API, call `ctx.ensureWorkflowAuth(cmd.Context())` — both
validate that `EDS_API_KEY` is set.
- Every subcommand that returns structured data should support both table
(default on TTY) and `--json` output via `ctx.Printer`, not ad-hoc
`fmt.Println`.
- Repo subcommands that return structured data support both table (default
on TTY) and `--json` output via `ctx.Printer`. Workflow Studio subcommands
currently output JSON only.
- `eds repo` commands (and `eds wf app create --repository`) accept either a
repository UUID or a name (`resolveRepoID` / `looksLikeUUID`); don't
require callers to look up IDs first.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ eds wf app update <id> --branch B [--name N] update name/branch
eds wf app delete <id> [--force] delete an application
eds wf app deploy <id> run the pipeline and publish
eds wf app deployments <id> list publish history
eds wf app status <id> run status + live URL

eds wf run show <id> show a run's status, stages and jobs
eds wf run stop <id> stop a running run
Expand Down Expand Up @@ -193,23 +192,24 @@ APP_ID=$(eds wf app create my-site --repository "$REPO_ID" --branch main --json
# status) because "publishing" can last well after the run already reports
# "done".
for i in $(seq 1 20); do
STATUS=$(eds wf app status "$APP_ID" --json | jq -r '.application.status')
STATUS=$(eds wf app show "$APP_ID" --json | jq -r '.status')
echo "status: $STATUS"
[ "$STATUS" = "running" ] || [ "$STATUS" = "error" ] && break
sleep 15
done
eds wf app status "$APP_ID" --json | jq '{status: .application.status, url: .latest_deployment.url}'
URL=$(eds wf app deployments "$APP_ID" --json | jq -r '.deployments[0].url')
echo "url: $URL"
```

If a deployment fails, drill into the failing job's logs:

```bash
eds wf app status "$APP_ID" --json | jq -r '.application.run.stages[].jobs[] | select(.status=="failed") | .id' \
eds wf app show "$APP_ID" --json | jq -r '.run.stages[].jobs[] | select(.status=="failed") | .id' \
| xargs -I{} eds wf job logs {}
```

`eds wf run` and `eds wf job` are the lower-level primitives behind `eds wf
app status` — use them directly when you need to inspect or control a
app show` — use them directly when you need to inspect or control a
particular run (e.g. `eds wf run stop`) or stream job logs (`eds wf job logs`).

## File upload / push
Expand Down Expand Up @@ -279,14 +279,14 @@ cmd/
version.go # `eds version`
repo.go # `eds repo list|create|show|delete|clone`
wf.go # `eds wf` parent command (groups app/run/job)
app.go # `eds wf app create|list|show|update|delete|deploy|deployments|status`
app.go # `eds wf app create|list|show|update|delete|deploy|deployments`
run.go # `eds wf run show|stop`
job.go # `eds wf job logs`
internal/
config/ # disk config + env overrides
output/ # JSON / table formatting
repoapi/ # thin HTTP client for the Repo product API
workflowapi/ # thin HTTP client for the Workflow Studio product API
workflow_client/ # generated OpenAPI client for Workflow Studio
scripts/
install.sh # one-liner installer (GitHub Releases by default)
skill/
Expand Down
Loading
Loading