nstbrowser-ai-agent 0.0.1

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 (119) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1321 -0
  3. package/bin/nstbrowser-ai-agent-darwin-arm64 +0 -0
  4. package/bin/nstbrowser-ai-agent-darwin-x64 +0 -0
  5. package/bin/nstbrowser-ai-agent-linux-arm64 +0 -0
  6. package/bin/nstbrowser-ai-agent-linux-x64 +0 -0
  7. package/bin/nstbrowser-ai-agent-win32-x64.exe +0 -0
  8. package/bin/nstbrowser-ai-agent.js +109 -0
  9. package/dist/action-policy.d.ts +14 -0
  10. package/dist/action-policy.d.ts.map +1 -0
  11. package/dist/action-policy.js +253 -0
  12. package/dist/action-policy.js.map +1 -0
  13. package/dist/actions.d.ts +18 -0
  14. package/dist/actions.d.ts.map +1 -0
  15. package/dist/actions.js +2037 -0
  16. package/dist/actions.js.map +1 -0
  17. package/dist/auth-cli.d.ts +2 -0
  18. package/dist/auth-cli.d.ts.map +1 -0
  19. package/dist/auth-cli.js +97 -0
  20. package/dist/auth-cli.js.map +1 -0
  21. package/dist/auth-vault.d.ts +36 -0
  22. package/dist/auth-vault.d.ts.map +1 -0
  23. package/dist/auth-vault.js +125 -0
  24. package/dist/auth-vault.js.map +1 -0
  25. package/dist/browser.d.ts +573 -0
  26. package/dist/browser.d.ts.map +1 -0
  27. package/dist/browser.js +2036 -0
  28. package/dist/browser.js.map +1 -0
  29. package/dist/confirmation.d.ts +8 -0
  30. package/dist/confirmation.d.ts.map +1 -0
  31. package/dist/confirmation.js +30 -0
  32. package/dist/confirmation.js.map +1 -0
  33. package/dist/daemon.d.ts +65 -0
  34. package/dist/daemon.d.ts.map +1 -0
  35. package/dist/daemon.js +589 -0
  36. package/dist/daemon.js.map +1 -0
  37. package/dist/diff.d.ts +18 -0
  38. package/dist/diff.d.ts.map +1 -0
  39. package/dist/diff.js +271 -0
  40. package/dist/diff.js.map +1 -0
  41. package/dist/domain-filter.d.ts +28 -0
  42. package/dist/domain-filter.d.ts.map +1 -0
  43. package/dist/domain-filter.js +149 -0
  44. package/dist/domain-filter.js.map +1 -0
  45. package/dist/encryption.d.ts +73 -0
  46. package/dist/encryption.d.ts.map +1 -0
  47. package/dist/encryption.js +171 -0
  48. package/dist/encryption.js.map +1 -0
  49. package/dist/ios-actions.d.ts +11 -0
  50. package/dist/ios-actions.d.ts.map +1 -0
  51. package/dist/ios-actions.js +228 -0
  52. package/dist/ios-actions.js.map +1 -0
  53. package/dist/ios-manager.d.ts +266 -0
  54. package/dist/ios-manager.d.ts.map +1 -0
  55. package/dist/ios-manager.js +1073 -0
  56. package/dist/ios-manager.js.map +1 -0
  57. package/dist/nstbrowser-actions.d.ts +10 -0
  58. package/dist/nstbrowser-actions.d.ts.map +1 -0
  59. package/dist/nstbrowser-actions.js +277 -0
  60. package/dist/nstbrowser-actions.js.map +1 -0
  61. package/dist/nstbrowser-client.d.ts +197 -0
  62. package/dist/nstbrowser-client.d.ts.map +1 -0
  63. package/dist/nstbrowser-client.js +454 -0
  64. package/dist/nstbrowser-client.js.map +1 -0
  65. package/dist/nstbrowser-errors.d.ts +28 -0
  66. package/dist/nstbrowser-errors.d.ts.map +1 -0
  67. package/dist/nstbrowser-errors.js +59 -0
  68. package/dist/nstbrowser-errors.js.map +1 -0
  69. package/dist/nstbrowser-profile-resolver.d.ts +89 -0
  70. package/dist/nstbrowser-profile-resolver.d.ts.map +1 -0
  71. package/dist/nstbrowser-profile-resolver.js +227 -0
  72. package/dist/nstbrowser-profile-resolver.js.map +1 -0
  73. package/dist/nstbrowser-types.d.ts +151 -0
  74. package/dist/nstbrowser-types.d.ts.map +1 -0
  75. package/dist/nstbrowser-types.js +5 -0
  76. package/dist/nstbrowser-types.js.map +1 -0
  77. package/dist/nstbrowser-utils.d.ts +71 -0
  78. package/dist/nstbrowser-utils.d.ts.map +1 -0
  79. package/dist/nstbrowser-utils.js +174 -0
  80. package/dist/nstbrowser-utils.js.map +1 -0
  81. package/dist/protocol.d.ts +26 -0
  82. package/dist/protocol.d.ts.map +1 -0
  83. package/dist/protocol.js +1245 -0
  84. package/dist/protocol.js.map +1 -0
  85. package/dist/snapshot.d.ts +67 -0
  86. package/dist/snapshot.d.ts.map +1 -0
  87. package/dist/snapshot.js +514 -0
  88. package/dist/snapshot.js.map +1 -0
  89. package/dist/state-utils.d.ts +77 -0
  90. package/dist/state-utils.d.ts.map +1 -0
  91. package/dist/state-utils.js +178 -0
  92. package/dist/state-utils.js.map +1 -0
  93. package/dist/stream-server.d.ts +117 -0
  94. package/dist/stream-server.d.ts.map +1 -0
  95. package/dist/stream-server.js +309 -0
  96. package/dist/stream-server.js.map +1 -0
  97. package/dist/types.d.ts +1121 -0
  98. package/dist/types.d.ts.map +1 -0
  99. package/dist/types.js +2 -0
  100. package/dist/types.js.map +1 -0
  101. package/package.json +83 -0
  102. package/scripts/analyze-api-coverage.js +205 -0
  103. package/scripts/analyze-cli-coverage.js +239 -0
  104. package/scripts/build-all-platforms.sh +68 -0
  105. package/scripts/check-version-sync.js +39 -0
  106. package/scripts/copy-native.js +36 -0
  107. package/scripts/download-nstbrowser-docs.js +152 -0
  108. package/scripts/generate-skills.sh +218 -0
  109. package/scripts/postinstall.js +231 -0
  110. package/scripts/sync-version.js +69 -0
  111. package/skills/nstbrowser-ai-agent/SKILL.md +759 -0
  112. package/skills/nstbrowser-ai-agent/references/batch-operations.md +414 -0
  113. package/skills/nstbrowser-ai-agent/references/nst-api-reference.md +960 -0
  114. package/skills/nstbrowser-ai-agent/references/profile-management.md +672 -0
  115. package/skills/nstbrowser-ai-agent/references/proxy-configuration.md +460 -0
  116. package/skills/nstbrowser-ai-agent/references/troubleshooting.md +773 -0
  117. package/skills/nstbrowser-ai-agent/templates/automated-workflow.sh +248 -0
  118. package/skills/nstbrowser-ai-agent/templates/batch-proxy-update.sh +257 -0
  119. package/skills/nstbrowser-ai-agent/templates/profile-setup.sh +248 -0
