Skip to content

Add command to print rai version #3

@bradlo

Description

@bradlo
Contributor

Add command rai version

Activity

TeddyBear06

TeddyBear06 commented on Jun 14, 2022

@TeddyBear06

Hi,

I would be pleased to contribute on this one.

I saw you're using Cobra as CLI framework (lovely one by the way).

How would you want to set rai's CLI versions ?

Two options comes in my mind:

  • Hard-coded in a version_current.go file (Hugo did this and it's easier to distribute for both devs and users)
  • At compile time using -ldflags="-X 'main.version=0.1.2-alpha'" (may be better if you think about CI automations but require to update both make file and README.md)

Cobra support "out of the box" version command flags by injecting a Version:

var root = &cobra.Command{Use: "rai", Version: version}

Then we can get rai's version using both -v or --version flags:

$ ./make
$ ./build/rai --version
rai version 0.1.1-alpha
$ ./build/rai -v
rai version 0.1.1-alpha

I'll send a pull request with a working POC in order to share my POV about this question.

added a commit that references this issue on Jun 14, 2022
andy-dean-rai

andy-dean-rai commented on Aug 23, 2022

@andy-dean-rai

This feature would have been helpful for me today.

andy-dean-rai

andy-dean-rai commented on Sep 1, 2022

@andy-dean-rai

I agree with needing a --version flag which users will often expect, but it would also be good to have a version command that can show the version of the associated database and engine. That information should also make it clear whether or not the CLI, database, and engine are all compatible.

torkins

torkins commented on Oct 7, 2022

@torkins
Contributor

All SDKs and CLI,

  • CLI should just print its own version, not SDK version

Plan is to go with generated version.go or lang equivalent for this

billscheidel-rai

billscheidel-rai commented on Dec 6, 2022

@billscheidel-rai

Note: This issue has been migrated to https://relationalai.atlassian.net/browse/RAI-4917.

This link is only accessible to employees of RelationalAI.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bradlo@TeddyBear06@torkins@billscheidel-rai@andy-dean-rai

        Issue actions

          Add command to print rai version · Issue #3 · RelationalAI/rai-cli