Skip to content

Add hidden "app logs-next" command - #8938

Draft
rmcnews wants to merge 1 commit into
Shopify:mainfrom
rmcnews:rmc/app-logs-next
Draft

rmcnews wants to merge 1 commit into
Shopify:mainfrom
rmcnews:rmc/app-logs-next

Conversation

@rmcnews

@rmcnews rmcnews commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Important: See https://github.com/shop/issues-develop/issues/24287 for internal info about this.

WHY are these changes introduced?

To provide agentic access to app logs.

WHAT is this pull request doing?

TL;DR: Add historical app log retrieval behind a hidden command, leaving existing commands unchanged.

Adds shopify app logs-next to retrieve webhook delivery logs and GraphQL request logs, with filtering, optional server-side timestamp sorting, existing user authentication, and table/JSON output.

Output JSON starts with only logs, ordering, and limitations. It preserves native record fields and deliberately omits query and the conventional pageInfo: neither is required for this initial retrieval workflow. Pagination is outside this PR and can be added later.

What’s up with fast mode vs sorting?

The command’s --help description explains the distinction:

Fast retrieval is the default: leave out --sort. Prefer this mode with a narrow time window and selective filters to consume less throttle capacity. The CLI orders the returned records oldest first, but they aren't necessarily the oldest or newest matches.

Use server-side sorting only when selecting the oldest or newest matching records matters: --sort timestamp selects oldest first; add --order desc for newest first. This sorts before the result limit and is subject to API query limits.

How to manually test your changes?

Internal notes on how to setup environment: https://github.com/shop/issues-develop/issues/24287#issuecomment-6222604225

Run this branch's CLI from your app directory; it uses the active app configuration.

shopify app logs-next --help
shopify app logs-next --json-schema

Fast unordered retrieval, with the returned subset arranged oldest first, as a table or JSON:

shopify app logs-next --type webhook --since 1h
shopify app logs-next --type webhook --since 1h --json

Server-side timestamp sorting to select the oldest/newest matches, as a table or JSON (oldest first by default; --order desc selects newest first):

shopify app logs-next --type webhook --since 1h --sort timestamp
shopify app logs-next --type webhook --since 1h --sort timestamp --json
shopify app logs-next --type webhook --since 1h --sort timestamp --order desc
shopify app logs-next --type webhook --since 1h --sort timestamp --order desc --json

JSON ordering is subset-timestamp-asc for fast retrieval, or timestamp-asc / timestamp-desc for explicit server sorting before the limit. Prefer fast retrieval for investigating a time window; request server sorting only when selecting the oldest/newest matches matters. Rejected queries surface the API error without falling back to fast retrieval.

Retrieval requires App Logs API access. Confirm app --help hides logs-next.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • I've considered changeset requirements (hidden command; no public release note yet)

Co-authored by AI (GPT-6)

@rmcnews rmcnews changed the title Add hidden historical app logs command Add hidden historical app logs-next command Oct 16, 2026
@rmcnews rmcnews changed the title Add hidden historical app logs-next command Add hidden historical "app logs-next" command Oct 16, 2026
@rmcnews rmcnews changed the title Add hidden historical "app logs-next" command Add hidden "app logs-next" command Oct 16, 2026
@rmcnews
rmcnews force-pushed the rmc/app-logs-next branch 20 times, most recently from a35b10b to ed22e28 Compare October 16, 2026 20:46
Co-authored by AI (GPT-6)

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.

1 participant