# 快速上手: 添加新驱动

如果设备是通过命令行直接调用驱动程序中的可执行文件进行通信，Shifu支持将他直接接入，从而可以远程操作使用这类驱动的设备。

## HTTP to SSH driver stub

这个组件的功能是将接收到的HTTP请求转化为对驱动可执行文件的命令并远程执行。

## 配置

首先，我们需要将带有可执行文件的驱动打包成一个Docker容器镜像。

在Deployment的配置中，Shifu需要下列四个元素:

* **EDGEDEVICE\_DRIVER\_SSH\_KEY\_PATH**：SSH key 的路径，Shifu需要通过它来访问驱动的容器。
* **EDGEDEVICE\_DRIVER\_HTTP\_PORT**(可选): 驱动容器的HTTP服务器端口，默认值为`11112`.
* **EDGEDEVICE\_DRIVER\_EXEC\_TIMEOUT\_SECOND**(可选): 一个操作的超时设置。
* **EDGEDEVICE\_DRIVER\_SSH\_USER**(可选): 通过 SSH 连接到驱动程序容器的用户，默认为`root`。

下面是一个简单的例子:

```
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: driver
  name: driver
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: driver
  template:
    metadata:
      labels:
        app: driver
    spec:
      containers:
      - image: http2ssh-stub:v0.0.1
        name: driver
        ports:
        - containerPort: 11112
        env:
        - name: EDGEDEVICE_DRIVER_SSH_KEY_PATH
          value: "/etc/ssh/ssh_host_rsa_key"
        - name: EDGEDEVICE_DRIVER_HTTP_PORT
          value: "11112"
        - name: EDGEDEVICE_DRIVER_EXEC_TIMEOUT_SECOND
          value: "5"
        - name: EDGEDEVICE_DRIVER_SSH_USER
          value: "root"
      - image: nginx:1.21
        name: nginx
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cn.docs.edgenesis.io/getting_started_add_new_commandline_driver.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
