Skip to content

1. Install the CLI

Terminal window
npm install -g swytchcode

Use swy as a shorter alias for swytchcode.

2. Install the packages

Terminal window
npm install @swytchcode/runtime @langchain/core langgraph dotenv

3. Initialize Swytchcode and fetch a toolkit

Terminal window
swy init
swy get github

swy init creates .swytchcode/ and tooling.json for the project. swy get github downloads the GitHub integration bundle - the schemas that tools.get reads from in the next step.

4. Load the tools

import 'dotenv/config';
import { Swytchcode } from '@swytchcode/runtime';
import { LangGraphProvider } from '@swytchcode/runtime/providers/langgraph';
const swx = new Swytchcode(new LangGraphProvider());
const tools = await swx.tools.get({ toolkits: ['github'] });

5. Pass them into LangGraph

// Build your graph with the returned tools and let the agent invoke them.
console.log('LangGraph tools ready:', tools.length);

6. Run the file

Save the example as main.js or main.py, then run the matching command:

Terminal window
node main.js

This keeps tool execution inside Swytchcode while the workflow graph stays focused on orchestration.