axiomhq / cli

The power of Axiom on the command line.
https://axiom.co
MIT License
42 stars 11 forks source link

Cloud focus #112

Closed lukasmalkmus closed 2 years ago

lukasmalkmus commented 2 years ago

This PR refactors multiple bits and pieces accross the codebase to tailor it more for usage with Axiom Cloud.

codecov[bot] commented 2 years ago

Codecov Report

Merging #112 (dd7661d) into main (eb6f1bf) will decrease coverage by 0.42%. The diff coverage is 4.76%.

@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   14.42%   13.99%   -0.43%     
==========================================
  Files          10       10              
  Lines         520      543      +23     
==========================================
+ Hits           75       76       +1     
- Misses        429      451      +22     
  Partials       16       16              
Impacted Files Coverage Δ
internal/cmd/root/help_topic.go 100.00% <ø> (ø)
internal/cmd/root/root.go 0.00% <0.00%> (ø)
internal/config/config.go 5.47% <0.00%> (-0.16%) :arrow_down:
cmd/axiom/main.go 15.27% <8.69%> (-3.96%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eb6f1bf...dd7661d. Read the comment docs.

bahlo commented 2 years ago

Random UX thoughts:

lukasmalkmus commented 2 years ago

I think it'd be nice to ask on the very first run (i.e. if no config is found) if the user want's to authenticate with Axiom. I guess the options yes/no/don't ask again make sense there. Otherwise if you don't know the cli you might be a bit lost.

Done. However, there is no don't ask me again. Wasn't nicely to implement with our current setup. However, the user gets hinted to just manually run axiom auth login once he denies. If denied, the dialog will not appear again.

I think we should get rid of the deployment name question if the user has no deployments yet (most users will only use cloud)

Can you elaborate, please?

After authenticating for the first time, it'd be nice to get some hints of what to do (axiom dataset list, axiom stream, etc.) with a small explanation

Done. After successfully authenticating, the help is automatically printed, otherwise, it continues with the command that was initially attempted to be execute.

bahlo commented 2 years ago

Re deployment name: I think (it has been a month) I meant the prompt to give the deployment a name. Maybe a default would also make sense so people don't have to think about implications. Defaulting to cloud if it's on cloud would probably be enough.

lukasmalkmus commented 2 years ago

@bahlo I made that change and did some further improvements to the auth flow: