{
  "id": "ssh",
  "name": "OpenSSH",
  "homepage": "https://www.openssh.com",
  "description": "The OpenSSH client: encrypted remote login, and a config that names how to reach each host.",
  "icon": "theSVG:ssh",
  "executables": [
    "ssh"
  ],
  "dotfiles": {
    "paths": [
      "~/.ssh/config",
      "~/.ssh/config.d/"
    ],
    "exclude": [
      "~/.ssh/known_hosts",
      "~/.ssh/known_hosts.old",
      "~/.ssh/authorized_keys"
    ],
    "secret": [
      "~/.ssh/id_*",
      "~/.ssh/*.pem",
      "~/.ssh/*.key"
    ],
    "machine_lines": [
      {
        "file": "~/.ssh/config",
        "match": {
          "prefix": [
            "IdentityFile",
            "IdentityAgent",
            "ControlPath",
            "UserKnownHostsFile"
          ]
        },
        "scope": "backup"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "SSH connection",
    "description": "Connect to a host with a user, port, identity file and common forwarding options. Cipher, MAC and PKCS#11 options are left out.",
    "quality": "ai-draft",
    "base": "fig:ssh",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/ssh.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "host",
        "label": "Host",
        "type": "string",
        "position": 0,
        "description": "Address of the remote machine, optionally user@hostname.",
        "provider": "builtin:ssh.hosts",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "login",
        "label": "Login name",
        "type": "string",
        "option": [
          "-l"
        ],
        "description": "The user to log in as on the remote machine.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "port",
        "label": "Port",
        "type": "integer",
        "option": [
          "-p"
        ],
        "description": "Port to connect to on the remote host.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "identity",
        "label": "Identity file",
        "type": "path",
        "option": [
          "-i"
        ],
        "description": "Private key file for public key authentication.",
        "multiple": true,
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "config",
        "label": "Config file",
        "type": "path",
        "option": [
          "-F"
        ],
        "description": "An alternative per-user configuration file.",
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "local_forward",
        "label": "Local forward",
        "type": "string",
        "option": [
          "-L"
        ],
        "description": "Forward a local port: port:host:hostport.",
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "remote_forward",
        "label": "Remote forward",
        "type": "string",
        "option": [
          "-R"
        ],
        "description": "Forward a remote port: port:host:hostport.",
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "dynamic_forward",
        "label": "Dynamic forward port",
        "type": "string",
        "option": [
          "-D"
        ],
        "description": "Local dynamic application-level port forwarding (SOCKS).",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "jump",
        "label": "Option (key=value)",
        "type": "string",
        "option": [
          "-o"
        ],
        "description": "Option in config-file format, e.g. ServerAliveInterval=30.",
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "agent",
        "label": "Forward agent",
        "type": "boolean",
        "option": [
          "-A"
        ],
        "description": "Enable forwarding of the authentication agent connection.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "compress",
        "label": "Compress",
        "type": "boolean",
        "option": [
          "-C"
        ],
        "description": "Request compression of all data.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_command",
        "label": "No remote command",
        "type": "boolean",
        "option": [
          "-N"
        ],
        "description": "Do not execute a remote command; useful for forwarding.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "background",
        "label": "Go to background",
        "type": "boolean",
        "option": [
          "-f"
        ],
        "description": "Go to background just before command execution.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "force_tty",
        "label": "Force TTY",
        "type": "boolean",
        "option": [
          "-t"
        ],
        "description": "Force pseudo-tty allocation.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "x11",
        "label": "X11 forwarding",
        "type": "boolean",
        "option": [
          "-X"
        ],
        "description": "Enable X11 forwarding.",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "verbose",
        "label": "Verbosity",
        "type": "count",
        "option": [
          "-v"
        ],
        "description": "Verbose mode; repeat for more debugging output.",
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "connect",
        "label": "Connect",
        "fields": [
          "host",
          "login",
          "port",
          "identity"
        ],
        "required": [
          "host"
        ]
      },
      {
        "id": "tunnel",
        "label": "Port-forward tunnel",
        "set": {
          "no_command": [
            true
          ]
        },
        "fields": [
          "host",
          "local_forward",
          "port",
          "identity"
        ],
        "required": [
          "host",
          "local_forward"
        ]
      },
      {
        "id": "socks",
        "label": "SOCKS proxy",
        "set": {
          "no_command": [
            true
          ]
        },
        "fields": [
          "host",
          "dynamic_forward",
          "identity"
        ],
        "required": [
          "host",
          "dynamic_forward"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "host",
          "login",
          "port",
          "identity",
          "local_forward",
          "remote_forward",
          "dynamic_forward",
          "no_command"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "config",
          "jump",
          "agent",
          "compress",
          "background",
          "force_tty",
          "x11",
          "verbose"
        ]
      }
    ]
  }
}