@@ -0,0 +1,672 @@
1
+ # Profile Management Guide
2
+
3
+ Comprehensive guide for managing Nstbrowser profiles with nstbrowser-ai-agent.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Profile Concepts](#profile-concepts)
8
+ - [Profile Creation](#profile-creation)
9
+ - [Profile Name vs ID](#profile-name-vs-id)
10
+ - [Profile Organization](#profile-organization)
11
+ - [Profile Operations](#profile-operations)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ## Profile Concepts
15
+
16
+ ### What is a Profile?
17
+
18
+ A Nstbrowser profile is a complete browser environment that includes:
19
+
20
+ - **Browser Fingerprint**: Unique characteristics that identify the browser
21
+ - Canvas fingerprint
22
+ - WebGL fingerprint
23
+ - Audio context fingerprint
24
+ - Font list
25
+ - Screen resolution
26
+ - Timezone
27
+ - Language settings
28
+ - Hardware concurrency
29
+
30
+ - **Session Data**: Persistent browser state
31
+ - Cookies
32
+ - localStorage
33
+ - sessionStorage
34
+ - IndexedDB
35
+ - Service workers
36
+
37
+ - **Configuration**: Browser settings
38
+ - User agent
39
+ - Platform (Windows, macOS, Linux)
40
+ - Kernel version (Chrome version)
41
+ - Proxy settings
42
+ - Geolocation
43
+
44
+ - **Metadata**: Organization and tracking
45
+ - Profile name
46
+ - Profile ID (UUID)
47
+ - Group membership
48
+ - Tags
49
+ - Creation date
50
+ - Last launch record
51
+
52
+ ### Profile Components
53
+
54
+ #### Fingerprint
55
+
56
+ The fingerprint makes each profile unique and helps avoid detection. Nstbrowser automatically generates realistic fingerprints that match the selected platform and kernel version.
57
+
58
+ **Key fingerprint components:**
59
+ - Canvas: Unique rendering characteristics
60
+ - WebGL: Graphics card identification
61
+ - Fonts: Installed font list
62
+ - Audio: Audio context fingerprint
63
+ - Screen: Resolution and color depth
64
+ - Navigator: Browser properties
65
+
66
+ #### Cookies and Storage
67
+
68
+ Profiles persist all browser storage:
69
+ - HTTP cookies (session and persistent)
70
+ - localStorage (key-value pairs)
71
+ - sessionStorage (temporary storage)
72
+ - IndexedDB (structured data)
73
+ - Service workers (background scripts)
74
+
75
+ This allows you to:
76
+ - Stay logged in across sessions
77
+ - Maintain shopping carts
78
+ - Preserve user preferences
79
+ - Keep application state
80
+
81
+ #### Proxy Settings
82
+
83
+ Each profile can have its own proxy configuration:
84
+ - Proxy type (HTTP, HTTPS, SOCKS5)
85
+ - Proxy host and port
86
+ - Authentication credentials
87
+ - Enable/disable toggle
88
+
89
+ This enables:
90
+ - Geo-targeting (appear from different locations)
91
+ - IP rotation (use different IPs per profile)
92
+ - Privacy (hide your real IP)
93
+ - Access control (bypass restrictions)
94
+
95
+ ### Profile Lifecycle
96
+
97
+ 1. **Creation**: Profile is created with initial configuration
98
+ 2. **Configuration**: Proxy, tags, and group are set
99
+ 3. **Usage**: Browser is launched and used for automation
100
+ 4. **Persistence**: Session data is saved automatically
101
+ 5. **Reuse**: Profile is reused in future sessions
102
+ 6. **Maintenance**: Cache and cookies are cleared as needed
103
+ 7. **Deletion**: Profile is removed when no longer needed
104
+
105
+ ## Profile Creation
106
+
107
+ ### Basic Creation
108
+
109
+ Create a profile with default settings:
110
+
111
+ ```bash
112
+ nstbrowser-ai-agent profile create my-profile
113
+ ```
114
+
115
+ This creates a profile with:
116
+ - Random fingerprint
117
+ - No proxy
118
+ - Default platform (Windows)
119
+ - Latest kernel version
120
+ - No group or tags
121
+
122
+ ### Creation with Platform
123
+
124
+ Specify the operating system:
125
+
126
+ ```bash
127
+ nstbrowser-ai-agent profile create my-profile --platform macOS
128
+ ```
129
+
130
+ **Available platforms:**
131
+ - `Windows`: Windows 10/11
132
+ - `macOS`: macOS 10.15+
133
+ - `Linux`: Ubuntu/Debian
134
+
135
+ ### Creation with Kernel Version
136
+
137
+ Specify the Chrome version:
138
+
139
+ ```bash
140
+ nstbrowser-ai-agent profile create my-profile --kernel 124
141
+ ```
142
+
143
+ **Kernel versions:**
144
+ - Use recent versions (120+) for best compatibility
145
+ - Match the version to your target website's requirements
146
+ - Check Nstbrowser dashboard for available versions
147
+
148
+ ### Creation with Proxy
149
+
150
+ Create a profile with proxy configuration:
151
+
152
+ ```bash
153
+ nstbrowser-ai-agent profile create my-profile \
154
+ --proxy-host proxy.example.com \
155
+ --proxy-port 8080 \
156
+ --proxy-type http \
157
+ --proxy-username user \
158
+ --proxy-password pass
159
+ ```
160
+
161
+ **Proxy types:**
162
+ - `http`: HTTP proxy (most common)
163
+ - `https`: HTTPS proxy (encrypted)
164
+ - `socks5`: SOCKS5 proxy (supports UDP)
165
+
166
+ ### Creation with Group
167
+
168
+ Create a profile in a specific group:
169
+
170
+ ```bash
171
+ # First, get the group ID
172
+ nstbrowser-ai-agent profile groups list
173
+
174
+ # Then create profile with group
175
+ nstbrowser-ai-agent profile create my-profile --group-id group-123
176
+ ```
177
+
178
+ ### Complete Example
179
+
180
+ Create a fully configured profile:
181
+
182
+ ```bash
183
+ nstbrowser-ai-agent profile create production-profile \
184
+ --platform Windows \
185
+ --kernel 124 \
186
+ --proxy-host proxy.example.com \
187
+ --proxy-port 8080 \
188
+ --proxy-type http \
189
+ --proxy-username user \
190
+ --proxy-password pass \
191
+ --group-id group-123
192
+ ```
193
+
194
+ ## Profile Name vs ID
195
+
196
+ ### Understanding the Difference
197
+
198
+ **Profile Name:**
199
+ - Human-readable identifier (e.g., "my-profile")
200
+ - Set by you during creation
201
+ - Can be duplicated (multiple profiles with same name)
202
+ - Easier to remember and use
203
+
204
+ **Profile ID:**
205
+ - UUID generated by Nstbrowser (e.g., "86581051-fb0d-4c4a-b1e3-ebc1abd17174")
206
+ - Guaranteed unique
207
+ - Never changes
208
+ - Better for scripts and automation
209
+
210
+ ### Resolution Priority
211
+
212
+ When you specify a profile, nstbrowser-ai-agent resolves it in this order:
213
+
214
+ 1. **Explicit `--profile-id` flag** (highest priority)
215
+ ```bash
216
+ nstbrowser-ai-agent --profile-id 86581051-fb0d-4c4a-b1e3-ebc1abd17174 open example.com
217
+ ```
218
+
219
+ 2. **Explicit `--profile` flag** (profile name)
220
+ ```bash
221
+ nstbrowser-ai-agent --profile my-profile open example.com
222
+ ```
223
+
224
+ 3. **`NST_PROFILE_ID` environment variable**
225
+ ```bash
226
+ export NST_PROFILE_ID="86581051-fb0d-4c4a-b1e3-ebc1abd17174"
227
+ nstbrowser-ai-agent open example.com
228
+ ```
229
+
230
+ 4. **`NST_PROFILE` environment variable**
231
+ ```bash
232
+ export NST_PROFILE="my-profile"
233
+ nstbrowser-ai-agent open example.com
234
+ ```
235
+
236
+ 5. **Temporary browser** (if no profile specified)
237
+ ```bash
238
+ nstbrowser-ai-agent open example.com # Uses temporary profile
239
+ ```
240
+
241
+ ### Name Resolution Logic
242
+
243
+ When using a profile name, nstbrowser-ai-agent:
244
+
245
+ 1. **Checks running browsers** for matching name
246
+ - If found, uses that browser instance
247
+ - If multiple matches, uses the earliest one
248
+
249
+ 2. **Queries profile API** for matching name
250
+ - If found, uses that profile
251
+ - If multiple matches, uses the first one
252
+
253
+ 3. **Throws error** if not found
254
+ - Lists available profiles
255
+ - Suggests using profile ID for uniqueness
256
+
257
+ ### When to Use Name vs ID
258
+
259
+ **Use Profile Name when:**
260
+ - Working interactively
261
+ - Profile names are unique
262
+ - Readability is important
263
+ - Sharing commands with others
264
+
265
+ **Use Profile ID when:**
266
+ - Writing scripts or automation
267
+ - Multiple profiles have the same name
268
+ - Guaranteed uniqueness is required
269
+ - Working with API responses
270
+
271
+ ### Examples
272
+
273
+ **By Name (Recommended for Interactive Use):**
274
+ ```bash
275
+ # Set default profile by name
276
+ export NST_PROFILE="my-profile"
277
+
278
+ # All commands use this profile
279
+ nstbrowser-ai-agent open https://example.com
280
+ nstbrowser-ai-agent snapshot -i
281
+ nstbrowser-ai-agent close
282
+ ```
283
+
284
+ **By ID (Recommended for Scripts):**
285
+ ```bash
286
+ # Get profile ID from API
287
+ PROFILE_ID=$(nstbrowser-ai-agent profile list --json | jq -r '.data.profiles[0].profileId')
288
+
289
+ # Set default profile by ID
290
+ export NST_PROFILE_ID="$PROFILE_ID"
291
+
292
+ # All commands use this profile
293
+ nstbrowser-ai-agent open https://example.com
294
+ nstbrowser-ai-agent snapshot -i
295
+ nstbrowser-ai-agent close
296
+ ```
297
+
298
+ **Mixed Approach:**
299
+ ```bash
300
+ # Use name for main profile
301
+ export NST_PROFILE="main-profile"
302
+
303
+ # Override with ID for specific command
304
+ nstbrowser-ai-agent --profile-id 86581051-fb0d-4c4a-b1e3-ebc1abd17174 open example.com
305
+ ```
306
+
307
+ ## Profile Organization
308
+
309
+ ### Groups
310
+
311
+ Groups help organize profiles by purpose, project, or team.
312
+
313
+ #### List Groups
314
+
315
+ ```bash
316
+ nstbrowser-ai-agent profile groups list
317
+ ```
318
+
319
+ Output:
320
+ ```
321
+ Available groups:
322
+ - Production (group-123)
323
+ - Testing (group-456)
324
+ - Staging (group-789)
325
+ ```
326
+
327
+ #### Create Group
328
+
329
+ Groups are created in the Nstbrowser dashboard, not via CLI.
330
+
331
+ #### Move Profiles to Group
332
+
333
+ ```bash
334
+ # Move single profile
335
+ nstbrowser-ai-agent profile groups change group-123 profile-id-1
336
+
337
+ # Move multiple profiles
338
+ nstbrowser-ai-agent profile groups change group-123 id-1 id-2 id-3
339
+
340
+ # Batch move (alias)
341
+ nstbrowser-ai-agent profile groups batch-change group-123 id-1 id-2 id-3
342
+ ```
343
+
344
+ #### Find Profiles in Group
345
+
346
+ ```bash
347
+ # List all profiles and filter by group
348
+ nstbrowser-ai-agent profile list --json | jq '.data.profiles[] | select(.group.name == "Production")'
349
+ ```
350
+
351
+ #### Group Use Cases
352
+
353
+ - **By Environment**: Production, Staging, Testing, Development
354
+ - **By Project**: Project A, Project B, Client X, Client Y
355
+ - **By Team**: Marketing, Sales, Support, Engineering
356
+ - **By Purpose**: Scraping, Testing, Monitoring, Research
357
+
358
+ ### Tags
359
+
360
+ Tags provide flexible labeling for profiles.
361
+
362
+ #### List Tags
363
+
364
+ ```bash
365
+ nstbrowser-ai-agent profile tags list
366
+ ```
367
+
368
+ Output:
369
+ ```
370
+ Available tags:
371
+ - production (blue)
372
+ - testing (green)
373
+ - staging (yellow)
374
+ - automated (purple)
375
+ ```
376
+
377
+ #### Add Tags
378
+
379
+ ```bash
380
+ # Add single tag
381
+ nstbrowser-ai-agent profile tags create profile-id production
382
+
383
+ # Add multiple tags (batch)
384
+ nstbrowser-ai-agent profile tags batch-create id-1 id-2 id-3 \
385
+ production:blue automated:green
386
+ ```
387
+
388
+ #### Update Tags
389
+
390
+ ```bash
391
+ # Replace all tags for a profile
392
+ nstbrowser-ai-agent profile tags update profile-id \
393
+ production:blue verified:green active:yellow
394
+
395
+ # Batch update
396
+ nstbrowser-ai-agent profile tags batch-update id-1 id-2 id-3 \
397
+ updated:red verified:green
398
+ ```
399
+
400
+ #### Clear Tags
401
+
402
+ ```bash
403
+ # Clear single profile
404
+ nstbrowser-ai-agent profile tags clear profile-id
405
+
406
+ # Clear multiple profiles (batch)
407
+ nstbrowser-ai-agent profile tags batch-clear id-1 id-2 id-3
408
+ ```
409
+
410
+ #### Tag Use Cases
411
+
412
+ - **Status**: active, inactive, archived, deprecated
413
+ - **Environment**: production, staging, testing, development
414
+ - **Purpose**: scraping, testing, monitoring, research
415
+ - **Quality**: verified, unverified, working, broken
416
+ - **Automation**: automated, manual, scheduled, on-demand
417
+ - **Priority**: high, medium, low, critical
418
+
419
+ ### Naming Strategies
420
+
421
+ #### Descriptive Names
422
+
423
+ Use clear, descriptive names:
424
+ ```
425
+ production-main
426
+ testing-api-v2
427
+ staging-frontend
428
+ development-local
429
+ ```
430
+
431
+ #### Hierarchical Names
432
+
433
+ Use prefixes for organization:
434
+ ```
435
+ prod-web-01
436
+ prod-web-02
437
+ test-api-01
438
+ test-api-02
439
+ ```
440
+
441
+ #### Purpose-Based Names
442
+
443
+ Name by function:
444
+ ```
445
+ scraper-amazon
446
+ scraper-ebay
447
+ monitor-uptime
448
+ monitor-performance
449
+ ```
450
+
451
+ #### Project-Based Names
452
+
453
+ Name by project:
454
+ ```
455
+ projecta-prod
456
+ projecta-test
457
+ projectb-prod
458
+ projectb-test
459
+ ```
460
+
461
+ ## Profile Operations
462
+
463
+ ### Viewing Profile Details
464
+
465
+ ```bash
466
+ # Show complete profile information
467
+ nstbrowser-ai-agent profile show my-profile --json
468
+ ```
469
+
470
+ Returns:
471
+ - Profile ID and name
472
+ - Platform and kernel version
473
+ - Group membership
474
+ - Proxy configuration
475
+ - Tags
476
+ - Fingerprint details
477
+ - Last launch record
478
+
479
+ ### Updating Profile Settings
480
+
481
+ Profile settings are updated through specific commands:
482
+
483
+ **Update Proxy:**
484
+ ```bash
485
+ nstbrowser-ai-agent profile proxy update my-profile \
486
+ --host new-proxy.com \
487
+ --port 8080
488
+ ```
489
+
490
+ **Update Tags:**
491
+ ```bash
492
+ nstbrowser-ai-agent profile tags update profile-id \
493
+ new-tag-1:blue new-tag-2:green
494
+ ```
495
+
496
+ **Update Group:**
497
+ ```bash
498
+ nstbrowser-ai-agent profile groups change new-group-id profile-id
499
+ ```
500
+
501
+ ### Deleting Profiles
502
+
503
+ ```bash
504
+ # Delete single profile
505
+ nstbrowser-ai-agent profile delete profile-id
506
+
507
+ # Delete multiple profiles
508
+ nstbrowser-ai-agent profile delete id-1 id-2 id-3
509
+ ```
510
+
511
+ **Warning:** Deletion is permanent and cannot be undone. All profile data (fingerprint, cookies, sessions) will be lost.
512
+
513
+ ### Clearing Profile Data
514
+
515
+ Clear cached data without deleting the profile:
516
+
517
+ **Clear Cache:**
518
+ ```bash
519
+ # Clear single profile
520
+ nstbrowser-ai-agent profile cache clear profile-id
521
+
522
+ # Clear multiple profiles
523
+ nstbrowser-ai-agent profile cache clear id-1 id-2 id-3
524
+ ```
525
+
526
+ **Clear Cookies:**
527
+ ```bash
528
+ # Clear single profile
529
+ nstbrowser-ai-agent profile cookies clear profile-id
530
+
531
+ # Clear multiple profiles
532
+ nstbrowser-ai-agent profile cookies clear id-1 id-2 id-3
533
+ ```
534
+
535
+ **When to clear data:**
536
+ - After testing (remove test data)
537
+ - Before sharing profile (remove personal data)
538
+ - When troubleshooting (start fresh)
539
+ - Periodically (prevent bloat)
540
+
541
+ ## Best Practices
542
+
543
+ ### Profile Naming Conventions
544
+
545
+ 1. **Use lowercase with hyphens**: `my-profile` not `My_Profile`
546
+ 2. **Be descriptive**: `production-web-scraper` not `profile1`
547
+ 3. **Include environment**: `prod-`, `test-`, `dev-` prefixes
548
+ 4. **Include purpose**: `-scraper`, `-monitor`, `-test` suffixes
549
+ 5. **Keep it short**: Aim for 20-30 characters max
550
+
551
+ ### Organization Strategies
552
+
553
+ 1. **Use Groups for Major Categories**
554
+ - Environment (Production, Testing, Staging)
555
+ - Project (Project A, Project B)
556
+ - Team (Marketing, Engineering)
557
+
558
+ 2. **Use Tags for Flexible Labeling**
559
+ - Status (active, inactive)
560
+ - Quality (verified, working)
561
+ - Automation (automated, manual)
562
+
563
+ 3. **Combine Groups and Tags**
564
+ - Group: Production
565
+ - Tags: automated, verified, high-priority
566
+
567
+ ### Lifecycle Management
568
+
569
+ 1. **Creation**
570
+ - Create profiles with descriptive names
571
+ - Set proxy if needed
572
+ - Add to appropriate group
573
+ - Tag with initial status
574
+
575
+ 2. **Configuration**
576
+ - Test proxy connection
577
+ - Verify fingerprint
578
+ - Set up initial sessions
579
+
580
+ 3. **Usage**
581
+ - Use sticky sessions for efficiency
582
+ - Monitor for issues
583
+ - Update tags as needed
584
+
585
+ 4. **Maintenance**
586
+ - Clear cache periodically
587
+ - Update proxies when needed
588
+ - Review and update tags
589
+ - Archive unused profiles
590
+
591
+ 5. **Deletion**
592
+ - Tag as deprecated first
593
+ - Verify no active usage
594
+ - Export important data
595
+ - Delete permanently
596
+
597
+ ### Security Considerations
598
+
599
+ 1. **Proxy Credentials**
600
+ - Store in environment variables
601
+ - Never commit to version control
602
+ - Rotate regularly
603
+ - Use different credentials per profile
604
+
605
+ 2. **Profile Isolation**
606
+ - Use separate profiles for different accounts
607
+ - Don't share profiles between users
608
+ - Clear data when switching purposes
609
+
610
+ 3. **API Key Protection**
611
+ - Store `NST_API_KEY` securely
612
+ - Never expose in logs or screenshots
613
+ - Rotate if compromised
614
+ - Use different keys for different environments
615
+
616
+ 4. **Data Privacy**
617
+ - Clear cookies before sharing profiles
618
+ - Don't store sensitive data in profiles
619
+ - Use temporary profiles for testing
620
+ - Delete profiles when no longer needed
621
+
622
+ ### Performance Optimization
623
+
624
+ 1. **Profile Reuse**
625
+ - Reuse profiles instead of creating new ones
626
+ - Use sticky sessions to avoid restarts
627
+ - Keep frequently used profiles active
628
+
629
+ 2. **Batch Operations**
630
+ - Use batch commands for multiple profiles
631
+ - Group related operations together
632
+ - Schedule batch operations during off-peak
633
+
634
+ 3. **Cache Management**
635
+ - Clear cache periodically to prevent bloat
636
+ - Balance between performance and freshness
637
+ - Monitor profile size
638
+
639
+ 4. **Proxy Selection**
640
+ - Use fast, reliable proxies
641
+ - Test proxy speed before assigning
642
+ - Rotate proxies for load balancing
643
+
644
+ ### Troubleshooting
645
+
646
+ 1. **Profile Not Found**
647
+ - List all profiles: `nstbrowser-ai-agent profile list`
648
+ - Check spelling of profile name
649
+ - Use profile ID for guaranteed match
650
+
651
+ 2. **Multiple Profiles with Same Name**
652
+ - Use profile ID instead of name
653
+ - Rename profiles to be unique
654
+ - Use groups and tags for organization
655
+
656
+ 3. **Profile Won't Start**
657
+ - Check proxy configuration
658
+ - Verify Nstbrowser client is running
659
+ - Check profile details for errors
660
+ - Try clearing cache and cookies
661
+
662
+ 4. **Session Not Persisting**
663
+ - Verify profile is being used (not temporary)
664
+ - Check that browser is closed properly
665
+ - Verify cookies are not being cleared
666
+
667
+ ## See Also
668
+
669
+ - [NST API Reference](nst-api-reference.md)
670
+ - [Proxy Configuration Guide](proxy-configuration.md)
671
+ - [Batch Operations Guide](batch-operations.md)
672
+ - [Troubleshooting Guide](troubleshooting.md)