---
title: "alpacon work-session use"
description: "Set or clear the active Alpacon work session for the current workspace. Subsequent exec, websh, cp, and tunnel commands attach to this session automatically."
---

> Full documentation index: https://docs.alpacax.com/llms.txt

# alpacon work-session use

Set or clear the active work session for the current workspace.

## Usage

`alpacon work-session use [SESSION_ID] [flags]`

## Key facts

- Only a session in the `active` state can be selected.
- Later `exec`, `websh`, `cp`, and `tunnel` commands use the selected session.
- Use `--unset` without an ID to clear the selection.

## Flags

| Flag | Type | Description | Default |
| --- | --- | --- | --- |
| `-h, --help` | `bool` | help for use | `false` |
| `--unset` | `bool` | Clear the active work-session for the current workspace | `false` |
| `--output` | `string` | Output format: table or json | `table` |

## Examples

Set the active session

```bash
alpacon work-session use 11111111-2222-3333-4444-555555555555
```

Clear the active session

```bash
alpacon work-session use --unset
```

See [Selecting a session](/reference/cli/work-session/#selecting-a-session) for how the active session interacts with the `--work-session` flag and the `ALPACON_WORK_SESSION` environment variable.

An agent session cannot be the workspace’s active session, even when its status is `active`. Pass `--work-session SESSION_ID` to each command or set `ALPACON_WORK_SESSION` in the agent’s environment.

Source: https://docs.alpacax.com/reference/cli/work-session/use/
