Skip to content

[Feature]: Have a flag to extract only the value/ID/IP... #122

@scraly

Description

@scraly

Is there an existing issue for this?

  • I have searched the existing issues

Product concerned

All

Feature description

For the moment, if we want to create a PAT token, and save it in an env variable, we need to so some tricky stuff:

$ PAT_TOKEN=$(ovhcloud iam user token create xxxxx --name xxxxxxx --description "PAT for xxxxx" -j  | jq .details.token |  tr -d '"')
2025/12/18 16:03:11 Final parameters:
{
 "description": "PAT for xxxx",
 "name": "xxxxx"
}
echo $PAT_TOKEN
<the-token>

In this command I've done several things:

  • ask the output in json
  • used jq to extract only the token field
  • use tr to remove the double quotes

The goal is to have a kind of --raw flag or what you want, to help the user to have only the ID, the IP or whatever he or she has created through the CLI and use it easily in his/her CI/CD, pipelines, scripts... :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions