项目作者: sneat-team

项目描述 :
⚙️ quickly switches config settings with a single command (Git, hosts, Node, env vars, etc.)
高级语言: Go
项目地址: git://github.com/sneat-team/universal-configs-manager.git
创建时间: 2021-01-26T11:56:05Z
项目社区:https://github.com/sneat-team/universal-configs-manager

开源协议:Apache License 2.0

下载


⚙️ Universal Configs Manager

The ucm utility quickly switches multiple dev configs with a single command.

Manages: hosts file entry, Git config, Node version, Node repository, environment variables, etc.

Go Report Card
Build

😮 How it works

If you work on different projects requiring different environment you can change all of your settings with a single CLI command.

Like that:

  1. > ucm ls
  2. Universal Configs Manager:
  3. - personal
  4. - work <= current
  5. > ucm
  6. Configured [work]:
  7. - Git config
  8. - user.email: my@work.email
  9. - Node version: 10.2.1
  10. - Node Repository: work => https://registry.work.example.com/
  11. - Environment variables:
  12. - HTTP_PROXY: http://proxy.work.example.com
  13. > ucm use --name personal
  14. Configured [personal]:
  15. - Git config
  16. - user.email: my@personal.email
  17. - Node version: 15.6.1
  18. - Node Repository: npm => https://registry.npmjs.org/
  19. - Environment variables:
  20. - HTTP_PROXY: (none)

There is a dedicated page about available command.

Pitfalls & known issues

  • Environment variables — Originally it was planned to perform changing of env vars in a shell the UMC has been run.
    Unfortunately it does not look to be possible
    without gdb hack
    and this seems to be too difficult, dangerous & unstable.
    As an alternative we can output to console a script for setting env vars that user should copy-paste and execute manually.
    This is not ideal but still good enough as information is easily available & quick to use.

📦 Supports out of the box

  • Environment variables
  • Git configuration
  • NVM - Node Version Manager
  • NRM - Node Repository Manager

Ideas & contributions are welcome on how to make it expandable.

📤 Shared config profiles

A named configs profile can point to a file in a shared folder or URL.
This way you can share configuration with your team.

  1. > umc add --url https://example.com/my-team/.ucm.prod.yaml --name work-prod
  2. > umc add --path //shared_folder/.ucm.test.yaml --name work-test --sync auto

🔛 Sync options

  • ask - ask to update if changed (default)
  • auto - auto update if changed
  • none - do not check for updates

Can take setting from a file

Can apply settings stored inside your project in a .universal-configs.yaml file.

  1. ~/projects/> ucm use --file ./some-project/.universal-configs.yaml
  2. Configured [work]:
  3. - Git config
  4. - user.email: my@work.email
  5. Configured [~/projets/some-project/.universal-configs.yaml]:
  6. - Node version: 10.2.1
  7. - Node Repository: work => https://registry.work.example.com/
  8. - Environment variables:
  9. - HTTP_PROXY: http://proxy.work.example.com

⚖️ Compare config differences

  1. > ucm diff --file http://example.com/some-company.yaml --name personal
  2. Compared:
  3. - File: http://example.com/some-company.yaml
  4. - Named: personal
  5. ╔════════════════════════╤═══════════════════╤═══════════════════╗
  6. Configs / Profiles some-company.yaml personal
  7. ╟────────────────────────┼───────────────────┼───────────────────╢
  8. Git config
  9. - user.email (none) my@personal.email
  10. ╟────────────────────────┼───────────────────┼───────────────────╢
  11. Enviroment vars
  12. - HTTP_PROXY http://proxy │ (none) ║
  13. ╚════════════════════════╧═══════════════════╧═══════════════════╝

💡 Ideas & Suggestions

If you have an idea on what can be added to UCM please
start a discussion first
before opening an issue.

💻 Cross platform: Works on Windows, Linux, MacOS

Developed in Go language so it’s fast and works on any OS suported by Go.

📥 Install & Downloads

You can install from sources or download binaries.

Installing from sources

  1. > go get github.com/sneat-team/universal-configs-manager
  2. > cd universal-configs-manager
  3. > go install cli/ucm/ucm.go

Download binaries

Not available yet.

Installing using package managers

Not available yet.

🏆 Contributions

Contributors wanted, PRs are welcome.

There is a roadmap document that outlines plans & ideas.

Getting source codes & Building locally

To get source codes:

  1. > git clone https://github.com/sneat-team/universal-configs-manager.git
  2. > cd universal-configs-manager

To build an executable file run:

  1. > go build cli/ucm/ucm.go

This will generate the ucm executable in the current directory (ucm.exe on Windows).

🤔 Questions at StackOverflow

Here is a list of questions we’ve asked at StackOverflow while developing this little utility.

🤩 Credits

This project would not be possible without using free & open source.

  • Developed in Go language

Go packages used by this project

✒️ License

This is free & open source utility
licensed under Apache License version 2.0.