Skip to content

Commit 3a09d4c

Browse files
authored
Merge pull request #35 from kedare/better-readme
Better readme
2 parents 8c64c88 + 1831245 commit 3a09d4c

2 files changed

Lines changed: 106 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Continuous Integration
33
on:
44
push:
55
branches: [main]
6+
paths-ignore:
7+
- '**.md'
68
pull_request:
79
branches: [main]
10+
paths-ignore:
11+
- '**.md'
812

913
permissions:
1014
contents: read

README.md

Lines changed: 102 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,35 +162,114 @@ compass completion fish > ~/.config/fish/completions/compass.fish
162162
compass completion powershell | Out-String | Invoke-Expression
163163
```
164164

165-
## Quick Start
165+
## Getting Started
166166

167+
### Initial Setup
168+
169+
After installing `compass`, you're ready to use it immediately if you already have `gcloud` installed and authenticated. Compass uses your existing `gcloud` credentials, so there's no additional authentication needed.
170+
171+
**Verify your setup:**
167172
```bash
168-
# Simple SSH to an instance (discovers project, zone automatically if cached)
169-
compass gcp ssh my-instance
173+
# Check compass is installed
174+
compass version
170175

171-
# First time connecting - specify the project
172-
compass gcp ssh my-instance --project my-gcp-project
176+
# Check gcloud is authenticated
177+
gcloud auth list
178+
```
173179

174-
# Look up which resources use a specific IP address
175-
compass gcp ip lookup 192.168.0.208
180+
### Loading Projects
181+
182+
For multi-project operations (IP lookups, instance discovery across projects, global search), you'll want to import your GCP projects into the cache:
176183

177-
# Import projects for multi-project operations (interactive)
184+
**Interactive project selection:**
185+
```bash
178186
compass gcp projects import
187+
```
188+
189+
This command discovers all projects you have access to and presents an interactive menu. Use arrow keys to navigate, `Space` to select/deselect projects, and `Enter` to confirm. Only selected projects will be used for multi-project searches.
179190

180-
# Import projects matching a regex pattern (non-interactive)
191+
**Quick import with regex:**
192+
```bash
193+
# Import all production projects
181194
compass gcp projects import --regex "^prod-"
182195

183-
# Search cached projects for instances with matching names
184-
compass gcp search piou
196+
# Import dev and staging projects
197+
compass gcp projects import -r "dev|staging"
198+
```
185199

186-
# Inspect VPN gateways
187-
compass gcp vpn list --project prod
200+
**Why import projects?**
201+
- Enables instance discovery without specifying `--project` every time
202+
- Powers the global resource search across your infrastructure
203+
- Speeds up IP lookups by caching subnet information
204+
- Learns from your search patterns to prioritize frequently-used projects
188205

189-
# Launch the interactive TUI
190-
compass interactive
206+
### Using the Interactive TUI
191207

192-
# Update to the latest published release
193-
compass update
208+
Launch the Terminal UI for a visual, keyboard-driven experience:
209+
210+
```bash
211+
compass interactive # or: compass i
212+
```
213+
214+
**Essential keyboard shortcuts:**
215+
216+
| Key | Action | Description |
217+
|-----|--------|-------------|
218+
| `` / `` | Navigate | Move through the list |
219+
| `s` | SSH | Connect to selected instance |
220+
| `d` | Details | Show detailed information |
221+
| `b` | Browser | Open resource in Cloud Console |
222+
| `/` | Filter | Filter current view (AND/OR/NOT operators) |
223+
| `Shift+S` | Search | Global search across all resource types |
224+
| `Shift+R` | Refresh | Reload current view |
225+
| `v` | VPN View | Switch to VPN inspection |
226+
| `c` | CT View | Switch to connectivity tests |
227+
| `i` | IP Lookup | Switch to IP address lookup |
228+
| `?` | Help | Show all available shortcuts |
229+
| `Esc` | Back/Quit | Clear filter or exit application |
230+
231+
**Filter syntax:**
232+
- `web prod` — AND: must contain both "web" AND "prod"
233+
- `web|api` — OR: must contain "web" OR "api"
234+
- `-dev` — NOT: must NOT contain "dev"
235+
- Combine: `web|api prod -staging` — ("web" or "api") AND "prod" but NOT "staging"
236+
237+
**In global search (`Shift+S`):**
238+
- `Tab` — Toggle fuzzy matching (e.g., "prd" matches "production")
239+
- Results appear progressively as they're found across 22 resource types
240+
- Use `/` to further filter results after search completes
241+
242+
### Common Commands
243+
244+
Once you've set up projects, here are the most frequently used commands:
245+
246+
**SSH to instances:**
247+
```bash
248+
# If the instance is in a cached project, just use its name
249+
compass gcp ssh my-instance
250+
251+
# First time connecting to a new instance? Specify the project
252+
compass gcp ssh my-instance --project my-gcp-project
253+
254+
# Subsequent connections remember the project, zone, and IAP preference
255+
compass gcp ssh my-instance
256+
```
257+
258+
Compass automatically discovers the instance's zone, determines if IAP tunneling is needed, caches the metadata for instant future connections, and learns which projects to prioritize for similar searches.
259+
260+
**Search and lookup:**
261+
```bash
262+
# Global search across all resource types (22 types supported)
263+
compass gcp search piou
264+
265+
# Look up which resources use a specific IP address
266+
compass gcp ip lookup 192.168.0.208
267+
```
268+
269+
**VPN and connectivity:**
270+
```bash
271+
# Inspect VPN gateways, tunnels, and BGP sessions
272+
compass gcp vpn list --project prod
194273

195274
# Test connectivity between instances
196275
compass gcp connectivity-test create web-to-db \
@@ -200,6 +279,12 @@ compass gcp connectivity-test create web-to-db \
200279
--destination-port 5432
201280
```
202281

282+
**Maintenance:**
283+
```bash
284+
# Update to the latest published release
285+
compass update
286+
```
287+
203288
## Command Examples
204289

205290
### SSH Connection Examples

0 commit comments

Comments
 (0)