---
name: "kas-for-all-repos"
section: "1"
platform: "linux"
package: "kas"
version: "4.8.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kas-for-all-repos"
---

# kas-for-all-repos(1)

kas for-all-repos plugin

## NAME

kas-for-all-repos - kas for-all-repos plugin

## SYNOPSIS

```
kas for-all-repos [-h] [--skip STEP] [--force-checkout] [--update] [-E] [-k]
                  [config] command
```

## DESCRIPTION

Runs a specified command in all checked out repositories.

This plugin implements the **kas for-all-repos** command.

When this command is executed, kas will checkout the repositories listed in the chosen config file and then execute a specified command in each repository. It can be used to query the repository status, automate actions such as archiving the layers used in a build or to execute any other required commands.

For example, to print the commit hashes used by each repository used in the file **kas-project.yml** (assuming they are all git repositories) you could run:

```
kas for-all-repos kas-project.yml 'git rev-parse HEAD'
```

The environment for executing the command in each repository is extended to include the following variables:

- •

  **KAS\_REPO\_NAME**: The name of the current repository determined by either the name property or by the key used for this repo in the config file.

- •

  **KAS\_REPO\_PATH**: The path of the local directory where this repository is checked out, relative to the directory where **kas** is executed.

- •

  **KAS\_REPO\_URL**: The URL from which this repository was cloned, or an empty string if no remote URL was given in the config file.

- •

  **KAS\_REPO\_COMMIT**: The commit ID which was checked out for this repository, or an empty string if no commit was given in the config file.

- •

  **KAS\_REPO\_BRANCH**: The branch which was checked out for this repository, or an empty string if no branch was given in the config file.

- •

  **KAS\_REPO\_TAG**: The tag which was checked out for this repository, or an empty string if no tag was given in the config file.

- •

  **KAS\_REPO\_REFSPEC**: The refspec which was checked out for this repository, or an empty string if no refspec was given in the config file. This variable is obsolete and will be removed when support for refspec keys is removed as well. Migrate your repos to commit/branch and use the related variables instead.

## OPTIONS

**Positional Arguments**

- **config**

  Config file(s), separated by colon. Using .config.yaml in KAS\_WORK\_DIR if none is specified.

- **command**

  Command to be executed as a string.

**Named Arguments**

- **--skip=\[\]**

  Skip build steps. To skip more than one step, use this argument multiple times.

  Possible choices: setup\_dir, setup\_home, init\_setup\_repos, repo\_setup\_loop, finish\_setup\_repos, repos\_checkout, repos\_check\_signatures, repos\_apply\_patches, setup\_environ, write\_bbconfig

- **--force-checkout=False**

  Always checkout the desired commit/branch/tag of each repository, discarding any local changes

- **--update=False**

  Pull new upstream changes to the desired branch even if it is already checked out locally

- **-E=False, --preserve-env=False**

  Keep current user environment block

- **-k, --keep-config-unchanged**

  Skip steps that change the configuration

## KAS

Part of the **[kas(1)](/kas/1.md)** suite.

## AUTHOR

Daniel Wagner, Jan Kiszka, Claudius Heine

## COPYRIGHT

Siemens and contributors, 2017-2025
