Getting started with the CLI
By the end of this page you’ll have the CLI installed, a profile configured, and your first commands running.
Before you start
Section titled “Before you start”- A Prefactor account with at least one environment
Install
Section titled “Install”macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/prefactordev/typescript-sdk/main/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/prefactordev/typescript-sdk/main/scripts/install.ps1 | iexThe binary installs to ~/.prefactor/bin/prefactor on macOS/Linux or %USERPROFILE%\.prefactor\bin\prefactor.exe on Windows. The installer prints the PATH change needed if the bin directory isn’t already on your path.
Configure
Section titled “Configure”prefactor loginThis opens a browser to the Prefactor login page. After authenticating, copy your API token and paste it at the prompt. Credentials save to the default profile automatically.
Select which profile a command uses with --profile <name>.
First run
Section titled “First run”# Verify accessprefactor accounts list
# List environments for your accountprefactor environments list --account_id <account_id>
# List agents in an environmentprefactor agents list --environment_id <environment_id>Verify
Section titled “Verify”prefactor accounts list should return your account. If you see an authentication error, run prefactor login again.
Where to go next
Section titled “Where to go next”- Configuration — config file format, resolution order, and environment variables
- API tokens — create and manage the tokens your profiles use