SuperRepo is in the beta phase of development and may not be available on your enrollment. Functionality may change during active development.
The Foundry CLI (foundry) is a command-line tool for developing SuperRepos from your own machine, whether the repository is hosted inside or outside the Palantir platform. It runs on macOS, Windows, and Linux. Use it to scaffold projects from templates and to build, preview, and deploy your project.
You can install the Foundry CLI by following the steps in this section, or through an interactive installation flow in the Palantir platform. To open that flow, append /workspace/code/superrepo to your enrollment's root address.
Where possible, install through the in-platform flow. It provisions a more restricted token for the installation than the user-generated token the steps below require, which makes it the more secure option.
Set FOUNDRY_URL in your terminal session to the root address of your enrollment.
Copied!1export FOUNDRY_URL="insert_domain_here"
Copied!1$env:FOUNDRY_URL = "insert_domain_here"
For your Foundry enrollment, generate a token and set it in the same terminal session. User-generated tokens have no scope setting, so no particular scope is required.
Copied!1export TOKEN="insert_token_here"
Copied!1$env:TOKEN = "insert_token_here"
The FOUNDRY_URL and TOKEN variables are read by the installation command in Step 3, which downloads the CLI from your enrollment. They are not the credentials that the CLI itself uses once installed; you establish those with foundry login in the next section. Because this token is only needed to install the CLI, you can delete it once you have signed in, and an installed CLI is unaffected if it expires.
Run the installation command for your operating system. The CLI is always downloaded from your enrollment; it is not distributed through a package manager or as a standalone download.
On Windows, install-foundry.bat is downloaded using the $env:FOUNDRY_URL and $env:TOKEN values you set in Steps 1 and 2, so run those steps in the same PowerShell session first.
Copied!1curl -sS "$FOUNDRY_URL/code/api/extension/install-script" -H "Authorization: Bearer $TOKEN" | bash
Copied!1 2Invoke-WebRequest -Uri "$env:FOUNDRY_URL/code/api/extension/install-bat" -Headers @{ Authorization = "Bearer $env:TOKEN" } -OutFile "install-foundry.bat" .\install-foundry.bat
Sign in to your Foundry enrollment so the CLI can reach the platform as you develop your SuperRepo project.
Copied!1foundry login
The command prompts you for your Foundry URL and a token, then stores the credentials that every subsequent CLI command uses, including the local development servers and foundry deploy. To sign in without prompts, supply the token in the FOUNDRY_TOKEN environment variable and the enrollment URL with the --foundry-url option. Use this form in a CI system.
If commands begin failing with an authorization error, the credentials stored by foundry login have expired. Re-authorize in your browser with the following command:
Copied!1foundry login refresh
The Foundry CLI can update itself to the latest version.
Copied!1foundry update self
To find out the full capabilities of the Foundry CLI, you can list the options.
Copied!1foundry --help
For more information on the workflows the CLI supports, review Create a SuperRepo, Prepare for your first deployment, and Advanced workflows.