# Using Cli For Automation

The Platform9 CLI, *pf9ctl* command, can be used with the `--no-prompt`flag. This allows the CLI to operate within a given automation framework such as Ansible. When using the *`--no-prompt`* flag, a CLI command runs in a non-interactive mode that requires no interaction from the user, as it disables all typical user prompts. When a command completes with a zero exit code, it indicates the command has succeeded. A non-zero exit code indicates failure. The CLI commands produces a non-zero code if the required flags are not provided to a sub-command or if an error occurs.

## Flag Examples

{% tabs %}
{% tab title="Bash" %}

```bash
Flags:
  -h, --help        help for pf9ctl
      --no-prompt   disable all user prompts
      --verbose     print verbose logs
```

{% endtab %}
{% endtabs %}

## Example Bootstrap

{% tabs %}
{% tab title="Bash" %}

```bash
#pf9ctl bootstrap --no-prompt
```

{% endtab %}
{% endtabs %}

## Example Attach Node

{% tabs %}
{% tab title="Bash" %}

```bash
pf9ctl attach-node --no-prompt <cluster-name>
```

{% endtab %}
{% endtabs %}


---

# 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.platform9.com/managed-kubernetes/5.9/using-cli-for-automation.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.
