创建节点
命令:clash nodes 或 clash -n
- 方法:
- 可以使用默认配置,输入节点名称和类型,
clash nodes -n test_node TYPE=parent Node=123456789. - 如果需要指定父节点,可以使用
clash nodes -p,然后输入父节点的名称和类型,clash nodes -p test_parent TYPE=parent Node=123456789. - 如果需要删除节点,可以使用
clash nodes -d或clash -d,并指定删除该节点和其父节点。
- 可以使用默认配置,输入节点名称和类型,
删除节点
命令:clash -n -d 或 clash -d
- 方法:
- 使用
clash -d或clash -n -d,指定节点名称和类型,clash -d test_node. - 可以指定是否保留父节点,
clash -d test_node -p keep_parent。
- 使用
修改节点
命令:clash -n 或 clash -n -s
- 方法:
- 修改父节点,使用
clash -n,指定父节点名称和类型,clash -n parent_node TYPE=child Node=123456789. - 修改节点状态,使用
clash -n -s,指定节点类型,clash -n -s TYPE=active Node=123456789.
- 修改父节点,使用
删除节点(更复杂)
命令:clash -n -d 或 clash -d
- 方法:
- 通过
clash -n -d或clash -d,指定节点名称和类型,clash -n -d test_node. - 如果需要保留父节点,使用
clash -n -p -d,指定父节点类型和状态,clash -n -p test_parent TYPE=parent Node=123456789 -d test_node.
- 通过
复制或重置配置
命令:clash -x
- 方法:
- 使用
clash -x,可以重置配置文件,保存修改后的状态,clash -x nodes.json.
- 使用
后续操作
命令:clash -c
- 方法:
- 使用
clash -c,可以保存修改后的配置文件,clash -c nodes.json.
- 使用
注意事项
- 节点生命周期:确保节点的生命周期正确,例如节点是否需要定期更新,是否需要管理父节点关系。
- 错误处理:在使用命令时,检查输出提示是否正确,确保参数和选项输入正确。
通过这些命令和选项,可以有效地管理Clash节点,确保它们在控制台中正常工作。









