Skip to content

Commit 1c0df0b

Browse files
author
Dave Moudy
committed
Initial commit: SF Org Open Interface
0 parents  commit 1c0df0b

10 files changed

Lines changed: 1406 additions & 0 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
dist/
3+
build/
4+
.DS_Store
5+
*.log
6+
.env
7+
.npm
8+
package-lock.json

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Salesforce Org Opener
2+
3+
A simple Electron app to view and manage your authorized Salesforce organizations.
4+
5+
## Installation
6+
7+
### Globally (Recommended)
8+
9+
You can install this package globally to access the `sf-org-open` command from anywhere:
10+
11+
```bash
12+
# From the project directory
13+
npm install -g .
14+
```
15+
16+
### Installation from NPM (Future)
17+
18+
If published to NPM:
19+
20+
```bash
21+
npm install -g sf-org-open-interface
22+
```
23+
24+
## Usage
25+
26+
Run the following command in your terminal:
27+
28+
```bash
29+
sf-org-open
30+
```
31+
32+
The application will launch in the background.
33+
34+
## Development
35+
36+
```bash
37+
# Install dependencies
38+
npm install
39+
40+
# Start in development mode
41+
npm start
42+
```
43+
44+
## Features
45+
46+
- List all authenticated Salesforce orgs
47+
- Search/Filter orgs
48+
- Open orgs directly in default browser
49+
- Open orgs in Incognito/Private mode
50+
- Set aliases for orgs
51+
- Drag and drop interface

bin/cli.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env node
2+
3+
const { spawn } = require('child_process');
4+
const electron = require('electron');
5+
const path = require('path');
6+
7+
// Path to the project root (where package.json and main.js are)
8+
const appPath = path.join(__dirname, '..');
9+
10+
// Spawn Electron with the app path
11+
const child = spawn(electron, [appPath], {
12+
detached: true,
13+
stdio: 'ignore',
14+
env: process.env
15+
});
16+
17+
// Unreference the child process so the parent (CLI) can exit
18+
// while the app keeps running in the background
19+
child.unref();
20+
21+
console.log('Launching Salesforce Org Opener...');
22+
// Exit immediately
23+
process.exit(0);

index.html

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Salesforce Launcher</title>
6+
<link rel="stylesheet" href="styles.css" />
7+
</head>
8+
<body>
9+
<div class="draggable-header"></div>
10+
<div class="container">
11+
<div class="header-controls">
12+
<div class="title-row">
13+
<h1>My Orgs</h1>
14+
<button id="add-org-btn" class="icon-btn" title="Add New Org (Login)">+</button>
15+
</div>
16+
<div class="controls-row">
17+
<input type="text" id="search-input" placeholder="Search orgs..." />
18+
<button id="refresh-btn" class="icon-btn" title="Refresh Orgs"></button>
19+
</div>
20+
<div class="controls-row secondary">
21+
<select id="sort-select">
22+
<option value="name">Sort: Name</option>
23+
<option value="lastUsed">Sort: Last Used</option>
24+
<option value="type">Sort: Type</option>
25+
</select>
26+
<select id="group-select">
27+
<option value="none">Group: None</option>
28+
<option value="folder">Group: Folder</option>
29+
<option value="tag">Group: Tag</option>
30+
</select>
31+
</div>
32+
</div>
33+
<div id="org-list" class="org-list">
34+
<div class="loading">Loading orgs...</div>
35+
</div>
36+
</div>
37+
38+
<!-- Edit Modal -->
39+
<div id="edit-modal" class="modal hidden">
40+
<div class="modal-content">
41+
<h3>Edit Org</h3>
42+
<div class="form-group">
43+
<label>CLI Alias (Global)</label>
44+
<input type="text" id="edit-alias" placeholder="e.g. MyOrgDev" />
45+
</div>
46+
<div class="form-group">
47+
<label>Custom Name (Local Display Only)</label>
48+
<input type="text" id="edit-name" />
49+
</div>
50+
<div class="form-group">
51+
<label>Folder</label>
52+
<input type="text" id="edit-folder" list="folder-list" />
53+
<datalist id="folder-list"></datalist>
54+
</div>
55+
<div class="form-group">
56+
<label>Tags (comma separated)</label>
57+
<input type="text" id="edit-tags" />
58+
</div>
59+
<div class="modal-actions">
60+
<button id="cancel-edit">Cancel</button>
61+
<button id="save-edit" class="primary">Save</button>
62+
</div>
63+
</div>
64+
</div>
65+
66+
<!-- Add Org Modal -->
67+
<div id="add-org-modal" class="modal hidden">
68+
<div class="modal-content">
69+
<h3>Login to New Org</h3>
70+
<div class="form-group">
71+
<label>Alias (Optional)</label>
72+
<input type="text" id="add-alias" placeholder="e.g. MyNewOrg" />
73+
</div>
74+
<p class="subtext">This will open your browser to log in via Salesforce.</p>
75+
<div class="modal-actions">
76+
<button id="cancel-add">Cancel</button>
77+
<button id="confirm-add" class="primary">Login</button>
78+
</div>
79+
</div>
80+
</div>
81+
82+
<!-- Info/Details Modal -->
83+
<div id="info-modal" class="modal hidden">
84+
<div class="modal-content">
85+
<h3>Org Details</h3>
86+
<div class="info-grid" id="info-content">
87+
<!-- Populated dynamically -->
88+
</div>
89+
<div class="modal-actions">
90+
<button onclick="document.getElementById('info-modal').classList.add('hidden')">Close</button>
91+
</div>
92+
</div>
93+
</div>
94+
95+
<script src="renderer.js"></script>
96+
</body>
97+
</html>

launch.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Navigate to the script's directory (project root)
4+
cd "$(dirname "$0")"
5+
6+
# Add common paths for Node/npm (Homebrew, etc)
7+
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
8+
9+
# Start the Electron app in background and detach
10+
echo "Launching Salesforce Org Opener in background..."
11+
nohup npm start > /dev/null 2>&1 &
12+
echo "App launched. You can close this terminal."

0 commit comments

Comments
 (0)