+
Skip to content

Add auto-configuration command #21

@guyzmo

Description

@guyzmo

create a command to autoconfigure git-repo, which would be:

git repo configure (github|gitlab|bitbucket)

which would then run an authentication loop, to query auth tokens, asking for user/pass for both github and gitlab, and record login:pass for bitbucket (until oauth config is implemented).
Eventually, it could ask for custom gitlab URLs as well.

and it would then populate ~/.gitconfig with:

alias.hub = repo hub
alias.lab = repo lab
alias.bb = repo bb

Here's a mockup of how the interactions could be:

% git repo configure
• Do you want to configure github access? 
[Yn]> Y
Enter your username: 
'guyzmo'> foobar
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to configure gitlab access?
[Yn]> Y
Enter your username: 
'$USER'> barfoo
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to configure bitbucket access?
[Yn]> Y
Enter your username: 
'$USER'> fubar
Enter your password:
>
Done, cheers! 🍻
• Do you want to add a custom gitlab access?
[yN]> Y
Enter the URL of the gitlab:
> https://my_gitlab.my_domain.tld
Enter the short name of the service:
> mine
Enter your username:
'$USER'> ford.prefect
Enter your password:
>
Please wait while getting authenticated…
Done, cheers! 🍻
• Do you want to add a custom gitlab access?
[yN]> n
Thank you, here's your configuration:
Service   | Name | Username     | Password | Token    | URI
--------- | ---- | ------------ | -------- | -------- | -----
Github    | hub  | foobar       | *        | Acquired | *
Gitlab    | lab  | barfoo       | *        | Acquired | *
Bitbucket | bb   | fubar        | Acquired | *        | *
Gitlab    | mine | ford.prefect | *        | Acquired | https://my_gitlab.my_domain.tld

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载