> ## Documentation Index
> Fetch the complete documentation index at: https://capy.sc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# capy lock: Lock a Local-Only Key

> Clear the unlocked local-only session so the next command requires the local passphrase.

## Synopsis

```bash theme={null}
capy lock
```

## Description

`capy lock` applies only to a local-only profile. It clears the cached unlocked session; the next command that needs the local key prompts for the passphrase again. There is no separate `capy unlock` command because Capy unlocks on demand.

Local-only sessions also lock after their configured idle timeout, which defaults to one hour. Running `capy lock` is useful before you leave a shared machine.

In cloud and BYOC profiles, `capy lock` reports that it applies only to local-only mode. Use [`capy logout`](/docs/cli/logout) to end an authenticated cloud or BYOC session; logout does not clear local-only key material.

## See also

* [`capy logout`](/docs/cli/logout) — end a cloud or BYOC session


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.