feat: add apify api subcommand for direct API access#1076
Draft
patrikbraborec wants to merge 3 commits intomasterfrom
Draft
feat: add apify api subcommand for direct API access#1076patrikbraborec wants to merge 3 commits intomasterfrom
apify api subcommand for direct API access#1076patrikbraborec wants to merge 3 commits intomasterfrom
Conversation
Add a general-purpose authenticated HTTP client for the Apify API, similar to `gh api` in GitHub CLI. Supports GET/POST/PUT/PATCH/DELETE methods, request body (including stdin), custom headers, and a --list-endpoints flag powered by the bundled OpenAPI spec. Closes #1075 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add missing `return` after `printHelp()` to prevent fetch with undefined endpoint - Make build resilient to network failures by falling back to committed api-endpoints.json - Commit api-endpoints.json so fresh checkouts work without network access - Wrap test cleanup in try/finally to prevent actor leak on assertion failure Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…y params, and lint fix Add support for positional HTTP method syntax (e.g. `apify api GET /v2/users/me`), auto-prepend `v2/` prefix when omitted, add `--params` flag for query parameters, use `getLoggedClientOrThrow` for auth, switch to `simpleLog` for output, validate JSON body before sending, and fix prefer-destructuring lint error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Adds
apify api— a general-purpose authenticated HTTP client for the Apify API, inspired bygh api.apify api v2/users/me— make authenticated GET requestsapify api v2/acts --method POST --body '{...}'— create resourcesapify api --list-endpoints— browse all 129 API endpoints (from bundled OpenAPI spec)Features
--method/-X(GET, POST, PUT, PATCH, DELETE)--body/-d(JSON string or stdin with-)--header/-H--list-endpoints/-l— lists all available endpoints with color-coded methods and descriptions, powered by the Apify OpenAPI spec fetched at build timeCloses #1075
🤖 Generated with Claude Code