The onepassword secret provider resolves values either with the official 1Password Go SDK or with the op CLI session.
Service account token:
[providers]
paths = ["~/.config/lssh/providers/provider-secret-onepassword"]
[provider.onepassword]
plugin = "provider-secret-onepassword"
enabled = true
capabilities = ["secret"]
auth_mode = "service_account"
token_env = "OP_SERVICE_ACCOUNT_TOKEN"
[server.prod]
addr = "10.0.0.10"
user = "ec2-user"
key_ref = "onepassword:op://Infra/prod/key/private"
keypass_ref = "onepassword:op://Infra/prod/key/passphrase"CLI session after op signin:
[providers]
paths = ["~/.config/lssh/providers/provider-secret-onepassword"]
[provider.onepassword]
plugin = "provider-secret-onepassword"
enabled = true
capabilities = ["secret"]
auth_mode = "cli"providers.pathsis intended to list provider executable files.- Avoid storing service account tokens directly in
~/.lssh.tomlwhentoken_envortoken_sourcecan be used instead. auth_modecan be one of:autoservice_accountcli
auth_mode = "auto"is the default.- In
automode:- if
tokenis available, the provider uses the 1Password Go SDK - otherwise it falls back to the
opCLI session
- if
- In
service_accountmode:- the provider uses the official 1Password Go SDK
tokenis required and should be a 1Password service account token
- In
climode:- the provider uses
op read <ref> op signinor Desktop integration must already be available in the local environment
- the provider uses
- Recommended token configuration order:
token_env = "OP_SERVICE_ACCOUNT_TOKEN"token_source = "~/.config/lssh/provider-onepassword.env"token = "ops_xxx"for minimal local examples only
- When
token_sourceis used, the file is parsed as an env file likeKEY=valueorexport KEY=value. token_source_envcan be used to select the variable name inside the source file. If omitted,TOKENis used.op_pathcan be used to override the CLI path. If omitted,opis used.- Secret refs use the normal 1Password secret reference format such as
op://Vault/item/field. - For CI or non-interactive environments,
service_accountis recommended. - For personal interactive environments where
op signinis already used,cliorautois usually the easiest option.