Skip to content

Conversation

@btschwartz12
Copy link
Contributor

No description provided.

@btschwartz12 btschwartz12 force-pushed the bschwartz/credits branch 4 times, most recently from 7ff43fe to 3eaa8d4 Compare December 20, 2025 21:09
@btschwartz12 btschwartz12 changed the title feat(commands): implement credit details commands feat(commands): implement credit/org details commands Dec 20, 2025
"github.com/censys/cencli/internal/pkg/domain/responsemeta"
)

//go:generate mockgen -destination=../../../gen/app/organizations/mocks/organizationservice_mock.go -package=mocks -mock_names Service=MockOrganizationsService . Service

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt realize we were doing this. Nice!

func (c *Command) Examples() []string {
return []string{
"# Show credits for your stored organization",
"--org-id <uuid> # Show credits for a specific organization",
Copy link

@aspacewalz aspacewalz Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure it makes sense for us to have org id as an argument. The expected flow would be to select a different active org in my mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda agree, but to be consistent with our other commands, we allow users to override the org they want to use, and this also supports users who don't want to configure their org beforehand

type noOrgIDError struct{}

func (e *noOrgIDError) Error() string {
return "no organization ID configured. Use --org-id flag or run 'censys config org-id set <org-id>' to set a default"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh I guess its alright as an alternative approach. Doesn't cost us anything.

Copy link

@aspacewalz aspacewalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I'm not sold on the need for the org-id argument. It might cause confusion and its more difficult to remove once added, but it also doesn't cost us anything to support it. Im ok with leaving it, but wanted to give my thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants