Skip to content

feat: Add direct raw file URL for single-file uploads#22

Merged
konard merged 4 commits intomainfrom
issue-21-939659c74a08
Jan 27, 2026
Merged

feat: Add direct raw file URL for single-file uploads#22
konard merged 4 commits intomainfrom
issue-21-939659c74a08

Conversation

@konard
Copy link
Member

@konard konard commented Jan 24, 2026

Summary

When uploading a single log file (not split into chunks), the tool now displays a direct link to the raw file content in addition to the repository/gist URL.

  • For gists: Returns the permanent raw_url from the GitHub API (accessible without authentication, even for secret gists)
  • For repositories: Returns the download_url from the GitHub API (includes token for private repos that enables unauthenticated access)
  • Displays a warning that the token expires in ~10 minutes for private repositories

Example output:

✅ Gist created (🔒 private)
🔗 https://gist.github.com/user/abc123
📄 https://gist.githubusercontent.com/user/abc123/raw/hash/file.log

For private repositories:

✅ Repository created (🔒 private)
🔗 https://github.com/user/log-myfile
📄 https://raw.githubusercontent.com/user/log-myfile/main/myfile.log?token=XXX
⚠️  Note: Raw URL token expires in ~10 minutes for private repositories

Changes

  • src/index.js: Modified uploadAsGist() and uploadAsRepo() to fetch and return raw file URLs via GitHub API
  • src/cli.js: Updated CLI output to display raw URL with appropriate warnings for private repos
  • docs/case-studies/issue-21/: Added case study with research findings on GitHub raw URL mechanisms
  • experiments/test-raw-url.js: Added integration test script for raw URL functionality
  • .changeset/direct-file-link.md: Added changeset for minor version bump

Test plan

  • Linting passes (bun run lint)
  • Unit tests pass (bun run test)
  • Integration test with real gist upload - raw URL is returned and accessible
  • Integration test with real repository upload - raw URL with token is returned
  • Verified token expiration warning is displayed for private repositories
  • Verified no JSON output is echoed during API calls (uses silent mode)

Fixes #21

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #21
@konard konard self-assigned this Jan 24, 2026
When uploading a single log file (not split into chunks), display a
direct link to the raw file content in addition to the main URL.

- For gists: Returns permanent raw_url from GitHub API
- For repositories: Returns download_url with token
- Adds warning about ~10 minute token expiration for private repos

Fixes #21

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] If we have only one log part in repository or gist we should give direct link to it (in addition to gist/repository link) feat: Add direct raw file URL for single-file uploads Jan 24, 2026
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review January 24, 2026 18:24
@konard
Copy link
Member Author

konard commented Jan 24, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.082634 USD
  • Calculated by Anthropic: $4.947645 USD
  • Difference: $-2.134989 (-30.14%)
    📎 Log file uploaded as Gist (809KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 5ef71e8 into main Jan 27, 2026
8 checks passed
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.

If we have only one log part in repository or gist we should give direct link to it (in addition to gist/repository link)

1 participant