adpt
A command line tool for interacting with the Adaptive Platform.
Installation
MacOS
On ARM-based macs brew can be used:
Windows
On x86-based Windows winget can be used:
winget install --source winget AdaptiveML.adpt
Fedora
A RPM is attached to the latest release on GitHub, simply download it and install via DNF.
Everything else
Once installed an API key must be specified for use. This can be done using the
ADAPTIVE_API_KEY environment variable, or alternatively stored in your
operating system's keyring using the below command:
Additionally your adaptive instance may be specified either via the
ADAPTIVE_BASE_URL environment variable or via a configuration file as
described in the configuration section below.
Completions
To set up completions for zsh run the following:
Note that completions for things like recipe keys will only work when a default project is configured.
Usage
Specifying the project
Most commands require a --project option to specify the project:
However to avoid specifying this every time, the DEFAULT_PROJECT environment
variable or the default_project configuration file option.:
Setting API Key
Store your API key in the system keyring:
Full command reference
For a complete list of commands see [[command-line-help-for-adpt]].
Combining with other tools
In order to allow for easy scriptability adpt produces simple machine readable output such as bare IDs when it is run in a pipe.
Below are a few examples of how adpt can be combined with other command line utilities to achieve additional functionality.
Publishing a recipe on save
You can use a tool such as watchexec to run the publish command when files change:
Running a recipe on publish
The built-in xargs command can be used to use the output of one command as a
parameter to another:
|
Configuration
Env file
Environment variables may be specified using a .env file in a parent folder.
Configuration File Locations
Configuration files are stored in platform-specific locations:
| Platform | Configuration File Path |
|---|---|
| Linux | ~/.config/adpt/config.toml or $XDG_CONFIG_HOME/adpt/config.toml |
| macOS | ~/.adpt/config.toml |
| Windows | %APPDATA%\adaptive-ml\adpt\config\config.toml |
Configuration File Format
The configuration file uses TOML format and supports the following options:
# Default project for operations
= "my-project"
# Base URL for the Adaptive platform
= "https://your-adaptive-instance.com"
API Key Storage
The API key can be provided in two ways (in order of priority):
- Environment Variable: Set
ADAPTIVE_API_KEYenvironment variable - System Keyring: Store securely using
adpt set-api-key <your-key>