Skip to main content

Managing Sessions

Starting a Session

eg session start

This auto-detects your IP address and creates a session with the default duration. The session applies IP rules to all cloud resources assigned to you.

Options

FlagDescription
--duration <hours>Session duration in hours (default: your org's default)
--ipv4 <address>Override the detected IPv4 address
--ipv6 <address>Override the detected IPv6 address

Examples

# Start with a custom duration
eg session start --duration 4

# Start with a specific IP
eg session start --ipv4 203.0.113.42

# Start with both IPv4 and IPv6
eg session start --ipv4 203.0.113.42 --ipv6 2001:db8::1

Output

→ Starting session...
✓ Session started
ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Status: PENDING
IPv4: 203.0.113.42
Expires: 2026-02-27 18:00:00 (8h 0m remaining)
Resources: 3

Listing Sessions

eg session list
ID        STATUS   IP              STARTED              REMAINING
a1b2c3d4 ACTIVE 203.0.113.42 2026-02-27 10:00:00 6h 30m
b2c3d4e5 EXPIRED 203.0.113.42 2026-02-26 14:00:00 expired

Getting Session Details

eg session get a1b2c3d4-e5f6-7890-abcd-ef1234567890

Shows full session info including per-resource IP rule status:

Session a1b2c3d4-e5f6-7890-abcd-ef1234567890
Status: ACTIVE
User: Alice Smith ([email protected])
IPv4: 203.0.113.42
Started: 2026-02-27 10:00:00
Expires: 2026-02-27 18:00:00 (6h 30m remaining)

RESOURCE VERSION IP STATUS APPLIED
prod-api-sg IPv4 203.0.113.42 APPLIED 2026-02-27 10:00:02
staging-db-sg IPv4 203.0.113.42 APPLIED 2026-02-27 10:00:03
tip

You can use the short ID prefix shown in eg session list or the full UUID.

Extending a Session

Extend an active session before it expires:

eg session extend a1b2c3d4-e5f6-7890-abcd-ef1234567890 --hours 2
→ Extending session a1b2c3d4 by 2 hours...
✓ Session extended — new expiry: 2026-02-27 20:00:00 (8h 30m remaining)

The --hours flag is required.

Stopping a Session

Stop a specific session by ID:

eg session stop a1b2c3d4-e5f6-7890-abcd-ef1234567890

Or stop the most recent active session (no ID needed):

eg session stop
→ Stopping session a1b2c3d4...
✓ Session stopped

JSON Output

All session commands support --output json for scripting:

# Get session ID for scripting
eg session start --output json | jq -r '.id'

# List active sessions as JSON
eg session list --output json

Next Steps


API Reference: See Sessions API.