Skip to content

feat: add logs:edge-functions command and historical log support#7944

Open
biilmann wants to merge 10 commits intomainfrom
logs-for-agents
Open

feat: add logs:edge-functions command and historical log support#7944
biilmann wants to merge 10 commits intomainfrom
logs-for-agents

Conversation

@biilmann
Copy link
Member

Summary

  • Add logs:edge-functions command for streaming and historical edge function logs
  • Add --from/--to date options to logs:function and logs:edge-functions for historical log fetching via the analytics API
  • Add --deploy-id option to both commands to look up functions from a specific deploy
  • Accept function ID (not just name) as argument to logs:function
  • Show CLI log command hints in deploy output when functions or edge functions are deployed
  • Create shared log-api.ts utility for date parsing, REST API fetching, and log formatting

New files

  • src/commands/logs/log-api.ts — shared utilities for historical log fetching
  • src/commands/logs/edge-functions.ts — edge function log handler
  • tests/integration/commands/logs/edge-functions.test.ts — tests for logs:edge-functions

Test plan

  • npm run typecheck — no new type errors
  • npm exec vitest -- run tests/integration/commands/logs/ — all 15 tests pass
  • npm exec vitest -- run tests/integration/commands/deploy/ — 39/40 pass (1 pre-existing failure)
  • Manual: ./bin/run.js logs:function --help shows --from, --to, --deploy-id options
  • Manual: ./bin/run.js logs:edge-functions --help shows all options
  • Manual: Deploy with functions and verify CLI hints appear in output

🤖 Generated with Claude Code

Add edge function log streaming and historical log fetching for both
function and edge function logs. The deploy command output now shows
CLI hints for accessing logs when functions are deployed.

- Add `logs:edge-functions` command with WebSocket streaming and
  historical mode via `--from`/`--to`
- Add `--from`/`--to` date options to `logs:function` for historical
  log fetching via analytics API
- Add `--deploy-id` option to `logs:function` and `logs:edge-functions`
  to look up functions from a specific deploy
- Accept function ID (not just name) in `logs:function`
- Show function/edge-function CLI log hints in deploy output
- Create shared `log-api.ts` utility for date parsing, API fetching,
  and log formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@biilmann biilmann requested a review from a team as a code owner February 13, 2026 07:43
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

📊 Benchmark results

Comparing with de4d92d

  • Dependency count: 1,073 (no change)
  • Package size: 325 MB (no change)
  • Number of ts-expect-error directives: 364 (no change)

biilmann and others added 7 commits February 13, 2026 00:09
The deploy API response doesn't include an edge_functions_count field.
Thread the edgeFunctionsCount from deploySite's local hashing step
through to the deploy output so edge function log hints display
correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…g sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…g sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…g sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add proper type assertions to eliminate unsafe-any and non-null
assertion lint errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
biilmann and others added 2 commits February 13, 2026 09:56
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@biilmann biilmann requested a review from a team as a code owner February 13, 2026 18:01
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