- Added `"commander": "^11.0.0"` as a dependency in the `package.json` file
- Added an `import { program } from 'commander'` statement in the `client.js` file
- Modified the `createdSession` function in the `client.js` file to use `program.opts().host` instead of `API_ENDPOINT`
- Added a `getSessionList` function in the `client.js` file to fetch the list of sessions
- Added a `lastSession` function in the `client.js` file to get the last session from the session list
- Added a `connect` function in the `client.js` file to establish a socket connection
- Modified the `main` function in the `client.js` file to use `program.opts().session` instead of `process.argv[2]` to get the session ID
- Modified the `main` function in the `client.js` file to use `program.opts().host` instead of `API_ENDPOINT` to initialize the socket connection
- Added a `program` object with options and actions in the `client.js` file
- Added `.bash_history` to the `.gitignore` file
- Added `.viminfo` to the `.gitignore` file
- Added `*.swp` to the `.gitignore` file
Signed-off-by: wancat <wancat@wancat.cc>
- Add the `jsonwebtoken` dependency to the server's `package.json`
- Add a new file `commandController.js` to the server's API controllers
- Add a new route `/commands` to the server's API routes
- Add a new file `commands.js` to the server's API routes
- Modify the `index.js` file in the server's API routes to import and use the `commands.js` route
- Add a `newCommand` function to the `commandController.js` file
- Add a `Command` model to the `command.js` file in the server's models
- Add the `genSessionJWT` and `verifySessionJWT` functions to the `auth.js` file in the server's utils
- Modify the `attachContainer` function in the `docker.js` file in the server's utils to include a `token` parameter
- Modify the `swagger.yaml` file to include a new route `/commands` for recording executed commands in a session
Signed-off-by: wancat <wancat@wancat.cc>