Skip to main content
Connect to Devin with a personal access token (cog_…), cloud or local. cwd is the switch: passing one spawns the bundled Devin CLI in that directory (LocalDevin); leaving it out connects to Devin’s cloud over a WebSocket (CloudDevin). Both need an API key, from the apiKey option or $DEVIN_API_KEY; the environment never decides the transport.
Clients are async-disposable: await using closes the connection at scope exit, or call devin.close() yourself.

Parameters

Returns

LocalDevin
Connect to Devin with a personal access token (cog_…), cloud or local. cwd is the switch: passing one spawns the bundled Devin CLI in that directory (LocalDevin); leaving it out connects to Devin’s cloud over a WebSocket (CloudDevin). Both need an API key, from the apiKey option or $DEVIN_API_KEY; the environment never decides the transport.
Clients are async-disposable: await using closes the connection at scope exit, or call devin.close() yourself.

Parameters

Returns

CloudDevin
Connect to Devin with a personal access token (cog_…), cloud or local. cwd is the switch: passing one spawns the bundled Devin CLI in that directory (LocalDevin); leaving it out connects to Devin’s cloud over a WebSocket (CloudDevin). Both need an API key, from the apiKey option or $DEVIN_API_KEY; the environment never decides the transport.
Clients are async-disposable: await using closes the connection at scope exit, or call devin.close() yourself.

Parameters

Returns

LocalDevinCloudDevin