Changes to consume tcli as a library - #14
Conversation
ppadmavilasom
commented
Jul 24, 2026
- Allows extensions as shown under examples/_pubsub to implement your own commands.
- Allows extensions as shown under examples/_pubsub to implement your own commands.
| - [pubsub spec](/examples/_pubsub/pubsub.json) | ||
| - [pubsub cmd support](/examples/_pubsub/cmd) | ||
|
|
||
| Now that tcli's reusable packages live under `pkg/` (instead of `internal/`), |
There was a problem hiding this comment.
Not able to understand the example of sns-sqs.
Please update example of petstore as well
There was a problem hiding this comment.
Fair point.
I have updated the example from a new project perspective. A full working example will require the current changes to go in first as the dependencies will not properly resolve without these changes in main. I will provide steps to test locally here (this will not apply as is when this branch is merged so not making it part of README)
If you want to check out how this works locally, you will have to redirect the ref locally. Assuming you create a new go project and create main.go as shown in example.
Do the following to get that project in a testable state for pubsub extensions
go mod init tcli/pubsubtest
edit go.mod to add the following (assumes you create example in the same parent folder as this project. otherwise, change redirect as applies)
go 1.26.5
require github.com/hpinc/tcli v0.0.0
replace github.com/hpinc/tcli => ../tcli
run go mod tidy and you should be able to run go run main.go now with proper config override.
petstore does not need changes. It's usage example will continue to work without changes.
Note that the usage as a lib is primarily aimed at extending tcli functionality via the x-extension mechanism to support custom commands.
RehanChanegaon
left a comment
There was a problem hiding this comment.
Reviewed the changed files. Looks good to me. +1