browse-code 0.1.3__tar.gz → 0.2.0__tar.gz

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.
Files changed (26) hide show
  1. browse_code-0.2.0/PKG-INFO +124 -0
  2. {browse_code-0.1.3 → browse_code-0.2.0}/README.md +4 -0
  3. browse_code-0.2.0/browse_code/__init__.py +1 -0
  4. browse_code-0.2.0/browse_code/cli.py +204 -0
  5. browse_code-0.2.0/browse_code/extension/icon128.png +0 -0
  6. browse_code-0.2.0/browse_code/extension/icon16.png +0 -0
  7. browse_code-0.2.0/browse_code/extension/icon48.png +0 -0
  8. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/extension/manifest.json +11 -1
  9. browse_code-0.2.0/browse_code.egg-info/PKG-INFO +124 -0
  10. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code.egg-info/SOURCES.txt +3 -0
  11. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code.egg-info/requires.txt +1 -0
  12. {browse_code-0.1.3 → browse_code-0.2.0}/setup.py +6 -3
  13. browse_code-0.1.3/PKG-INFO +0 -9
  14. browse_code-0.1.3/browse_code/__init__.py +0 -1
  15. browse_code-0.1.3/browse_code/cli.py +0 -133
  16. browse_code-0.1.3/browse_code.egg-info/PKG-INFO +0 -9
  17. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/extension/content.js +0 -0
  18. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/extension/popup.html +0 -0
  19. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/extension/popup.js +0 -0
  20. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/extension/spoof.js +0 -0
  21. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code/server.py +0 -0
  22. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code.egg-info/dependency_links.txt +0 -0
  23. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code.egg-info/entry_points.txt +0 -0
  24. {browse_code-0.1.3 → browse_code-0.2.0}/browse_code.egg-info/top_level.txt +0 -0
  25. {browse_code-0.1.3 → browse_code-0.2.0}/pyproject.toml +0 -0
  26. {browse_code-0.1.3 → browse_code-0.2.0}/setup.cfg +0 -0
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: browse_code
3
+ Version: 0.2.0
4
+ Summary: Turn any AI chatbot into an autonomous coding agent
5
+ Description-Content-Type: text/markdown
6
+ Requires-Dist: fastapi
7
+ Requires-Dist: uvicorn
8
+ Requires-Dist: pydantic
9
+ Requires-Dist: rich
10
+ Dynamic: description
11
+ Dynamic: description-content-type
12
+ Dynamic: requires-dist
13
+ Dynamic: summary
14
+
15
+ <p align="center">
16
+ <img src="logo.png" alt="Browse Code" width="200">
17
+ </p>
18
+
19
+ # Browse Code
20
+
21
+ ![PyPI version](https://badge.fury.io/py/browse-code.svg)
22
+ ![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)
23
+ ![License](https://img.shields.io/badge/license-MIT-green)
24
+
25
+ **Browse Code** is a CLI tool that turns any AI chatbot (ChatGPT, Gemini, Claude, HuggingFace) into an autonomous coding agent. It bridges your browser and local terminal, letting AI read/write files, run commands, and manage processes on your machine.
26
+
27
+ ## How It Works
28
+
29
+ Browse Code has two parts:
30
+
31
+ 1. **A local server** that exposes your file system and terminal to the AI via a secure API.
32
+ 2. **A Chrome extension** that injects agent capabilities into AI chat interfaces.
33
+
34
+ When connected, you can ask ChatGPT/Gemini/Claude to edit files, run scripts, search code, and more — all executed locally on your machine.
35
+
36
+ ## Setup
37
+
38
+ ### Step 1: Install the package
39
+
40
+ ```bash
41
+ pip install browse-code
42
+ ```
43
+
44
+ ### Step 2: Run the CLI
45
+
46
+ ```bash
47
+ bc
48
+ ```
49
+
50
+ > If `bc` is not found, add your Python Scripts folder to PATH:
51
+ > ```bash
52
+ > # Windows (PowerShell)
53
+ > $env:Path += ";$env:APPDATA\Python\Python312\Scripts"
54
+ >
55
+ > # Or run directly
56
+ > python -m browse_code.cli
57
+ > ```
58
+
59
+ ### Step 3: First-run extension setup
60
+
61
+ On the first run, `bc` will guide you through a one-time Chrome extension setup:
62
+
63
+ 1. It asks for your permission to extract the extension files.
64
+ 2. It copies the extension to `~/.browse_code/extension/` and copies the path to your clipboard.
65
+ 3. It opens `chrome://extensions/` in your browser automatically.
66
+ 4. You enable **Developer mode** (top-right toggle), click **Load unpacked**, and paste the path.
67
+ 5. Press Enter in the terminal and the server starts.
68
+
69
+ **You only do this once.** The extension stays loaded in Chrome across sessions.
70
+
71
+ ### Step 4: Start an AI session
72
+
73
+ 1. Open any supported AI chat (ChatGPT, Gemini, Claude, or HuggingFace Chat).
74
+ 2. Click the Browse Code Bridge extension icon and set your workspace directory.
75
+ 3. Click "Initialize Agent in Chat".
76
+ 4. Start coding with AI — it now has full access to your local environment.
77
+
78
+ ## Subsequent Usage
79
+
80
+ After the first-time setup, just run:
81
+
82
+ ```bash
83
+ bc
84
+ ```
85
+
86
+ The server starts immediately. Open your AI chat tab and you're ready to go. The server terminal will show:
87
+ - A startup banner with your workspace and endpoint
88
+ - `[+] Extension connected` when the browser extension connects
89
+ - Real-time logs of every file read, write, command execution, and diff
90
+
91
+ ## Features
92
+
93
+ - **File Operations:** Read, write, and patch files with inline terminal diffs
94
+ - **Code Search:** Search across your entire codebase by keyword
95
+ - **Terminal Commands:** Run shell commands with full stdout/stderr capture
96
+ - **Background Processes:** Start, monitor, and kill long-running processes
97
+ - **Multi-Platform AI:** Works with ChatGPT, Gemini, Claude, and HuggingFace Chat
98
+ - **Extension Heartbeat:** Server detects when the browser extension connects/disconnects
99
+
100
+ ## For Developers
101
+
102
+ 1. Clone the repository:
103
+ ```bash
104
+ git clone https://github.com/Dedeep007/browse_code.git
105
+ cd browse_code
106
+ ```
107
+ 2. Install in editable mode:
108
+ ```bash
109
+ pip install -e .
110
+ ```
111
+
112
+ ## Contributing
113
+
114
+ Contributions are welcome! Please feel free to submit a Pull Request.
115
+
116
+ 1. Fork the repository.
117
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
118
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
119
+ 4. Push to the branch (`git push origin feature/AmazingFeature`).
120
+ 5. Open a Pull Request.
121
+
122
+ ## License
123
+
124
+ Distributed under the MIT License.
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="logo.png" alt="Browse Code" width="200">
3
+ </p>
4
+
1
5
  # Browse Code
2
6
 
3
7
  ![PyPI version](https://badge.fury.io/py/browse-code.svg)
@@ -0,0 +1 @@
1
+ __version__ = "0.2.0"
@@ -0,0 +1,204 @@
1
+ import os
2
+ import sys
3
+ import shutil
4
+ import platform
5
+ import subprocess
6
+ import webbrowser
7
+ from pathlib import Path
8
+
9
+ # ── Rich TUI imports ──────────────────────────────────────
10
+ from rich.console import Console
11
+ from rich.panel import Panel
12
+ from rich.text import Text
13
+ from rich.table import Table
14
+ from rich.prompt import Prompt, Confirm
15
+ from rich import box
16
+
17
+ console = Console()
18
+
19
+ PORT = 5505
20
+ HOST = "127.0.0.1"
21
+
22
+
23
+ def get_data_dir():
24
+ """Return ~/.browse_code, creating it if needed."""
25
+ data_dir = Path.home() / ".browse_code"
26
+ data_dir.mkdir(exist_ok=True)
27
+ return data_dir
28
+
29
+
30
+ def copy_to_clipboard(text):
31
+ """Copy text to the system clipboard (cross-platform)."""
32
+ try:
33
+ system = platform.system()
34
+ if system == "Windows":
35
+ subprocess.run("clip", input=text.encode("utf-8"), check=True)
36
+ elif system == "Darwin":
37
+ subprocess.run("pbcopy", input=text.encode("utf-8"), check=True)
38
+ else:
39
+ try:
40
+ subprocess.run(
41
+ ["xclip", "-selection", "clipboard"],
42
+ input=text.encode("utf-8"),
43
+ check=True,
44
+ )
45
+ except FileNotFoundError:
46
+ subprocess.run(
47
+ ["xsel", "--clipboard", "--input"],
48
+ input=text.encode("utf-8"),
49
+ check=True,
50
+ )
51
+ return True
52
+ except Exception:
53
+ return False
54
+
55
+
56
+ def print_banner():
57
+ """Print the Browse Code ASCII art banner."""
58
+ banner_text = Text()
59
+ banner_text.append(" { ", style="bold cyan")
60
+ banner_text.append("Browse Code", style="bold white")
61
+ banner_text.append(" }", style="bold cyan")
62
+
63
+ console.print()
64
+ console.print(
65
+ Panel(
66
+ banner_text,
67
+ box=box.DOUBLE,
68
+ border_style="cyan",
69
+ padding=(1, 4),
70
+ )
71
+ )
72
+
73
+
74
+ def setup_extension():
75
+ """First-time setup: extract extension, open Chrome, guide the user."""
76
+ data_dir = get_data_dir()
77
+ ext_dest = data_dir / "extension"
78
+ pkg_ext_dir = Path(__file__).parent / "extension"
79
+
80
+ print_banner()
81
+ console.print()
82
+ console.print(
83
+ Panel(
84
+ "[bold]First Time Setup[/bold]\n\n"
85
+ "Browse Code needs a Chrome extension to connect\n"
86
+ "your browser to the local server.",
87
+ border_style="yellow",
88
+ box=box.ROUNDED,
89
+ padding=(1, 2),
90
+ )
91
+ )
92
+
93
+ if not Confirm.ask("\n Do you want to set up the extension now?", default=True):
94
+ console.print(" [dim]Skipped. Re-run 'bc' anytime to set it up.[/dim]")
95
+ return False
96
+
97
+ # Extract extension files
98
+ console.print()
99
+ with console.status("[cyan]Extracting extension files...[/cyan]"):
100
+ if ext_dest.exists():
101
+ shutil.rmtree(ext_dest)
102
+ shutil.copytree(pkg_ext_dir, ext_dest)
103
+
104
+ ext_path_str = str(ext_dest)
105
+ console.print(f" [green]Extracted to:[/green] [bold]{ext_path_str}[/bold]")
106
+ console.print()
107
+
108
+ # Copy path to clipboard
109
+ copied = copy_to_clipboard(ext_path_str)
110
+
111
+ # Open chrome://extensions
112
+ console.print(" [cyan]Opening Chrome extensions page...[/cyan]")
113
+ webbrowser.open("chrome://extensions/")
114
+
115
+ # Setup instructions
116
+ steps = Table(
117
+ show_header=False,
118
+ box=box.SIMPLE,
119
+ padding=(0, 2),
120
+ show_edge=False,
121
+ )
122
+ steps.add_column("step", style="bold cyan", width=4)
123
+ steps.add_column("instruction")
124
+
125
+ steps.add_row("1.", 'Enable [bold]"Developer mode"[/bold] toggle (top-right corner)')
126
+ steps.add_row("2.", 'Click [bold]"Load unpacked"[/bold]')
127
+ if copied:
128
+ steps.add_row("3.", "Paste the path [green](already copied to your clipboard)[/green]")
129
+ else:
130
+ steps.add_row("3.", f"Select this folder: [bold]{ext_path_str}[/bold]")
131
+
132
+ console.print()
133
+ console.print(
134
+ Panel(
135
+ steps,
136
+ title="[bold]Quick Setup[/bold]",
137
+ title_align="left",
138
+ border_style="cyan",
139
+ box=box.ROUNDED,
140
+ padding=(1, 1),
141
+ )
142
+ )
143
+ console.print()
144
+
145
+ Prompt.ask(" Press [bold]Enter[/bold] after you've loaded the extension")
146
+
147
+ # Mark as installed
148
+ marker = data_dir / ".installed"
149
+ marker.touch()
150
+
151
+ console.print(" [bold green]Extension setup complete![/bold green]")
152
+ return True
153
+
154
+
155
+ def print_server_header():
156
+ """Print the server status panel before starting."""
157
+ info = Table(show_header=False, box=None, padding=(0, 1), show_edge=False)
158
+ info.add_column("key", style="dim", width=12)
159
+ info.add_column("value")
160
+
161
+ info.add_row("Endpoint", f"[bold]http://{HOST}:{PORT}[/bold]")
162
+ info.add_row("Extension", "[yellow]Waiting for connection...[/yellow]")
163
+ info.add_row("Status", "[green]Running[/green]")
164
+
165
+ console.print(
166
+ Panel(
167
+ info,
168
+ title="[bold cyan]{ [/bold cyan][bold white]Browse Code[/bold white][bold cyan] }[/bold cyan]",
169
+ title_align="left",
170
+ subtitle="[dim]Press Ctrl+C to stop[/dim]",
171
+ subtitle_align="right",
172
+ border_style="cyan",
173
+ box=box.ROUNDED,
174
+ padding=(1, 2),
175
+ )
176
+ )
177
+ console.print()
178
+
179
+
180
+ def main():
181
+ data_dir = get_data_dir()
182
+ marker = data_dir / ".installed"
183
+
184
+ if not marker.exists():
185
+ result = setup_extension()
186
+ if not result:
187
+ return
188
+ else:
189
+ print_banner()
190
+
191
+ console.print()
192
+ print_server_header()
193
+
194
+ try:
195
+ from .server import app
196
+ except ImportError:
197
+ from server import app
198
+
199
+ import uvicorn
200
+ uvicorn.run(app, host=HOST, port=PORT, access_log=False)
201
+
202
+
203
+ if __name__ == "__main__":
204
+ main()
@@ -3,6 +3,11 @@
3
3
  "name": "Browse Code Bridge",
4
4
  "version": "2.0",
5
5
  "description": "Autonomous AI Code Execution Bridge",
6
+ "icons": {
7
+ "16": "icon16.png",
8
+ "48": "icon48.png",
9
+ "128": "icon128.png"
10
+ },
6
11
  "permissions": [
7
12
  "activeTab",
8
13
  "storage"
@@ -19,7 +24,12 @@
19
24
  }
20
25
  ],
21
26
  "action": {
22
- "default_popup": "popup.html"
27
+ "default_popup": "popup.html",
28
+ "default_icon": {
29
+ "16": "icon16.png",
30
+ "48": "icon48.png",
31
+ "128": "icon128.png"
32
+ }
23
33
  },
24
34
  "web_accessible_resources": [
25
35
  {
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: browse_code
3
+ Version: 0.2.0
4
+ Summary: Turn any AI chatbot into an autonomous coding agent
5
+ Description-Content-Type: text/markdown
6
+ Requires-Dist: fastapi
7
+ Requires-Dist: uvicorn
8
+ Requires-Dist: pydantic
9
+ Requires-Dist: rich
10
+ Dynamic: description
11
+ Dynamic: description-content-type
12
+ Dynamic: requires-dist
13
+ Dynamic: summary
14
+
15
+ <p align="center">
16
+ <img src="logo.png" alt="Browse Code" width="200">
17
+ </p>
18
+
19
+ # Browse Code
20
+
21
+ ![PyPI version](https://badge.fury.io/py/browse-code.svg)
22
+ ![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)
23
+ ![License](https://img.shields.io/badge/license-MIT-green)
24
+
25
+ **Browse Code** is a CLI tool that turns any AI chatbot (ChatGPT, Gemini, Claude, HuggingFace) into an autonomous coding agent. It bridges your browser and local terminal, letting AI read/write files, run commands, and manage processes on your machine.
26
+
27
+ ## How It Works
28
+
29
+ Browse Code has two parts:
30
+
31
+ 1. **A local server** that exposes your file system and terminal to the AI via a secure API.
32
+ 2. **A Chrome extension** that injects agent capabilities into AI chat interfaces.
33
+
34
+ When connected, you can ask ChatGPT/Gemini/Claude to edit files, run scripts, search code, and more — all executed locally on your machine.
35
+
36
+ ## Setup
37
+
38
+ ### Step 1: Install the package
39
+
40
+ ```bash
41
+ pip install browse-code
42
+ ```
43
+
44
+ ### Step 2: Run the CLI
45
+
46
+ ```bash
47
+ bc
48
+ ```
49
+
50
+ > If `bc` is not found, add your Python Scripts folder to PATH:
51
+ > ```bash
52
+ > # Windows (PowerShell)
53
+ > $env:Path += ";$env:APPDATA\Python\Python312\Scripts"
54
+ >
55
+ > # Or run directly
56
+ > python -m browse_code.cli
57
+ > ```
58
+
59
+ ### Step 3: First-run extension setup
60
+
61
+ On the first run, `bc` will guide you through a one-time Chrome extension setup:
62
+
63
+ 1. It asks for your permission to extract the extension files.
64
+ 2. It copies the extension to `~/.browse_code/extension/` and copies the path to your clipboard.
65
+ 3. It opens `chrome://extensions/` in your browser automatically.
66
+ 4. You enable **Developer mode** (top-right toggle), click **Load unpacked**, and paste the path.
67
+ 5. Press Enter in the terminal and the server starts.
68
+
69
+ **You only do this once.** The extension stays loaded in Chrome across sessions.
70
+
71
+ ### Step 4: Start an AI session
72
+
73
+ 1. Open any supported AI chat (ChatGPT, Gemini, Claude, or HuggingFace Chat).
74
+ 2. Click the Browse Code Bridge extension icon and set your workspace directory.
75
+ 3. Click "Initialize Agent in Chat".
76
+ 4. Start coding with AI — it now has full access to your local environment.
77
+
78
+ ## Subsequent Usage
79
+
80
+ After the first-time setup, just run:
81
+
82
+ ```bash
83
+ bc
84
+ ```
85
+
86
+ The server starts immediately. Open your AI chat tab and you're ready to go. The server terminal will show:
87
+ - A startup banner with your workspace and endpoint
88
+ - `[+] Extension connected` when the browser extension connects
89
+ - Real-time logs of every file read, write, command execution, and diff
90
+
91
+ ## Features
92
+
93
+ - **File Operations:** Read, write, and patch files with inline terminal diffs
94
+ - **Code Search:** Search across your entire codebase by keyword
95
+ - **Terminal Commands:** Run shell commands with full stdout/stderr capture
96
+ - **Background Processes:** Start, monitor, and kill long-running processes
97
+ - **Multi-Platform AI:** Works with ChatGPT, Gemini, Claude, and HuggingFace Chat
98
+ - **Extension Heartbeat:** Server detects when the browser extension connects/disconnects
99
+
100
+ ## For Developers
101
+
102
+ 1. Clone the repository:
103
+ ```bash
104
+ git clone https://github.com/Dedeep007/browse_code.git
105
+ cd browse_code
106
+ ```
107
+ 2. Install in editable mode:
108
+ ```bash
109
+ pip install -e .
110
+ ```
111
+
112
+ ## Contributing
113
+
114
+ Contributions are welcome! Please feel free to submit a Pull Request.
115
+
116
+ 1. Fork the repository.
117
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
118
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
119
+ 4. Push to the branch (`git push origin feature/AmazingFeature`).
120
+ 5. Open a Pull Request.
121
+
122
+ ## License
123
+
124
+ Distributed under the MIT License.
@@ -11,6 +11,9 @@ browse_code.egg-info/entry_points.txt
11
11
  browse_code.egg-info/requires.txt
12
12
  browse_code.egg-info/top_level.txt
13
13
  browse_code/extension/content.js
14
+ browse_code/extension/icon128.png
15
+ browse_code/extension/icon16.png
16
+ browse_code/extension/icon48.png
14
17
  browse_code/extension/manifest.json
15
18
  browse_code/extension/popup.html
16
19
  browse_code/extension/popup.js
@@ -1,3 +1,4 @@
1
1
  fastapi
2
2
  uvicorn
3
3
  pydantic
4
+ rich
@@ -2,8 +2,10 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="browse_code",
5
- version="0.1.3",
6
- description="A local AI bridge package",
5
+ version="0.2.0",
6
+ description="Turn any AI chatbot into an autonomous coding agent",
7
+ long_description=open("README.md").read(),
8
+ long_description_content_type="text/markdown",
7
9
  packages=find_packages(),
8
10
  include_package_data=True,
9
11
  package_data={
@@ -12,7 +14,8 @@ setup(
12
14
  install_requires=[
13
15
  "fastapi",
14
16
  "uvicorn",
15
- "pydantic"
17
+ "pydantic",
18
+ "rich",
16
19
  ],
17
20
  entry_points={
18
21
  "console_scripts": [
@@ -1,9 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: browse_code
3
- Version: 0.1.3
4
- Summary: A local AI bridge package
5
- Requires-Dist: fastapi
6
- Requires-Dist: uvicorn
7
- Requires-Dist: pydantic
8
- Dynamic: requires-dist
9
- Dynamic: summary
@@ -1 +0,0 @@
1
- __version__ = "0.1.3"
@@ -1,133 +0,0 @@
1
- import os
2
- import sys
3
- import shutil
4
- import platform
5
- import subprocess
6
- import webbrowser
7
- from pathlib import Path
8
-
9
-
10
- def get_data_dir():
11
- """Return ~/.browse_code, creating it if needed."""
12
- data_dir = Path.home() / ".browse_code"
13
- data_dir.mkdir(exist_ok=True)
14
- return data_dir
15
-
16
-
17
- def copy_to_clipboard(text):
18
- """Copy text to the system clipboard (cross-platform)."""
19
- try:
20
- system = platform.system()
21
- if system == "Windows":
22
- subprocess.run("clip", input=text.encode("utf-8"), check=True)
23
- elif system == "Darwin":
24
- subprocess.run("pbcopy", input=text.encode("utf-8"), check=True)
25
- else:
26
- # Linux — try xclip, fall back to xsel
27
- try:
28
- subprocess.run(
29
- ["xclip", "-selection", "clipboard"],
30
- input=text.encode("utf-8"),
31
- check=True,
32
- )
33
- except FileNotFoundError:
34
- subprocess.run(
35
- ["xsel", "--clipboard", "--input"],
36
- input=text.encode("utf-8"),
37
- check=True,
38
- )
39
- return True
40
- except Exception:
41
- return False
42
-
43
-
44
- def setup_extension():
45
- """First-time setup: extract extension, open Chrome, guide the user."""
46
- data_dir = get_data_dir()
47
- ext_dest = data_dir / "extension"
48
- pkg_ext_dir = Path(__file__).parent / "extension"
49
-
50
- print()
51
- print("=" * 60)
52
- print(" Browse Code - First Time Setup")
53
- print("=" * 60)
54
- print()
55
- print("Browse Code needs a Chrome extension to connect your")
56
- print("browser to the local server.")
57
- print()
58
-
59
- ans = input("Do you want to set up the extension now? (y/n): ")
60
- if ans.strip().lower() != "y":
61
- print("Skipped. You can re-run 'bc' anytime to set it up.")
62
- return False
63
-
64
- # Extract extension files
65
- print()
66
- print("Extracting extension files...")
67
- if ext_dest.exists():
68
- shutil.rmtree(ext_dest)
69
- shutil.copytree(pkg_ext_dir, ext_dest)
70
-
71
- ext_path_str = str(ext_dest)
72
- print(f" Extension extracted to: {ext_path_str}")
73
- print()
74
-
75
- # Copy path to clipboard
76
- copied = copy_to_clipboard(ext_path_str)
77
-
78
- # Open chrome://extensions
79
- print("Opening Chrome extensions page...")
80
- webbrowser.open("chrome://extensions/")
81
-
82
- print()
83
- print("-" * 60)
84
- print(" QUICK SETUP (one-time, takes 30 seconds):")
85
- print("-" * 60)
86
- print(' 1. Enable "Developer mode" toggle (top-right corner)')
87
- print(' 2. Click "Load unpacked"')
88
- if copied:
89
- print(" 3. Paste the path (already copied to your clipboard)")
90
- else:
91
- print(f" 3. Select this folder: {ext_path_str}")
92
- print("-" * 60)
93
- print()
94
-
95
- input("Press Enter after you've loaded the extension...")
96
-
97
- # Mark as installed
98
- marker = data_dir / ".installed"
99
- marker.touch()
100
-
101
- print()
102
- print("Extension setup complete!")
103
- return True
104
-
105
-
106
- def main():
107
- data_dir = get_data_dir()
108
- marker = data_dir / ".installed"
109
-
110
- if not marker.exists():
111
- result = setup_extension()
112
- if not result:
113
- return
114
-
115
- print()
116
- print("=" * 60)
117
- print(" Browse Code")
118
- print("=" * 60)
119
- print()
120
- print("Starting server...")
121
- print()
122
-
123
- try:
124
- from .server import app
125
- except ImportError:
126
- from server import app
127
-
128
- import uvicorn
129
- uvicorn.run(app, host="127.0.0.1", port=5505, access_log=False)
130
-
131
-
132
- if __name__ == "__main__":
133
- main()
@@ -1,9 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: browse_code
3
- Version: 0.1.3
4
- Summary: A local AI bridge package
5
- Requires-Dist: fastapi
6
- Requires-Dist: uvicorn
7
- Requires-Dist: pydantic
8
- Dynamic: requires-dist
9
- Dynamic: summary
File without changes
File without changes