---
name: keepass_generate
kind: function
lang: bash
domain: infra
version: "1.0.0"
purity: impure
signature: "keepass_generate(entry: string, length?: int, username?: string, url?: string) -> string"
description: "Genera un password aleatorio (lower+upper+digits+special), lo almacena en una entry nueva y lo imprime a stdout. Length default 24."
tags: [keepass, keepassxc, secret, credential, generate, random, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: []
params:
  - name: entry
    desc: "path de la entry a crear"
  - name: length
    desc: "longitud del password (default 24)"
  - name: username
    desc: "username opcional"
  - name: url
    desc: "url opcional"
output: "password generado en texto plano"
tested: false
tests: []
test_file_path: ""
file_path: "bash/functions/infra/keepass_generate.sh"
---

## Ejemplo

```bash
source keepass_generate.sh
pwd=$(keepass_generate "Servers/new-vps" 32 "deploy" "https://vps.example.com")
echo "Generated: $pwd"
```

## Notas

- Genera con `keepassxc-cli generate -l -U -n -s` (lower, upper, numbers, special).
- Inserta con `keepassxc-cli add -p` reusando la misma sesion.
- El grupo padre debe existir.
