Skip to content

Add Honeycomb API client and auth command#12

Closed
maragubot wants to merge 2 commits into
mainfrom
issue-2-api-client
Closed

Add Honeycomb API client and auth command#12
maragubot wants to merge 2 commits into
mainfrom
issue-2-api-client

Conversation

@maragubot

Copy link
Copy Markdown
Collaborator

Summary

  • Create honeycomb package with HTTP client, API key auth, and error handling
  • Implement GET /1/auth endpoint for API key verification
  • Add auth command that displays team, environment, and permissions
  • Refactor command registration for testability (NewRootCommand pattern)

Test plan

  • Client creation with default and custom base URL tested
  • Auth endpoint returns correct team/environment info
  • Invalid API key returns error
  • Auth command output contains expected team/env info
  • Auth command errors when API key is missing
  • go install . still works

Closes #2
Closes #3

- Update module path to github.com/maragudk/honeycomb-cli
- Add cobra CLI framework with root command and global flags
- Support --api-key/HONEYCOMB_API_KEY and --api-url/HONEYCOMB_API_URL
- Add version command (set via -ldflags at build time)
- Add basic test for Execute function
- Update README with install and usage instructions

Closes #1
- Create honeycomb package with HTTP client supporting API key auth
- Add error response parsing (RFC 7807 Problem Detail format)
- Implement GET /1/auth endpoint for key verification
- Add `auth` command showing team, environment, and permissions
- Refactor commands to use NewRootCommand() for testability
- Add tests for client, auth API, and auth command

Closes #2
Closes #3
@maragubot
maragubot enabled auto-merge (squash) February 27, 2026 12:37
@maragubot

Copy link
Copy Markdown
Collaborator Author

Changes included in PR #18

@maragubot maragubot closed this Feb 27, 2026
auto-merge was automatically disabled February 27, 2026 12:50

Pull request was closed

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.

Auth command: verify API key API client package with auth, error handling, and base URL

1 participant