# Use MOI-CLI

`moi-cli` operates Product resources in a terminal or script. A verified public distribution channel is not currently available. If you obtained the CLI through an official channel, use this page to verify the connection and workspace scope.

## 1. Configure the endpoint and credential

```shell
moi-cli config set-endpoint "<Product API Base URL ending in /newmoi>"
moi-cli config set-api-key "<personal-access-token>"
```

The endpoint must include `/newmoi`. Pass the personal access token unchanged without a `Bearer` prefix. Command-line arguments can enter terminal history, so configure credentials only in a protected local environment.

## 2. Discover and select a workspace

```shell
moi-cli -o workspace list
moi-cli config set-workspace "<workspace-id-from-list>"
```

A successful workspace list shows that the endpoint and personal access token work. Use the workspace name to identify it, but save and use its ID for subsequent commands.

## 3. Check the configuration

```shell
moi-cli config show
```

The output should show the complete endpoint and workspace ID, while `api_key` is masked. You can then run `moi-cli --help` or `moi-cli <command> --help` to choose a task.

## Next steps

- [Understand where MOI-CLI applies](../cli/index.md)
- [View complete configuration rules](../cli/configuration-authentication.md)
- [Choose common tasks](../cli/tasks/index.md)
