Configuration
We support configuration for both projects and users. Both config files are in TOML.
Project configuration
proto supports pinning versions of tools on a per-project or per-directory basis through our
.prototools
configuration file. This file takes precedence during version detection
and can be created/updated with proto local
.
This configuration simply maps tools to versions for the current directory.
node = "16.16.0"
npm = "9"
go = "1.20"
rust = "1.68.0"
The names of tools are the same used on the command line!
[plugins]
Plugins can also be configured with the [plugins]
section.
Learn more about this syntax.
[plugins]
my-tool = "source:https://raw.githubusercontent.com/my/tool/master/proto-plugin.toml"
Once configured, you can run a plugin as if it was a built-in tool:
$ proto install my-tool
User configuration
proto operates with sane defaults and accomplishes its goals very well. However, we also believe in
user choice and customization, and as such, support a user configuration file located at
~/.proto/config.toml
, which can be used to customize the behavior of proto.
Some of these settings (excluding plugins) can also be configured via environment variables.
PROTO_AUTO_INSTALL=true proto run node
auto-install
When enabled, will automatically installing missing tools when proto run
is run,
instead of erroring. Defaults to false
.
auto-install = true
auto-clean
When enabled, will automatically clean up the proto cache when proto use
is run.
Defaults to false
.
auto-clean = true
node-intercept-globals
When enabled, will intercept global package installs for node/npm/pnpm/yarn and suggest using
proto install-global
instead. Defaults to true
.
node-intercept-globals = false
[http]
Can be used to customize the HTTP client used by proto and warpgate, primarily for requesting files to download, available versions, and more. The following settings are available:
allow-invalid-certs
- When enabled, will allow invalid certificates instead of failing. This is an escape hatch and should only be used if other settings have failed. Be sure you know what you're doing!proxies
- A list of proxy URLs to use for requests.root-cert
- The path to a root certificate to use for requests. This is useful for overriding the native certificate, or for using a self-signed certificate, especially when in a corporate/internal environment. Supportspem
andder
files.
[http]
root-cert = "/path/to/root/cert.pem"
[plugins]
A mapping of plugins available to the user, and not just a project/directory. Refer to the
[plugins]
section above for more information.
GitHub Action
To streamline GitHub CI workflows, we provide the
moonrepo/setup-proto
action, which can be used to
install proto
globally, and cache the toolchain found at ~/.proto
.
# ...
jobs:
ci:
name: 'CI'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
- uses: 'moonrepo/setup-proto@v1'
- run: 'proto use'