dub
dub copied to clipboard
[FEAT]: `dub` CLI
Building on @sujjeee's incredible work: https://github.com/sujjeee/dubco
Proposal
npm i dub
(published via NPM)
Commands
-
dub help
: Shows a list of commands that are available -
dub login
: Login to Dub.co via API token.- Bonus: Auto-open a new window and log user in, but would require programmatic API token generation. Example: https://github.com/unkeyed/examples/tree/main/unkey-cli
-
dub config
: Show current config- Current user email
- Current project
- Current domain
-
dub config set
: Set current config- Project selector
- Domain selector
Example:
? Switch to: ── Projects ──────────────────────── ○ Dub (dub) ○ Steven Tey (steven) ○ One Word Domains (owd) ───────────────────────────────── ○ Cancel
-
dub shorten [url] [key]
: Shorten a URL-
If
url
andkey
are not provided, go through the current flow:✔ Enter your Destination URL : … ✔ Enter your Short link : … ✔ Short link created!
-
If
url
is provided, create short link with random key -
If both
url
andkey
are provided, create short link with provided key
-
MVP notice
This is the early MVP of the dub
CLI and will be improved in the future!
🙋♂️
@steven-tey @sujjeee I have one idea related to this. A few days back there was an issue created by you @steven-tey to programmatically create the QR Code which I wanted to work on. Do you think it will be a good idea to let the user create the QR code using CLI by adding some extra parameters and letting it download in the user file path? From there he can also then do many things like storing it in his S3 or Redis cache. What do you guys think?
@VishalMCF 👀
https://github.com/dubinc/dub/assets/101963203/594a26c2-a53d-4968-a543-e90a144e106c
@sujjeee Great!! You stole my potential issue already :)
@VishalMCF I realized that I have a simpler solution for this, so i implemented it.
Is there anything that I can implement? If you have any idea?
On Tue, 19 Dec 2023 at 16:58, Suraj ! @.***> wrote:
@VishalMCF https://github.com/VishalMCF I realized that I have a simpler solution for this, so i implemented it.
— Reply to this email directly, view it on GitHub https://github.com/dubinc/dub/issues/506#issuecomment-1862588042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYCBCTLNL7MKTOL63L7PYDYKF26DAVCNFSM6AAAAABAYUJ5NGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSGU4DQMBUGI . You are receiving this because you were mentioned.Message ID: @.***>
@VishalMCF
You can try building a Dub React library. Take a look at OpenAI's and Cloudinary's React libraries for inspiration.
@VishalMCF are you working on the library ?
@aakash2330 No bro. A little less interested in working on frontend side.
@sujjeee can you elaborate a little more about the dub react library .
@aakash2330 Its not react library, Its like nodejs library or we can say nodejs sdk
Look at this prototype 👇
something similar, like import dub from a lib and create new instance, pass api key and then pass the other args and create a short url.
Yes , that's what I was confused about , whether the context was sdk or a react components library . Thanks for clarifying . I'm really interested on working on it , any suggestions would be greatly helpful .
@aakash2330 Its great to see you excited about this, but ask @steven-tey if its really needed or not, because most people prefer to do direct API calls instead of installing an additional library for this. If you really want to contribute, then contribute to improving the APIs as they are still in beta phase.
makes sense .
Hi guys, Hi @sujjeee
Just discovering dub
:)
About the library, are you looking for a typescript lib like a BFF or data layer to connect dub's APIs?
If so, I'm interested to contribute. This is what I did at work Example