Skip to content

feat(find): add --show-price flag (#50)#103

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/50-find-show-price
Jul 21, 2026
Merged

feat(find): add --show-price flag (#50)#103
scttfrdmn merged 1 commit into
mainfrom
feat/50-find-show-price

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #50.

truffle find had no --show-price — only the deprecated search (which #44 merged into find) and the spot-centric spot command exposed on-demand pricing. So the canonical "what does this instance cost" question couldn't be answered with the canonical search command; you had to fall back to spot or the raw AWS Pricing API.

Change

  • Add --show-price to find, populating the on-demand $/hr column via awsClient.OnDemandPrice (SageMaker ml.* types keep their AmazonSageMaker management-premium rate). Composes with --regions so price shows per region.
  • Default output is unchanged — no price column unless --show-price is passed.
  • Mirrors the behavior the old search --show-price had.

Verify

truffle find g5.12xlarge --show-price --regions us-east-1
# → $/hr column shows $5.6720
truffle find g5.12xlarge --regions us-east-1
# → no $/hr column (default)

Tested live (g5.12xlarge → $5.6720, exactly the issue's g5.4xlarge-vs-g5.12xlarge comparison use case). TestFindCommand_Flags asserts the flag; docs-gen/find.md regenerated so the drift gate passes.

find had no --show-price — only the deprecated search (which #44 merged into
find) and the spot-centric spot command exposed pricing, so the canonical
'what does this cost' question couldn't be answered with the canonical search
command. Add --show-price to find, populating the on-demand $/hr column via
awsClient.OnDemandPrice (SageMaker ml.* keeps its management-premium rate).
Composes with --regions. Default output is unchanged (no price column).

Mirrors the old search behavior. Test: TestFindCommand_Flags asserts the flag;
docs-gen/find.md regenerated (drift gate).

Closes #50
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/find.go 11.11% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 3dd36e3 into main Jul 21, 2026
5 of 6 checks passed
@scttfrdmn
scttfrdmn deleted the feat/50-find-show-price branch July 21, 2026 21:57
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.

find has no --show-price flag (only deprecated search and spot expose pricing)

1 participant