Giter Club home page Giter Club logo

cios-cli's Introduction

CIOS CLI - OPTiM Cloud IoT OS CLI

About

OPTiM Cloud IoT OS(CIOS) The command line interface (CLI) is an integrated tool for managing CIOS. This tool will be provided in binary and will help automation with scripts etc. that operate CIOS.

This repository depends on OPTiM Cloud IoT OS Golang SDK.

Use API as of 2021/03/10.

CIOS CLI Reference

CIOS CLI Document

Inisilized

0. CLI Download

1. Create config file

The configuration file is automatically generated by entering the following command. Information such as domain county and Access Token is temporarily stored in the configuration file.

$ cios
Created a directory [C:\Users\hogehoge/.cios-cli]
Created a file [C:\Users\hogehoge/.cios-cli/config.json]
Created a file [C:\Users\hogehoge/.cios-cli/URL.json]

Next '$ cios login'

2. Get API token

By doing cios login, you can log in with any OAuth Client. Create OAuthClient information according to the following.

  • Type: Web
  • Redirect URI: http://localhost:8080/oauth2/callback
$ cios login 
? Choose a stage:  [Use arrows to move, enter to select, type to filter]
> Preview
  Production
? Redirect URI:  http://localhost:8080/oauth2/callback
? Client ID:  hohohooho-gege-hoho-gegehogehogehoge
? Client Secret ****************************************************************

...

finish

3. Use CIOS API

The CIOS CLI Document describes how to use the API.

4. Save config files

By saving the setting information as a file, any data can be recalled later.

For example, it is effective when using two environments, Prod and Pre.

$ cios config save
? Name:  Develop                                        
Success to save config

Custom API FQDNs

You can change the destination environment by entering the following command.

cios url edit
  • Option -i : The entered domain will be set.
  • Option -ia : Write all URLs.
  • Option none : The settings folder opens.

How to Development

Please see DEVELOP.md

How to Support

If you have any issues or questions, please raise them on Github issues.

LICENSE

The Apache-2.0 License

Copyright (c) 2021 OPTiM Corporation https://www.optim.co.jp/

cios-cli's People

Contributors

optim-kansai-okadome avatar optim-kazuhiro-seida avatar optim-naganuma avatar optim-yusuke-aoki avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cios-cli's Issues

cios config saveを初回実行時、エラーが発生しクライアント情報が保存されない

事象

  • アカウント情報を保存するコマンドであるcios config saveを実行したが、以下のようなエラーが出てaccount.jsonにアカウント情報が保存されなかった。
  • 二度目の実行は成功した。
C:\Users\OPM006566>cios config save
? Name:  northpole
2023/01/22 15:24:21.608565 [�[31mERROR�[0m]  [[ utils.(*Assert).Log ]:  open C:\Users\OPM006566/.cios-cli/accounts.json: The system cannot find the file specified.]
2023/01/22 15:24:21.650189 [�[31mERROR�[0m]  [[ utils.(*Assert).Log ]:  open C:\Users\OPM006566/.cios-cli/accounts.json: The system cannot find the file specified.]
2023/01/22 15:24:21.651866 [�[31mERROR�[0m]  [[ utils.(*Assert).Log ]:  open C:\Users\OPM006566/.cios-cli/accounts.json: The system cannot find the file specified.]
2023/01/22 15:24:21.651866 [�[31mERROR�[0m]  [[ main.main ]:  open C:\Users\OPM006566/.cios-cli/accounts.json: The system cannot find the file specified.]

原因として考えられること

  • 詳細に調査していないが、./.cios-cli/account.jsonの作成タイミングが初回実行時は作成されておらずファイルが見つからないというエラーになっていると推測される。二度目は成功していたことからaccount.jsonが作成されていなかった場合の処理を追加するもしくはファイルの作成タイミングについて確認が必要。

実行環境

  • OS : Windows10
  • cios cli version: Could IoT OS CLI version 0.3.2

FullScopeの空白漏れ

FullScopeのgroup.relation.writeとcorporation.readの間にスペースが抜けているため、2つのスコープを付与することができない。

cios login で、slice bounds out of range が起きる

エラーの内容

$ cios login
? Choose a stage: viola
? Redirect URI:  http://localhost/
? Client ID:  xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx
? Client Secret ****************************************************************
auth.pre.cios.dev
panic: runtime error: slice bounds out of range [:21] with length 17

goroutine 1 [running]:
github.com/optim-corp/cios-cli/cli/authorization.login()
        C:/Users/kazuhiro.seida/work/git/github/cios-cli/cli/authorization/login.go:98 +0x753
github.com/optim-corp/cios-cli/cli/authorization.GetLoginCommand.func1(0xc0000c1280, 0x2, 0x2)
        C:/Users/kazuhiro.seida/work/git/github/cios-cli/cli/authorization/login.go:44 +0x68
github.com/urfave/cli/v2.(*Command).Run(0xc000188d80, 0xc0000c1080, 0x0, 0x0)
        C:/Users/kazuhiro.seida/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x4ed
github.com/urfave/cli/v2.(*App).RunContext(0xc000082480, 0xc49640, 0xc0000ba040, 0xc0000ae020, 0x2, 0x2, 0x0, 0x0)
        C:/Users/kazuhiro.seida/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0x81f
github.com/urfave/cli/v2.(*App).Run(...)
        C:/Users/kazuhiro.seida/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
        C:/Users/kazuhiro.seida/work/git/github/cios-cli/main.go:96 +0x788

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.