# list-roles

The `list-roles` command is a command to list available Service Providers that have roles that can be assumed.

## Usage

```
saml-to list-roles

Show roles that are available to assume

Options:
  --version   Show version number  [boolean]
  --help      Show help  [boolean]
  --org       Specify an organization  [string]
  --provider  Specify a provider  [string]
  --refresh   Refresh cached logins from source control  [boolean] [default: false]
```

## Options

### --org

In the event you're a member of multiple organizations, you can filter the output for a specific organization with this flag.

E.g. `npx saml-to list-roles --org stark-international`

### --provider

In the event you have a large list of providers, you can filter the output for a specific provider with this flag.

E.g. `npx saml-to list-roles --provider aws-iam`

### --refresh

SAML.to performs some caching of available logins on the backend. In the event the outputted list seems out-of-sync with what should be available, add the `--refresh` flag to the command.

The refreshed output will appear as normal, but the command might take a few extra seconds to run while the cache on the backend is refreshed.

**Note:** The `--org` flag is required for a refresh

E.g. `npx saml-to list-roles --org stark-international --refresh`

## Example Output

```
➜  ~ npx saml-to list-roles
npx: installed 1 in 3.071s
┌─────────┬───────────────────────────────────────────────┬───────────┬───────────────────────┐
│ (index) │                     role                      │ provider  │          org          │
├─────────┼───────────────────────────────────────────────┼───────────┼───────────────────────┤
│    0    │ 'arn:aws:iam::874599868815:role/iam-readonly' │ 'aws-iam' │ 'stark-international' │
└─────────┴───────────────────────────────────────────────┴───────────┴───────────────────────┘

➜  ~
```

```
➜  ~ npx saml-to list-roles --refresh --org stark-international
npx: installed 1 in 1.281s
┌─────────┬───────────────────────────────────────────────┬───────────┬───────────────────────┐
│ (index) │                     role                      │ provider  │          org          │
├─────────┼───────────────────────────────────────────────┼───────────┼───────────────────────┤
│    0    │ 'arn:aws:iam::874599868815:role/iam-readonly' │ 'aws-iam' │ 'stark-international' │
└─────────┴───────────────────────────────────────────────┴───────────┴───────────────────────┘

➜  ~
```

```
➜  ~ npx saml-to list-roles --refresh --org stark-international --provider aws-iam
npx: installed 1 in 1.242s
┌─────────┬───────────────────────────────────────────────┬───────────┬───────────────────────┐
│ (index) │                     role                      │ provider  │          org          │
├─────────┼───────────────────────────────────────────────┼───────────┼───────────────────────┤
│    0    │ 'arn:aws:iam::874599868815:role/iam-readonly' │ 'aws-iam' │ 'stark-international' │
└─────────┴───────────────────────────────────────────────┴───────────┴───────────────────────┘

➜  ~
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saml.to/usage/cli/list-roles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
