# export

The `onepub export` command works in concert with the `onepub import` command to log in to devices where the standard OnePub OAuth mechanism won't work as you don't have access to a browser.

See the [CI/CD](/guides/ci-cd.md) and [SSH](/guides/ssh.md) section for further details on using the onepub export/import commands in these scenarios.

{% hint style="danger" %}
The OnePub Token should always be managed and stored securely, as any person with access to the Token will have all the permissions of the Member the token is attached to.
{% endhint %}

### To export your own OnePub Token run:

```bash
onepub export
```

### To export another user's OnePub Token run:

```bash
onepub export --user <user email address>
```

You must be an Administrator or a Team Leader to export another Member's OnePub&#x20;

token. An Administrator can export anyone's token. A Team Leader can export the token of any Member of their team.

### Export to a file

The above export commands will display the OnePub Token to the console. You can combine the `--file` option with either of the above commands to output the token to a file.  If no file name is provided then we export the token to onepub.token.yaml.

```bash
onepub export --file
```

Alternatively, you can pass the name of the file to export the token to:

```bash
onepub export --file token.yaml
```


---

# 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.onepub.dev/guides/cli-integration/export.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.
