Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jaypopat/cf_ai_duet/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Duet enables instant pair programming through SSH. Connect to the server, create or join a room, and start collaborating with your team in seconds—no additional setup required.

Creating a session

When you connect to Duet via SSH, you’ll see the launch screen with two options:
1

Connect to the Duet server

ssh [email protected] -p 2222
Your SSH username becomes your display name in the session.
2

Select 'Create room'

Navigate using arrow keys or press c to create a new room.
3

Add an optional description

Enter a description like “Backend refactoring” or “Bug fix session”. This generates a readable workspace name (e.g., backend-refactoring).
If you skip the description, Duet generates a random name like cosmic-phoenix
4

Share the room ID

After creation, you’ll see a screen with your unique room ID (UUID format). Share this with your pair programming partner.
Room created: a3f8e9d2-4c1b-4f3a-9e2b-8d7c6b5a4e3f
5

Press Enter to start

You’ll be taken to the collaborative terminal where you can start working.

Joining a session

To join an existing session:
1

Connect via SSH

ssh [email protected] -p 2222
2

Select 'Join room'

Press j or navigate to “Join room” and press Enter.
3

Enter the room ID

Paste the UUID you received from the session host:
Room ID: a3f8e9d2-4c1b-4f3a-9e2b-8d7c6b5a4e3f
4

Start collaborating

You’ll immediately see the shared terminal and any existing chat history.

Session architecture

Under the hood, Duet rooms are managed by the room.Manager which coordinates:
  • Client registration: Each connection creates a Client with a unique ID and username
  • Event broadcasting: All participants receive real-time events (joins, leaves, typing indicators)
  • Workspace isolation: Each room gets its own directory at /app/workspaces/{workspace-name}
  • Resource cleanup: When the last participant leaves, the workspace and all resources are destroyed
type Room struct {
    ID           string
    Description  string
    Host         string
    Connections  []*Client
    Terminal     *terminal.Terminal
    AIMessages   []AIMessage
    WorkspaceDir string
}

Real-time presence

Duet keeps everyone informed about session activity:

Join notifications

When someone joins, all participants see:
alice joined

Leave notifications

When someone disconnects:
bob left

Typing indicators

See who’s actively typing in the terminal (debounced to 500ms)

User list

The sidebar shows all connected users with their roles:
  • alice (host) (you)
  • bob

Keyboard shortcuts

KeyAction
cCreate a new room
jJoin an existing room
↑/↓ or k/jNavigate menu
EnterSelect option
q or EscQuit

Session lifecycle

Error handling

If you try to join a non-existent room ID, you’ll see:
Error: room not found
Verify the room ID with the host and try again.
Rooms are ephemeral—they only exist while at least one participant is connected. If everyone leaves, the room and its workspace are permanently deleted.

Next steps

Shared terminal

Learn how the real-time terminal synchronization works

AI assistant

Use AI to help with your pair programming session

Build docs developers (and LLMs) love