Infield CLI

Sync your repos with Infield from the command line

Install the infield command line tool to sync your dependencies from your local environment or continuous integration pipeline.

Installation

Download the latest release for your architecture:

Linux (x86)

wget https://dist.infield.ai/cli/releases/0.4.0/infield_Linux_x86_64.tar.gz

Intel Mac

wget https://dist.infield.ai/cli/releases/0.4.0/infield_Darwin_x86_64.tar.gz

Apple Silicon Mac

wget https://dist.infield.ai/cli/releases/0.4.0/infield_Darwin_arm64.tar.gz

Extract the binary:

# For example, for Linux:
tar xzf infield_Linux_x86_64.tar.gz

Syncing dependencies

Generate your API key inside Infield at https://app.infield.ai/settings/api_key. You must set the environment variable INFIELD_API_TOKEN to your api key.

Then run the CLI to sync a repo. Pass paths to the files your package manager uses to store dependency versions:

Package ManagerDefinition FileLockfile
bundlerGemfileGemfile.lock
npmpackage.jsonpackage-lock.json
poetrypyproject.tomlpoetry.lock
INFIELD_API_TOKEN=infield_token infield sync --repo-environment-id ID --definition-file package.json --lock-file package-lock.json

You can find your repo environment ID inside Infield (Repos -> Choose a Repo -> Environments -> Edit).

Applying safe upgrades

Use the CLI to apply upgrades that Infield has researched and found to not contain any breaking changes. This will run your package manager locally to upgrade the dependencies in your developer environment, which you can use to then open a pull request.

infield update --repo-environment-id ID