@webdeb/gogi 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,28 +6,27 @@ Unlike other CLI assistants that require you to manage your own paid API keys, G
6
6
 
7
7
  ## ✨ Features
8
8
 
9
- - **Natural Language to Shell**: Tell Gogi what you want to do (e.g., `gogi how much space is left on my machine`) and it will propose the correct terminal command.
10
- - **Safe Execution Loop**: Gogi intercepts the AI's proposed commands and explicitly asks for your permission (`Allow? (y/N)`) before running anything. It will capture the `stdout` and `stderr` and feed it back to the LLM so it can learn from mistakes or chain commands together.
11
- - **Multi-Provider OAuth**: Sign in securely using your existing AI accounts. Supported providers include:
9
+ **Natural Language to Shell**: Tell Gogi what you want to do
10
+ `gogi how much space is left on my machine`
11
+
12
+ **Safe Execution Loop**: Gogi intercepts the AI's proposed commands and explicitly asks for your permission (`Allow? (y/N)`) before running anything. It will capture the `stdout` and `stderr` and feed it back to the LLM so it can learn from mistakes or chain commands together.
13
+
14
+ **Multi-Provider OAuth**: Sign in securely using your existing AI accounts. Supported providers include:
12
15
  - `codex` (ChatGPT Plus/Pro subscription)
13
16
  - `gemini` (Google Cloud)
14
17
  - `github` (GitHub Copilot)
15
- - **Auto-Generated System Context**: On first run, Gogi automatically profiles your machine (OS, architecture, shell) and generates a `~/.gogi/system.md` file. It injects this into the LLM's system prompt so the AI always knows what operating system and shell it's working with.
18
+
19
+ **Auto-Generated System Context**: On first run, Gogi automatically profiles your machine (OS, architecture, shell) and generates a `~/.gogi/system.md` file. It injects this into the LLM's system prompt so the AI always knows what operating system and shell it's working with.
16
20
 
17
21
  ---
18
22
 
19
23
  ## šŸš€ Installation
20
24
 
21
- 1. Clone or download the repository.
22
- 2. Install dependencies:
23
- ```bash
24
- npm install
25
- ```
26
- 3. Build the TypeScript source and link it globally:
27
- ```bash
28
- npm run build
29
- npm link
30
- ```
25
+ Install the package globally via npm:
26
+
27
+ ```bash
28
+ npm install -g @webdeb/gogi
29
+ ```
31
30
 
32
31
  You can now use the `gogi` command from anywhere in your terminal!
33
32
 
@@ -66,6 +65,11 @@ Simply type `gogi` followed by your request:
66
65
  gogi find all the .ts files in the current directory
67
66
  ```
68
67
 
68
+ > **Tip:** If your prompt contains special shell characters like `?` or `*`, be sure to wrap your prompt in quotes so your shell doesn't try to evaluate it as a file glob:
69
+ > ```bash
70
+ > gogi "what time is it?"
71
+ > ```
72
+
69
73
  ```bash
70
74
  šŸ¤” Gogi is thinking...
71
75
  āœ” Gogi wants to run:
package/dist/agent.js CHANGED
@@ -64,7 +64,7 @@ ${systemDetails}
64
64
  while (true) {
65
65
  let response;
66
66
  try {
67
- response = await (0, pi_ai_1.complete)(model, context, { apiKey: config.openaiApiKey });
67
+ response = await (0, pi_ai_1.complete)(model, context, { apiKey });
68
68
  }
69
69
  catch (err) {
70
70
  console.error(`āŒ API Error: ${err.message}`);
package/dist/auth.js CHANGED
@@ -50,11 +50,20 @@ async function loginFlow(provider = 'codex') {
50
50
  console.log(`\n🌐 Opening browser for sign-in... If it doesn't open automatically, visit:\n${info.url}`);
51
51
  if (info.instructions)
52
52
  console.log(info.instructions);
53
+ console.log(`\nIf you are on a headless machine or the browser doesn't redirect back:`);
54
+ console.log(`1. Open the URL above in any browser`);
55
+ console.log(`2. Complete the sign-in process`);
56
+ console.log(`3. Copy the URL you are redirected to (it will start with http://localhost...)`);
57
+ console.log(`4. Paste it here:`);
53
58
  (0, open_1.default)(info.url);
54
59
  },
55
60
  onPrompt: async (prompt) => {
56
61
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
57
62
  return new Promise((resolve) => rl.question(`${prompt.message} `, (answer) => { rl.close(); resolve(answer); }));
63
+ },
64
+ onManualCodeInput: async () => {
65
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
66
+ return new Promise((resolve) => rl.question(`> `, (answer) => { rl.close(); resolve(answer); }));
58
67
  }
59
68
  });
60
69
  }
@@ -63,7 +72,15 @@ async function loginFlow(provider = 'codex') {
63
72
  console.log(`\n🌐 Opening browser for sign-in... If it doesn't open automatically, visit:\n${info.url}`);
64
73
  if (info.instructions)
65
74
  console.log(info.instructions);
75
+ console.log(`\nIf you are on a headless machine or the browser doesn't redirect back:`);
76
+ console.log(`1. Open the URL above in any browser`);
77
+ console.log(`2. Complete the sign-in process`);
78
+ console.log(`3. Copy the URL you are redirected to (it will start with http://localhost...)`);
79
+ console.log(`4. Paste it here:`);
66
80
  (0, open_1.default)(info.url);
81
+ }, undefined, async () => {
82
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
83
+ return new Promise((resolve) => rl.question(`> `, (answer) => { rl.close(); resolve(answer); }));
67
84
  });
68
85
  }
69
86
  else if (provider === 'github') {
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ program
30
30
  console.log(`āœ… Active provider switched to ${provider}`);
31
31
  });
32
32
  program
33
- .argument('[prompt...]', 'The task you want gogi to perform')
33
+ .argument('[prompt...]', 'The task you want gogi to perform. Tip: use quotes if your prompt contains ?, *, or other special shell characters.')
34
34
  .action(async (promptArr) => {
35
35
  const prompt = promptArr.join(' ').trim();
36
36
  if (!prompt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webdeb/gogi",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Gogi CLI: An AI-powered terminal assistant with native device-code OAuth.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {