diff --git a/docs/partials/replicated-cli/_authorize-with-token-note.mdx b/docs/partials/replicated-cli/_authorize-with-token-note.mdx index ca593013ba..7509b01790 100644 --- a/docs/partials/replicated-cli/_authorize-with-token-note.mdx +++ b/docs/partials/replicated-cli/_authorize-with-token-note.mdx @@ -1,3 +1,3 @@ :::note -The `replicated login` command creates a token after you log in to your vendor account in a browser and saves it to a config file. Alteratively, if you do not have access to a browser, you can set the `REPLICATED_API_TOKEN` environment variable to authenticate. For more information, see [(Optional) Set Environment Variables](/reference/replicated-cli-installing#env-var). +The `replicated login` command creates a token after you log in to your vendor account in a browser and saves it to a config file. ::: \ No newline at end of file diff --git a/docs/partials/replicated-cli/_install-docker.mdx b/docs/partials/replicated-cli/_install-docker.mdx index 5244b0b10e..64855ca3b1 100644 --- a/docs/partials/replicated-cli/_install-docker.mdx +++ b/docs/partials/replicated-cli/_install-docker.mdx @@ -2,8 +2,6 @@ For Windows users, Replicated recommends using Windows Subsystem for Linux (WSL2) and installing the Replicated using the Linux installations above. See [Linux / Windows Subsystem for Linux (WSL2)](#linux-wsl2). ::: -Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [(Optional) Set Environment Variables](/reference/replicated-cli-installing#env-var). - To install and run the latest Replicated CLI in Docker environments: 1. Generate a service account or user API token in the vendor portal. To create new releases, the token must have `Read/Write` access. See [Generating API Tokens](/vendor/replicated-api-tokens). @@ -12,25 +10,8 @@ To install and run the latest Replicated CLI in Docker environments: Download and install the files. For simplicity, the usage in the next step is represented assuming that the CLI is downloaded and installed to the desktop. -1. Authorize the Replicated CLI: - - - Through a Docker container: - - ```shell - docker run \ - -e REPLICATED_API_TOKEN=$TOKEN \ - replicated/vendor-cli --help - ``` - Replace `TOKEN` with your API token. - - - On Windows: - - ```dos - docker.exe run \ - -e REPLICATED_API_TOKEN=%TOKEN% \ - replicated/vendor-cli --help - ``` - - Replace `TOKEN` with your API token. +1. To begin using the Replicated CLI to manage your applications, authenticate with your Replicated credentials. See [Authenticate](#auth). - For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation. \ No newline at end of file + :::note + Installing in Docker environments requires that you set the `REPLICATED_API_TOKEN` environment variable to authorize the Replicated CLI with an API token. For more information, see [Set Environment Variables](/reference/replicated-cli-installing#env-var). + ::: \ No newline at end of file diff --git a/docs/reference/replicated-cli-config-file-reference.md b/docs/reference/replicated-cli-config-file-reference.md new file mode 100644 index 0000000000..a2abc8fefe --- /dev/null +++ b/docs/reference/replicated-cli-config-file-reference.md @@ -0,0 +1,307 @@ +# .replicated File Reference + +This topic describes all supported fields in the `.replicated` configuration file. It also provides examples of `.replicated` configuration files. + +## Application Fields + +### `appId` (string, optional) +Your Replicated application ID. You can find this in the Vendor Portal at vendor.replicated.com. + +### `appSlug` (string, optional) +Your Replicated application slug. This is the human-readable identifier for your app (more commonly used than `appId`). + +**Example:** +```yaml +appSlug: "my-application" +``` + +## Release Configuration + +### `promoteToChannelIds` (array of strings, optional) +List of channel IDs to automatically promote releases to when using `replicated release create`. + +### `promoteToChannelNames` (array of strings, optional) +List of channel names to automatically promote releases to. More convenient than using IDs. + +**Example:** +```yaml +promoteToChannelNames: ["beta", "stable"] +``` + +### `releaseLabel` (string, optional) +Template string for release labels. Supports Go template syntax. + +**Example:** +```yaml +releaseLabel: "v{{.Semver}}" +``` + +## Resource Configuration + +### `charts` (array of objects, optional) +Helm charts to include in releases and lint operations. + +**Fields:** +- `path` (string, required): Path or glob pattern to chart directory (e.g., `./chart` or `./charts/*`). For more information, see [About Path Resolution](#about-path-resolution). +- `chartVersion` (string, optional): Override the chart version +- `appVersion` (string, optional): Override the app version + +**Example:** +```yaml +charts: + - path: "./helm-chart" + - path: "./charts/app-*" # Glob patterns supported + chartVersion: "1.2.3" +``` + +### `preflights` (array of objects, optional) +Preflight check specifications to validate before installation. + +**Fields:** +- `path` (string, required): Path or glob pattern to preflight spec files. For more information, see [About Path Resolution](#about-path-resolution). +- `valuesPath` (string, optional but recommended): Path to Helm chart directory for template rendering. Required for v1beta3 preflights that use templating. + +**Example:** +```yaml +preflights: + - path: "./preflights/preflight.yaml" + valuesPath: "./helm-chart" # Chart directory for rendering templates + - path: "./preflights/**/*.yaml" # Glob pattern + valuesPath: "./helm-chart" +``` + +### `manifests` (array of strings, optional) +Glob patterns for Kubernetes manifest files, including support bundle specs. These are searched for support bundle specifications during linting. + +**Example:** +```yaml +manifests: + - "./manifests/**/*.yaml" + - "./support-bundles/**" +``` + +## Linting Configuration + +### `repl-lint` (object, optional) +Configuration for the linting subsystem. + +**Fields:** +- `version` (integer): Configuration version (currently `1`) +- `linters` (object): Enable/disable specific linters +- `tools` (map): Tool versions to use + +**Example:** +```yaml +repl-lint: + version: 1 + linters: + helm: + disabled: false # Enable Helm linting + preflight: + disabled: false # Enable preflight linting + support-bundle: + disabled: false # Enable support bundle linting + embedded-cluster: + disabled: true # Disable embedded cluster linting + kots: + disabled: true # Disable KOTS linting + tools: + helm: "3.14.4" # Specific version + preflight: "latest" # Use latest version + support-bundle: "0.123.9" +``` + +## Linter Configuration + +Each linter under `repl-lint.linters` supports: +- `disabled` (boolean): Set to `true` to disable the linter, `false` or omit to enable + +**Available linters:** +- `helm`: Validates Helm chart syntax and best practices +- `preflight`: Validates preflight specification syntax +- `support-bundle`: Validates support bundle specification syntax +- `embedded-cluster`: Validates embedded cluster configurations (disabled by default) +- `kots`: Validates KOTS manifests (disabled by default) + +## Tool Versions + +The `tools` map specifies which versions of linting tools to use: + +- `helm`: Helm CLI version for chart validation +- `preflight`: Preflight CLI version for preflight spec validation +- `support-bundle`: Support Bundle CLI version for support bundle validation + +**Version formats:** +- `"latest"`: Automatically fetch the latest stable version from GitHub +- Semantic version: Specific version (e.g., `"3.14.4"`, `"v0.123.9"`) + +**Example:** +```yaml +tools: + helm: "latest" # Always use latest Helm + preflight: "0.123.9" # Pin preflight to specific version + support-bundle: "latest" +``` + +## About Path Resolution + +### Relative Paths +All paths in the configuration file are resolved relative to the directory containing the `.replicated` file. This ensures commands work correctly regardless of where they are invoked. + +### Glob Patterns +Paths support glob patterns for flexible resource discovery: +- `*`: Matches any characters except `/` +- `**`: Matches any characters including `/` (recursive) +- `?`: Matches any single character +- `[abc]`: Matches any character in brackets +- `{a,b}`: Matches any of the comma-separated patterns + +**Examples:** +```yaml +charts: + - path: "./charts/*" # All immediate subdirectories + - path: "./services/**/chart" # Any chart directory under services + +preflights: + - path: "./checks/**/*.yaml" # All YAML files recursively + +manifests: + - "./*/manifests/**" # Manifests in any top-level directory +``` + +## Examples + +### All Fields + +```yaml +# Application identification +appId: "" # Your application ID (optional) +appSlug: "" # Your application slug (optional, more commonly used) + +# Automatic promotion channels +promoteToChannelIds: [] # List of channel IDs to promote to +promoteToChannelNames: [] # List of channel names to promote to (e.g., ["beta", "stable"]) + +# Helm charts +charts: + - path: "./helm-chart" # Path or glob pattern to chart directory + chartVersion: "" # Override chart version (optional) + appVersion: "" # Override app version (optional) + +# Preflight checks +preflights: + - path: "./preflights/**" # Path or glob pattern to preflight specs + valuesPath: "./helm-chart" # Path to helm chart for template rendering (required for v1beta3 preflights) + +# Kubernetes manifests and support bundles +manifests: ["./support-bundles/**"] # Glob patterns for manifest files + +# Release labeling +releaseLabel: "" # Label pattern for releases (e.g., "v{{.Semver}}") + +# Linting configuration +repl-lint: + version: 1 + linters: + helm: + disabled: false # Enable/disable Helm linting + preflight: + disabled: false # Enable/disable preflight linting + support-bundle: + disabled: false # Enable/disable support bundle linting + tools: + helm: "latest" # Helm version (semantic version or "latest") + preflight: "latest" # Preflight version (semantic version or "latest") + support-bundle: "latest" # Support bundle version (semantic version or "latest") +``` + +### Single-Chart + +```yaml +appSlug: "my-application" + +charts: + - path: "./chart" + +manifests: + - "./manifests/**/*.yaml" + +repl-lint: + version: 1 + linters: + helm: + disabled: false + tools: + helm: "latest" +``` + +### Multi-Chart with Preflights + +```yaml +appSlug: "complex-app" +promoteToChannelNames: ["beta"] + +charts: + - path: "./charts/frontend" + - path: "./charts/backend" + - path: "./charts/database" + +preflights: + - path: "./preflights/infrastructure.yaml" + valuesPath: "./charts/backend" + - path: "./preflights/networking.yaml" + valuesPath: "./charts/frontend" + +manifests: + - "./support-bundles/**" + +repl-lint: + version: 1 + linters: + helm: + disabled: false + preflight: + disabled: false + support-bundle: + disabled: false + tools: + helm: "3.14.4" + preflight: "latest" + support-bundle: "latest" +``` + +### Monorepo Service Configuration + +```yaml +# Parent .replicated at monorepo root +appSlug: "enterprise-platform" +promoteToChannelNames: ["stable"] + +repl-lint: + version: 1 + linters: + helm: + disabled: false + preflight: + disabled: false + tools: + helm: "latest" + preflight: "latest" +``` + +```yaml +# Child .replicated in services/auth/ +charts: + - path: "./chart" + +preflights: + - path: "./preflights/*.yaml" + valuesPath: "./chart" +``` + +### Minimal Configuration + +```yaml +# Minimal config - relies on auto-detection +appSlug: "simple-app" +``` \ No newline at end of file diff --git a/docs/reference/replicated-cli-config-file.md b/docs/reference/replicated-cli-config-file.md new file mode 100644 index 0000000000..22fa1d10b3 --- /dev/null +++ b/docs/reference/replicated-cli-config-file.md @@ -0,0 +1,63 @@ +# Add a .replicated File + +This topic describes the `.replicated` configuration file, including how to add a `.replicated` file and how the Replicated CLI uses this file to discover and process your application resources when linting and creating releases. + +For a reference that describes the fields in the `.replicated` file, see [.replicated File Reference](/reference/replicated-cli-replicated-config-reference). + +## Overview + +You can add a `.replicated` configuration file to set various preferences for the Replicated CLI, such as the application slug, the channel ID for promoting releases, paths to your application resources (including Helm charts, preflight specs, or Kubernetes manifests), and more. This file enables commands like [`replicated release create`](/reference/replicated-cli-release-create) and [`replicated release lint`](/reference/replicated-cli-release-lint) to automatically discover your application resources and preferences to help ensure consistent builds when managing releases from the Replicated CLI. + +The Replicated CLI searches for `.replicated` or `.replicated.yaml` files starting from the current directory and walking up the directory tree. If no `.replicated` file is found, the Replicated CLI: +- Automatically searches for Helm charts in the current directory +- Auto-detects preflight specs (files with `kind: Preflight`) +- Auto-detects support bundle specs (files with `kind: SupportBundle`) +- Uses default linting configuration + +## About Using Multiple `.replicated` Files for Monorepos + +The Replicated CLI supports both single-repository projects with one `.replicated` file at the root and monorepo projects with multiple `.replicated` files at different levels. + +For monorepo projects with multiple `.replicated` files, the Replicated CLI: +- Finds all `.replicated` files from the current directory up to the root +- Merges the configuration files, with the settings from child configuration files taking precedence +- Accumulates resources (charts, preflights, manifests) from all levels +- Overrides scalar fields (appId, appSlug) with values from child configuration files + +The following provides an example of a monorepo structure with multiple `.replicated` configuration files: + +``` +monorepo/ +├── .replicated # Root config with shared settings +│ └── appSlug: "company-suite" +├── service-a/ +│ ├── .replicated # Service A specific config +│ │ └── charts: ["./chart"] +│ └── chart/ +└── service-b/ + ├── .replicated # Service B specific config + │ └── charts: ["./helm"] + └── helm/ +``` + +In the example above, when running `replicated release lint` or `replicated release create` from `monorepo/service-a/` or from `monorepo/service-b/`, the Replicated CLI merges the root `.replicated` file with the relevant child `.replicated` file: +- The `appSlug` from the root `.replicated` file is used, unless the slug is overridden in the child configuration file +- Charts from both `.replicated` files are included +- Lint settings are merged, with the settings from the child `.replicated` file taking precedence + +## Add a `.replicated` File + +This section explains how to generate a `.replicated` file using the `replicated config init` command. Alternatively, you can manually create a `.replicated` file. For a field reference and examples, see [.replicated File Reference](/reference/replicated-cli-replicated-config-reference). + +To generate a `.replicated` configuration file using the Replicated CLI: + +1. Run: + + ```bash + replicated config init + ``` + The `replicated config init` command automatically detects Helm charts, preflight specs, and support bundles in your project. + +1. Respond to the prompts in the output of this command to set your application configuration and linting preferences. + + The `.replicated` file is generated based on your selections. \ No newline at end of file diff --git a/docs/reference/replicated-cli-installing.mdx b/docs/reference/replicated-cli-installing.mdx index 0c1a3ed3d1..1340cf73f4 100644 --- a/docs/reference/replicated-cli-installing.mdx +++ b/docs/reference/replicated-cli-installing.mdx @@ -20,14 +20,9 @@ Complete the following prerequisites before installing the Replicated CLI: - Create a vendor account. See [Create a Vendor Account](/vendor/vendor-portal-creating-account). - To run on Linux or Mac, install [curl](https://curl.haxx.se/). - To run through a Docker container, install [docker](https://www.docker.com). +- (Recommended) For Windows users, install Linux on Windows using WSL2. See [How to install Linux on Windows with WSL](https://learn.microsoft.com/en-us/windows/wsl/install). -## Install and Run - -You can install and run the Replicated CLI in the following environments: - -* Directly on MacOS -* Directly on Linux -* Through Docker (Useful for Windows, GitHub Actions, or computers without sufficient access) +## Install ### MacOS @@ -39,11 +34,7 @@ To install and run the latest Replicated CLI on MacOS: 1. -1. - - - -1. +1. To begin using the Replicated CLI to manage your applications, authenticate with your Replicated credentials. See [Authenticate](#auth). ### Linux / Windows Subsystem for Linux (WSL) {#linux-wsl2} @@ -57,33 +48,77 @@ To install and run the latest Replicated CLI on Linux or Windows Subsystem for L 1. -1. - - - -1. +1. To begin using the Replicated CLI to manage your applications, authenticate with your Replicated credentials. See [Authenticate](#auth). ### Docker / Windows -## (Optional) Set Environment Variables {#env-var} +## Authenticate {#auth} + +After installing the Replicated CLI, authenticate with your Replicated credentials using one of the following methods: +* Set the `REPLICATED_API_TOKEN` environment variable to your API token +* Create a Replicated profile at `~/.replicated/config.yaml` to store your API token +* Generate a single authentication token by running `replicated login` + +The Replicated CLI determines which credentials to use for authentication in the following order: + +1. `REPLICATED_API_TOKEN` environment variable. Environment variables take precedence, allowing temporary overrides without modifying stored profiles. +2. Replicated profile passed with the `--profile` flag. This allows for a per-command override of the default Replicated profile. +3. Default Replicated profile from `~/.replicated/config.yaml` +4. Single token auth with `replicated login` + +### Add Replicated Profiles {#profiles} + +The Replicated CLI supports multiple authentication profiles, allowing you to manage and switch between different API credentials. This is useful when working with multiple Replicated accounts or environments. + +Authentication profiles store your API token and can also optionally store custom API endpoints. Profiles are stored securely in `~/.replicated/config.yaml` with file permissions 600 (owner read/write only). Tokens are masked when prompted interactively from the CLI. + +The following examples show how to add and work with Replicated profiles: + +```bash +# Add a production profile using an existing environment variable +replicated profile add prod --token='$REPLICATED_API_TOKEN' -The Replicated CLI supports setting the following environment variables: +# Add a development profile with a direct token +replicated profile add dev --token=your-dev-token -* **`REPLICATED_API_TOKEN`**: A service account or user API token generated from a vendor portal team or individual account. The `REPLICATED_API_TOKEN` environment variable has the following use cases: +# List all profiles +replicated profile ls - * To use Replicated CLI commands as part of automation (such as from continuous integration and continuous delivery pipelines), authenticate by providing the `REPLICATED_API_TOKEN` environment variable. +# Switch to production profile +replicated profile use prod - * To authorize the Replicated CLI when installing and running the CLI in Docker containers. - - * Optionally set the `REPLICATED_API_TOKEN` environment variable instead of using the `replicated login` command to authorize the Replicated CLI in MacOS or Linux environments. +# Use development profile for a single command +replicated app ls --profile=dev -* **`REPLICATED_APP`**: The slug of the target application. +# Edit a profile's token +replicated profile edit dev --token=new-dev-token - When using the Replicated CLI to manage applications through your vendor account (including channels, releases, customers, or other objects associated with an application), you can set the `REPLICATED_APP` environment variable to avoid passing the application slug with each command. +# Remove a profile +replicated profile rm dev -### `REPLICATED_API_TOKEN` +# Add profiles for different accounts +replicated profile add company-a --token=token-a +replicated profile add company-b --token=token-b + +# Switch between accounts +replicated profile use company-a +replicated app ls # Lists apps for company-a + +replicated profile use company-b +replicated app ls # Lists apps for company-b +``` + +{/* UPDATE LINK For more information, see [replicated profile](/replicated-cli-profile). */} + +### Set Environment Variables {#env-var} + +#### Set REPLICATED_API_TOKEN + +The `REPLICATED_API_TOKEN` environment variable can be set to a service account or user API token generated from a Vendor Portal team or individual account. + +The `REPLICATED_API_TOKEN` environment variable is required to authorize the Replicated CLI when installing and running the CLI in Docker containers. It is also helpful for running Replicated CLI commands as part of automation in CI/CD pipelines. To set the `REPLICATED_API_TOKEN` environment variable: @@ -113,13 +148,21 @@ To set the `REPLICATED_API_TOKEN` environment variable: replicated/vendor-cli --help ``` -### `REPLICATED_APP` +#### Set REPLICATED_APP + +When using the Replicated CLI to manage applications through your vendor account, you can set the `REPLICATED_APP` environment variable to the target application slug to avoid having to pass the slug with each command. To set the `REPLICATED_APP` environment variable: -1. In the [vendor portal](https://vendor.replicated.com), go to the **Application Settings** page and copy the slug for the target application. For more information, see [Get the Application Slug](/vendor/vendor-portal-manage-app#slug) in _Managing Application_. +1. Get the application slug: + + ``` + replicated app ls + ``` + + Or, in the [Vendor Portal](https://vendor.replicated.com), go to the **Application Settings** page and copy the slug for the target application. For more information, see [Get the Application Slug](/vendor/vendor-portal-manage-app#slug) in _Managing Application_. -1. Set the environment variable, replacing `APP_SLUG` with the slug for the target application that you retreived in the previous step: +1. Set the environment variable, replacing `APP_SLUG` with the slug that you copied in the previous step: * **MacOs or Linux**: @@ -134,6 +177,7 @@ To set the `REPLICATED_APP` environment variable: -e REPLICATED_APP=$APP_SLUG replicated/vendor-cli --help ``` + For more information about the `docker run` command, see [docker run](https://docs.docker.com/engine/reference/commandline/run/) in the Docker documentation. * **Windows**: @@ -142,3 +186,15 @@ To set the `REPLICATED_APP` environment variable: -e REPLICATED_APP=%APP_SLUG% \ replicated/vendor-cli --help ``` + +### `replicated login` {#login} + +The `replicated login` command creates a token after you log in to your vendor account in a browser and saves it to a config file. + +Using the `replicated login` command requires browser access. If you do not have access to a browser, you can authenticate by adding a Replicated profile or setting the `REPLICATED_API_TOKEN` environment variable instead. See [Add Replicated Profiles](#profiles) or [Set Environment Variables](#env-var). + +To authenticate using `replicated login`: + +1. + +1. \ No newline at end of file diff --git a/docs/reference/replicated-cli-release-lint.mdx b/docs/reference/replicated-cli-release-lint.mdx index 0cf05e7175..6eb5de538e 100644 --- a/docs/reference/replicated-cli-release-lint.mdx +++ b/docs/reference/replicated-cli-release-lint.mdx @@ -4,7 +4,9 @@ Lint a directory of KOTS manifests ### Synopsis -Lint a directory of KOTS manifests +Lint a directory of KOTS manifests. + +For more information about configuring automatic resource discovery, see [.replicated Configuration File](/reference/cli-replicated-config). ``` replicated release lint [flags] @@ -16,7 +18,7 @@ replicated release lint [flags] --fail-on string The minimum severity to cause the command to exit with a non-zero exit code. Supported values are [info, warn, error, none]. (default "error") -h, --help help for lint -o, --output string The output format to use. One of: json|table (default "table") - --yaml-dir yaml The directory containing multiple yamls for a Kots release. Cannot be used with the yaml flag. + --verbose Show verbose output, including discovered images ``` ### Options inherited from parent commands diff --git a/docs/vendor/environment-setup.mdx b/docs/vendor/environment-setup.mdx index 27eeadd6cf..c0de6b750d 100644 --- a/docs/vendor/environment-setup.mdx +++ b/docs/vendor/environment-setup.mdx @@ -97,7 +97,7 @@ sudo mv linux-amd64/helm /usr/local/bin/helm The Replicated CLI is the primary interface for the Replicated Platform. With the Replicated CLI, you can create and manage applications, releases, channels, customers, and more. You also use the Replicated CLI to create clusters with the Compatibility Matrix. -After installing, you can authorize the Replicated CLI by logging in to your Replicated vendor account through the `replicated login` command. +After installing, authorize the Replicated CLI using your Replicated credentials. See [Authenticate](#auth) in _Install the Replicated CLI_. For more information about installing and authorizing the Replicated CLI, see [Install the Replicated CLI](/reference/replicated-cli-installing). @@ -111,11 +111,7 @@ To install and run the latest Replicated CLI on MacOS: 1. -1. - - - -1. +1. To begin using the Replicated CLI to manage your applications, authenticate with your Replicated credentials. See [Authenticate](#auth) in _Install the Replicated CLI_. #### Linux / Windows Subsystem for Linux (WSL2) {#linux-wsl2} @@ -129,11 +125,7 @@ To install and run the latest Replicated CLI on Linux or Windows Subsystem for L 1. -1. - - - -1. +1. To begin using the Replicated CLI to manage your applications, authenticate with your Replicated credentials. See [Authenticate](#auth) in _Install the Replicated CLI_. #### Docker / Windows diff --git a/docs/vendor/releases-creating-cli.mdx b/docs/vendor/releases-creating-cli.mdx index 3d82ffeed9..9e6a25379a 100644 --- a/docs/vendor/releases-creating-cli.mdx +++ b/docs/vendor/releases-creating-cli.mdx @@ -10,17 +10,11 @@ For information about creating and managing releases with the Vendor API v3, see Before you create a release using the Replicated CLI, complete the following prerequisites: -* Install the Replicated CLI and then log in to authorize the CLI. See [Install the Replicated CLI](/reference/replicated-cli-installing). +* Install the Replicated CLI. See [Install the Replicated CLI](/reference/replicated-cli-installing). * Create a new application using the `replicated app create APP_NAME` command. You only need to do this procedure one time for each application that you want to deploy. See [`app create`](/reference/replicated-cli-app-create) in _Reference_. -* Set the `REPLICATED_APP` environment variable to the slug of the target application. See [Set Environment Variables](/reference/replicated-cli-installing#env-var) in _Installing the Replicated CLI_. - - **Example**: - - ```bash - export REPLICATED_APP=my-app-slug - ``` +* Add a `.replicated` configuration file to your project. See [Add a .replicated File](/reference/replicated-cli-config-file). Alternatively, set the `REPLICATED_APP` environment variable to the slug of the target application. See [Set Environment Variables](/reference/replicated-cli-installing#env-var) in _Installing the Replicated CLI_. ## Create a Release From a Local Directory {#dir} @@ -50,7 +44,7 @@ To create and promote a release: 1. In the same directory that contains the release files, add a HelmChart custom resource for each Helm chart in the release. See [Configuring the HelmChart Custom Resource](helm-native-v2-using). 1. Lint the application manifest files and ensure that there are no errors in the YAML: - + ```bash replicated release lint --yaml-dir=PATH_TO_RELEASE_DIR ``` diff --git a/docs/vendor/replicated-api-tokens.md b/docs/vendor/replicated-api-tokens.md index cd44785175..de610660b7 100644 --- a/docs/vendor/replicated-api-tokens.md +++ b/docs/vendor/replicated-api-tokens.md @@ -4,6 +4,8 @@ import TeamTokenNote from "../partials/vendor-api/_team-token-note.mdx" This topic describes the available types of API tokens and how to generate them for use with the Replicated CLI and Replicated Vendor API v3. +The Replicated CLI also supports creating multiple authentication profiles for managing tokens across different accounts or environments. For more information, see [Authenticate](/reference/replicated-cli-installing#auth) in _Installing the Replicated CLI_. + ## About API Tokens The Vendor API v3 is the API that manages applications in the Replicated Vendor Portal. The Replicated CLI is an implementation of the Vendor API v3. @@ -64,9 +66,11 @@ To generate a service account: 1. Copy the service account token and save it in a secure location. The token will not be available to view again. - :::note - To remove a service account, select **Remove** for the service account that you want to delete. - ::: +1. (Recommended) Add the token to a Replicated authentication profile. See [Authenticate](/reference/replicated-cli-installing#auth) in _Installing the Replicated CLI_. + +:::note +To remove a service account, select **Remove** for the service account that you want to delete. +::: ### Generate a User API Token @@ -93,6 +97,8 @@ To generate a user API token: 1. Copy the user API token that displays and save it in a secure location. The token will not be available to view again. - :::note - To revoke a token, select **Revoke token** for the token that you want to delete. - ::: +1. (Recommended) Add the token to a Replicated authentication profile. See [Authenticate](/reference/replicated-cli-installing#auth) in _Installing the Replicated CLI_. + +:::note +To revoke a token, select **Revoke token** for the token that you want to delete. +::: \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index e0bc307250..9341a61f5e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -717,6 +717,14 @@ const sidebars = { 'reference/replicated-cli-vm-versions', ], }, + { + type: 'category', + label: 'Replicated CLI Configuration File', + items: [ + 'reference/replicated-cli-config-file', + 'reference/replicated-cli-config-file-reference', + ], + }, { type: 'category', label: 'KOTS CLI',