# Init Command

## `init` command

**Description:** Initialize a one time access token

**Parameters:**

Sub-command to run

format: **`ksm init <sub-command>`**

**Sub-Commands:**

<table data-header-hidden><thead><tr><th width="210.5">Sub-Command</th><th>Description</th></tr></thead><tbody><tr><td>Sub-Command</td><td>Description</td></tr><tr><td><code>default</code></td><td>Return the redeemed token as base64 encoded JSON</td></tr><tr><td><code>k8s</code></td><td>Return the redeemed token as Kubernetes secret script.</td></tr></tbody></table>

### **default**

Initialize a one time access token and create a configuration profile for use with external integrations like Github Actions, Terraform and others. The output of the configuration can be generated as either base64 encoded JSON (default), or k8s format. Other KSM Developer SDKs, and applications, will understand configurations in this format.

`ksm init default <TOKEN>`

optional parameters:

* `--plain` do not base64 encode the configuration. Return plain JSON.
* `-h, --hostname` change the hostname
* `--skip-ssl-verify` - Do not verify the remote SSL certificate.

```
$ ksm init default XX:XXXX

ewogICAgImNsaWVudElkIjogInd ... U1R4eUQrU3ZNbkhrMTVLUHRGS2MrZlZJOGtlOUtL==
```

### k8s

Initialize a one time access token into a Kubernetes secret script.

`ksm init k8s <TOKEN>`

optional parameters:

* `--name, -n` Name of the Kubernetes secret. Default is **ksm-config**.
* `--namespace, --ns` Name of the Kubernetes namespace. Default is **default**.
* `--apply` Automatically use kubectl to apply the secret. You will not see the secret script.
* `--immutable, -i` Make the secret immutable. Requires Kubernetes >= 1.21
* `-h, --hostname` change the hostname
* `--skip-ssl-verify` - Do not verify the remote SSL certificate.

```
$ksm init k8s XX:XXXX

apiVersion: v1
data
  config: ewogICAgImNsaWVudElkIjogIml ... dWJsaWNLZXlJZCI6ICIxMCIKfQ==
kind: Secret
metadata:
  name: ksm-config
  namespace: default
type: Opaque
```


---

# 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.keeper.io/keeperpam/secrets-manager/secrets-manager-command-line-interface/init-command.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.
