Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rximg committed Feb 6, 2023
1 parent 1cf4c79 commit b190eff
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ package-lock.json
src/index copy.ts
*.py
static/*
b2p.exe
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# b2p: Linux Bash to PowerShell Translator
With our advanced natural language understanding capabilities, we have designed a console tool that translates Linux commands into PowerShell commands.
This tool will make your experience with PowerShell more seamless, especially if you are already familiar with Linux and find the PowerShell commands challenging to recall.

## Download
Download the app from the release page and copy b2p.exe into the Windows folder in the system drive.

## Configure API Key
To obtain the API key, visit the OpenAI official website. Then, set the API key in a JSON file named ".config" located in the user path.

## Usage:
Use the repository as follows:

```b2p ls *.jpg```

You can also wrap the command with if there are characters in the command that need to be escaped. For example, characters like '|' need to be escaped, like so:

```b2p 'ls *.jpg | wc'```

## Development
#### package
```npx webpack```
#### release
```pkg dist/b2p.js --target node18-win-x64```

## Future plans
1. To change the configuration item to be input by natural language and parsed and executed by GPT.
2. Add proxy support if required.
3. Optimize the packaging issue.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "gptprj",
"name": "b2p",
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"pkg": {
"scripts": "dist/*.js",
"scripts": "dist/b2p.js",
"assets": "static/*",
"target": [
"node18-win-x64"
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChatGPTAPI } from 'chatgpt'
import child_process from 'child_process'
import * as robot from 'robotjs'
// import child_process from 'child_process'
// import * as robot from 'robotjs'
import * as fs from 'fs';
import * as os from 'os';
// import * as keySender from "node-key-sender"
Expand Down Expand Up @@ -48,7 +48,7 @@ async function main() {
promptPrefix: preprompt
})
console.log(res.text)
robot.typeString(res.text)
// robot.typeString(res.text)

}

Expand Down

0 comments on commit b190eff

Please sign in to comment.