chrome-tools 1.0.6 → 1.0.8

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
@@ -1,248 +1,3 @@
1
1
  # chrome-tools
2
2
 
3
- A comprehensive, robust command-line interface and Node.js developer library built to extract, decrypt, and inspect saved data from Google Chrome on macOS.
4
-
5
- This tool interfaces with the macOS Keychain to retrieve the browser's safe storage key, decrypting AES-128-CBC credentials, cookie values, and autofill credit cards. It also parses open databases like Bookmarks (JSON), History (SQLite), Extensions (JSON), and more.
6
-
7
- ## Features
8
-
9
- - 🔑 **Secure Decryption**: Automatically interfaces with the macOS Keychain to query the Chrome Safe Storage Password.
10
- - 📦 **Zero Database Locking**: Clones targeted SQLite databases to temporary directories before running queries, ensuring no lockups even while Chrome is active.
11
- - 👥 **Multi-Profile Support**: Scans and parses data across all discovered Chrome profiles (e.g. `Default`, `Profile 1`, `Profile 2`).
12
- - 📊 **Rich Subcommands**: Dedicated commands to extract:
13
- - Saved website credentials (passwords)
14
- - Bookmarks (fully flattened folder structures)
15
- - Browsing history and download history
16
- - Local session cookies
17
- - Autofill entries, saved addresses, and credit cards
18
- - Installed extension metadata
19
- - Configured search engine keywords and top sites
20
- - 📂 **Target Custom Directories**: Easily target backed-up Chrome user data directories or specific profiles.
21
- - 🚀 **Dual Interface**: Fully functional as both a global **npx CLI** and an **importable npm module** for custom scripts.
22
- - 💎 **Developer Friendly**: Structured JSON output options on all commands for custom shell pipeline processing.
23
-
24
- ---
25
-
26
- ## Installation & CLI Setup
27
-
28
- ### Option 1: Run on-the-fly (Recommended)
29
- You can run any command instantly without manual installation using `npx`:
30
- ```bash
31
- npx chrome-tools --profiles
32
- ```
33
-
34
- ### Option 2: Install Globally
35
- Install the package globally on your system:
36
- ```bash
37
- npm install -g chrome-tools
38
- ```
39
- Now, you can execute the command directly:
40
- ```bash
41
- chrome-tools --help
42
- ```
43
-
44
- ---
45
-
46
- ## CLI Usage Guide
47
-
48
- `chrome-tools` provides a Commander.js-powered CLI featuring dedicated subcommands, global option support, and convenient shortcut flags.
49
-
50
- ### Shortcut Flags
51
- For quick auditing, use these top-level shortcut flags:
52
- ```bash
53
- # List all saved website credentials (requires macOS Keychain approval)
54
- npx chrome-tools --passwords
55
-
56
- # Flatten and list all bookmarks
57
- npx chrome-tools --bookmarks
58
-
59
- # List all discovered profiles and locations
60
- npx chrome-tools --profiles
61
- ```
62
-
63
- ### Subcommands
64
-
65
- #### Profiles
66
- Scan and check profile states:
67
- ```bash
68
- # List profiles with directory name, display name, account email, and path
69
- npx chrome-tools profiles
70
-
71
- # Show detailed profile state along with which data stores are available/missing
72
- npx chrome-tools profiles states
73
- ```
74
-
75
- #### Saved Passwords
76
- ```bash
77
- # List all website credentials across all profiles
78
- npx chrome-tools passwords
79
-
80
- # Filter credentials using a search term (matches URL or username)
81
- npx chrome-tools passwords --search "gmail"
82
-
83
- # Target a specific profile directory only (placed before the subcommand)
84
- npx chrome-tools --profile "Profile 1" passwords
85
- ```
86
-
87
- #### Bookmarks
88
- ```bash
89
- # List all bookmarks
90
- npx chrome-tools bookmarks
91
-
92
- # Filter bookmarks inside folders containing "Travel"
93
- npx chrome-tools bookmarks --folder "travel"
94
-
95
- # Filter bookmarks by title or URL search term
96
- npx chrome-tools bookmarks --search "github"
97
- ```
98
-
99
- #### History & Search Terms
100
- ```bash
101
- # List last 100 browsing history entries
102
- npx chrome-tools history
103
-
104
- # Limit browsing history entries and search URL/Title
105
- npx chrome-tools history --limit 50 --search "news"
106
-
107
- # Extract search queries entered in the address bar
108
- npx chrome-tools search-terms --limit 20
109
- ```
110
-
111
- #### Cookies
112
- ```bash
113
- # List all cookies (decrypts secure cookie values via Keychain key)
114
- npx chrome-tools cookies
115
-
116
- # Filter cookies for a specific domain name
117
- npx chrome-tools cookies --domain "google.com" --limit 30
118
-
119
- # Filter cookies for a specific URL (matches domain, path, and secure status)
120
- npx chrome-tools cookies --url "https://github.com/settings/profile"
121
-
122
- # Skip decryption of encrypted values (fast metadata lookup)
123
- npx chrome-tools cookies --no-decrypt
124
- ```
125
-
126
- #### Autofill, Credit Cards & Addresses
127
- ```bash
128
- # List autocomplete text entries (e.g. form fields, text inputs)
129
- npx chrome-tools autofill --limit 50
130
-
131
- # List saved credit cards (decrypts credit card numbers)
132
- npx chrome-tools credit-cards
133
-
134
- # List saved autofill profile addresses (name, email, phone, address, city, zip)
135
- npx chrome-tools addresses
136
- ```
137
-
138
- #### Extensions & Diagnostics
139
- ```bash
140
- # List installed extensions (name, version, ID, enabled state, and webstore source)
141
- npx chrome-tools extensions
142
-
143
- # List configured search engine keywords
144
- npx chrome-tools search-engines
145
-
146
- # List frequently visited top sites ordered by rank
147
- npx chrome-tools top-sites
148
- ```
149
-
150
- ### Global Options
151
-
152
- These options apply globally to all subcommands and should be placed before the command (e.g. `npx chrome-tools --profile-path <path> --profile <name> cookies --url <url>`):
153
-
154
- - `--profile-path <path>`: Specify a custom Chrome User Data/profile folder (e.g., a backed-up profile from another machine). Defaults to the `PROFILE_PATH` env/`.env` variable, or falls back to the standard macOS Chrome User Data location.
155
- - `--profile <name>`: Target a specific profile directory (e.g., `Default`, `Profile 1`). Defaults to the `PROFILE_NAME` env/`.env` variable.
156
- - `--json`: Output strictly in JSON format (ideal for programmatic pipes or exporting to files).
157
- - `--limit <number>`: Restrict the output results count (for history, autofill, cookies, etc.).
158
-
159
- #### Custom Directory & JSON Examples
160
- ```bash
161
- # Export bookmarks from a backed-up Chrome folder directly to a JSON file
162
- npx chrome-tools --profile-path "/path/to/backup/Chrome" bookmarks --json > bookmarks.json
163
-
164
- # Retrieve all history from a specific profile in JSON format
165
- npx chrome-tools --profile-path "/path/to/backup/Chrome" --profile "Profile 2" history --json --limit 10
166
- ```
167
-
168
- ---
169
-
170
- ## Library Import Guide (Programmatic API)
171
-
172
- `chrome-tools` is written as a modern ES module. You can import any extraction or utility function directly into your custom Node.js projects.
173
-
174
- ### Full API Import
175
- ```javascript
176
- import {
177
- discoverProfiles,
178
- getPasswords,
179
- getBookmarks,
180
- getHistory,
181
- getCookies
182
- } from "chrome-tools";
183
-
184
- // 1. Discover active profiles
185
- const profiles = discoverProfiles("/path/to/chrome/User Data");
186
- console.log(profiles);
187
-
188
- // 2. Fetch bookmarks programmatically
189
- const githubBookmarks = getBookmarks({
190
- profilePath: "/path/to/chrome/User Data",
191
- search: "github"
192
- });
193
-
194
- // 3. Extract browsing history
195
- const history = getHistory({ limit: 50 });
196
- ```
197
-
198
- ### Subpath Imports
199
- For smaller footprints or isolated dependencies, you can import individual modules directly:
200
- ```javascript
201
- import { getPasswords } from "chrome-tools/passwords";
202
- import { getBookmarks } from "chrome-tools/bookmarks";
203
- import { getHistory } from "chrome-tools/history";
204
-
205
- // Example: Retrieve username and password for "chatgpt.com"
206
- const credentials = getPasswords({ search: "chatgpt.com" });
207
- for (const cred of credentials) {
208
- console.log(`Profile: ${cred.profile}`);
209
- console.log(`Username: ${cred.username}`);
210
- console.log(`Password: ${cred.password}`);
211
- }
212
- ```
213
-
214
- ### Available API Modules & Signatures
215
-
216
- All core functions accept an options object with the following fields:
217
- - `profilePath` *(string)*: Custom Chrome User Data/profile directory (alias: `chromeDir`).
218
- - `chromeDir` *(string)*: Alias for `profilePath`.
219
- - `profile` *(string)*: Specific profile subdirectory name (e.g., `"Default"`).
220
- - `search` *(string)*: Case-insensitive filter term.
221
- - `limit` *(number)*: Maximum returned rows count.
222
-
223
- | Function | Module Path | Returns |
224
- | --- | --- | --- |
225
- | `discoverProfiles(profilePath)` | `chrome-tools` | `Array<{name, path}>` |
226
- | `getProfileStates(profilePath)` | `chrome-tools` | `Array<ProfileState>` |
227
- | `getPasswords({profilePath, chromeDir, profile, search})` | `chrome-tools/passwords` | `Array<Credentials>` |
228
- | `getBookmarks({profilePath, chromeDir, profile, folder, search})` | `chrome-tools/bookmarks` | `Array<Bookmark>` |
229
- | `getHistory({profilePath, chromeDir, profile, search, limit})` | `chrome-tools/history` | `Array<HistoryEntry>` |
230
- | `getSearchTerms({profilePath, chromeDir, profile, limit})` | `chrome-tools/history` | `Array<SearchTerm>` |
231
- | `getCookies({profilePath, chromeDir, profile, domain, url, decrypt, limit})` | `chrome-tools/cookies` | `Array<Cookie>` |
232
- | `getAutofillEntries({profilePath, chromeDir, profile, search, limit})` | `chrome-tools/autofill` | `Array<AutofillEntry>` |
233
- | `getCreditCards({profilePath, chromeDir, profile})` | `chrome-tools/autofill` | `Array<CreditCard>` |
234
- | `getAddresses({profilePath, chromeDir, profile})` | `chrome-tools/autofill` | `Array<Address>` |
235
- | `getDownloads({profilePath, chromeDir, profile, search, limit})` | `chrome-tools/downloads` | `Array<Download>` |
236
- | `getExtensions({profilePath, chromeDir, profile, search})` | `chrome-tools/extensions` | `Array<Extension>` |
237
- | `getSearchEngines({profilePath, chromeDir, profile})` | `chrome-tools/search-engines` | `Array<SearchEngine>` |
238
- | `getTopSites({profilePath, chromeDir, profile})` | `chrome-tools/top-sites` | `Array<TopSite>` |
239
-
240
- ---
241
-
242
- ## Security Warning
243
-
244
- This utility is designed strictly for authorized administrative audits, security diagnostics, and local credential migration. macOS will request explicit Keychain authorization before releasing the Chrome Safe Storage Password. Keep your local credentials safe, and only run this code in trusted development environments.
245
-
246
- ## License
247
-
248
- This project is licensed under the [MIT License](LICENSE).
3
+ CLI & Node.js library for chrome