scm

所属分类:系统/网络安全
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2022-12-10 17:29:42
上 传 者sh-1993
说明:  ssh配置管理器,
(ssh config manager,)

文件列表:
.prettierrc (51, 2020-03-14)
Makefile (578, 2020-03-14)
bin/ (0, 2020-03-14)
bin/scm.js (175, 2020-03-14)
bin/scm.ts (64, 2020-03-14)
package.json (872, 2020-03-14)
src/ (0, 2020-03-14)
src/commands/ (0, 2020-03-14)
src/commands/add_command.ts (3108, 2020-03-14)
src/commands/delete_command.ts (1329, 2020-03-14)
src/commands/get_command.ts (915, 2020-03-14)
src/commands/import_command.ts (1420, 2020-03-14)
src/commands/list_command.ts (1287, 2020-03-14)
src/commands/search_command.ts (1091, 2020-03-14)
src/commands/update_command.ts (3675, 2020-03-14)
src/features/ (0, 2020-03-14)
src/features/ssh_client/ (0, 2020-03-14)
src/features/ssh_client/interfaces/ (0, 2020-03-14)
src/features/ssh_client/interfaces/create_ssh_client.interface.ts (127, 2020-03-14)
src/features/ssh_client/interfaces/update_ssh_client.interface.ts (129, 2020-03-14)
src/features/ssh_client/ssh_client.entity.ts (830, 2020-03-14)
src/features/ssh_client/ssh_client.service.ts (2175, 2020-03-14)
src/index.ts (1125, 2020-03-14)
src/utils/ (0, 2020-03-14)
src/utils/config.ts (1678, 2020-03-14)
src/utils/file.ts (1449, 2020-03-14)
src/utils/handle_connection.ts (503, 2020-03-14)
src/utils/print.ts (2152, 2020-03-14)
tsconfig.json (351, 2020-03-14)
tslint.json (425, 2020-03-14)
yarn.lock (59561, 2020-03-14)

# SCM ssh config manager with database, support sqlite3 or mysql. ## Install ```bash # use npm npm install -g node-scm # use yarn yarn global add node-scm ``` ## Changed Files + `~/.ssh/config` : Will add `Include scm_config` to the end of file if not exist. + `~/.ssh/scm_config` : Generated ssh config, included by `~/.ssh/config`. + `~/.ssh/scm_sql_application.json`: It will be created automatically the first time. + `~/.ssh/scm.sqlite`: If you use `sqlite` mode. ## Switch Database You can switch between `mysql` and `sqlite`, just edit `~/.ssh/scm_sql_application.json`. ``` { "sqlite": { "type": "sqlite", "database": "~/.ssh/scm.sqlite", # sqlite file "entities": ["dist/**/**.entity{.ts,.js}"], "synchronize": true }, "mysql": { "type": "mysql", "host": "127.0.0.1", # mysql host "port": 3306, # mysql port "username": "root", # mysql username "password": "1111", # mysql password "database": "scm", "entities": ["dist/**/**.entity{.ts,.js}"], "synchronize": true }, "use": "sqlite" # switch between "mysql" and "sqlite" } ``` ## Usage + Print help info: ``` > scm -h Usage: scm [options] 命令: scm add Add a ssh client. scm delete Delete one of the ssh client. scm get Get one of the ssh clients. scm list List all ssh clients. scm search Search by keywords. scm update Update one of the ssh client. scm import Import config from old node-scm. ``` + List all ssh clients: ``` scm list # list all scm list -d # list deleted ssh clients scm list -c # list ssh clients in the specified category scm list -h # print help info ``` + Delete the ssh client: ``` scm delete -a # delete ssh client scm delete -h # print help info ``` + Get one of ssh clients: ``` scm get -a # get ssh client scm get -h # print help info ``` + Search by keyword: ``` scm search -k # use * to match any character e.g. scm search -k *server # list all ssh keywords end with 'server' scm search -h # print help info ``` + Add ssh client: ``` # if both 'alias' and 'server' exist, it will be saved directly, otherwise enter interactive mode. scm add [-a ] [-s ] [-u ] [-p ] [-c ] scm add -h # print help info ``` + Update ssh client: ``` # if one of [rename, server, user, port, category] exist, it will be saved directly, otherwise enter interactive mode. scm update -a [-r ] [-s ] [-u ] [-p ] [-c ] scm update -h # print help info ``` + Import old version config. ``` # if you use an old version node-scm, you can import data to new version. # default path is `~/.ssh/scm.json` scm import [--path ] ``` ## Notice Since `Include scm_config` is at the end of `~/.ssh/config`, `Host` defined in `~/.ssh/scm_config` will be overwritten by the `Host` before `Include scm_config`.

近期下载者

相关文件


收藏者