Skip to content

Commit 2581d40

Browse files
committed
Update readme
Signed-off-by: Rahul Krishna <[email protected]>
1 parent a742bf7 commit 2581d40

File tree

1 file changed

+85
-28
lines changed

1 file changed

+85
-28
lines changed

README.md

Lines changed: 85 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<picture>
2-
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/cldk-dark.png">
3-
<source media="(prefers-color-scheme: light)" srcset="docs/assets/cldk-light.png">
2+
<source media="(prefers-color-scheme: dark)" srcset="./docs/assets/cldk-dark.png">
3+
<source media="(prefers-color-scheme: light)" srcset="./docs/assets/cldk-light.png">
44
<img alt="Logo">
55
</picture>
66

@@ -25,52 +25,109 @@
2525

2626
**A framework that bridges the gap between traditional program analysis tools and Large Language Models (LLMs) specialized for code (CodeLLMs).**
2727

28-
### 🚀 Overview
28+
### Overview
2929
This is the TypeScript SDK for the Codellm-Devkit (CLDK). The SDK provides a unified interface for integrating outputs from various analysis tools and preparing them for effective use by CodeLLMs. It allows developers to streamline the process of transforming raw code into actionable insights.
3030

3131
### 📦 Installation
3232

33-
To install the Codellm-Devkit TypeScript SDK, you can use npm or yarn. Run the following command in your terminal:
33+
To install the SDK, you can use bun, npm, or yarn. Run the following command in your terminal:
3434

3535
#### Using npm
3636
```bash
37-
npm install --save github:codellm-devkit/typescript-sdk#initial-sdk
37+
npm i @cldk/cldk
3838
```
3939

4040
#### Using yarn
4141
```bash
42-
yarn add github:codellm-devkit/typescript-sdk#initial-sdk
43-
```
44-
If you are on yarn v1
45-
```bash
46-
yarn add codellm-devkit/typescript-sdk#initial-sdk
42+
yarn add @cldk/cldk
4743
```
4844

4945
#### Using bun
5046
```bash
51-
bun add github:codellm-devkit/typescript-sdk#initial-sdk
47+
bun add @cldk/cldk
5248
```
5349

54-
Then run `npm install`, `yarn install`, or `bun install` depending on your package manager.
50+
### 🚀 Quickstart
5551

56-
### ⚙️ Basic Usage
52+
1. Create a Temporary Directory
5753

58-
Here’s how to use CLDK to analyze a Java project and access key analysis artifacts:
54+
```bash
55+
mkdir cldk-quickstart
56+
cd cldk-quickstart
57+
```
5958

60-
```typescript
61-
import { CLDK } from "cldk";
59+
2. Initialize a Bare Project
6260

63-
// Initialize Java analysis
64-
const analysis = CLDK.for("java").analysis({
65-
projectPath: "/path/to/your/java/project",
66-
analysisLevel: "Symbol Table",
67-
});
61+
```bash
62+
bun init -y
63+
```
6864

69-
// Retrieve structured application model
70-
const jApplication = await analysis.getApplication();
71-
console.log("Parsed JApplication:", jApplication);
65+
This creates a minimal `package.json` instantly.
7266

73-
// Retrieve the symbol table
74-
const symbolTable = await analysis.getSymbolTable();
75-
console.log("Symbol Table:", symbolTable);
76-
```
67+
3. Install `@cldk/cldk`
68+
69+
```bash
70+
bun add @cldk/cldk
71+
```
72+
73+
4. Create a file `test-analysis.ts` with the following content:
74+
75+
```typescript
76+
import { CLDK } from "cldk";
77+
78+
// Initialize Java analysis
79+
const analysis = CLDK.for("java").analysis({
80+
projectPath: "/path/to/your/java/project",
81+
analysisLevel: "Symbol Table",
82+
});
83+
84+
// Retrieve structured application model
85+
const jApplication = await analysis.getApplication();
86+
console.log("Parsed JApplication:", jApplication);
87+
88+
// Retrieve the symbol table
89+
const symbolTable = await analysis.getSymbolTable();
90+
console.log("Symbol Table:", symbolTable);
91+
```
92+
93+
5. Run the Script
94+
95+
```bash
96+
bun test-analysis.ts
97+
```
98+
99+
### 🛠️ Development Instructions
100+
101+
#### Developing Locally (with Bun)
102+
103+
1. Clone the repository:
104+
```bash
105+
git clone https://github.com/codellm-devkit/typescript-sdk.git
106+
cd typescript-sdk
107+
```
108+
109+
2. If you don't have it already, pleaes install `Bun`:
110+
```bash
111+
curl -fsSL https://bun.sh/install | bash
112+
```
113+
_Note: follow any post-installation instructions to complete the installation_
114+
3. Install the dependencies
115+
```bash
116+
bun install
117+
```
118+
119+
4. Run tests:
120+
```bash
121+
bun run test
122+
```
123+
124+
#### Developing inside a Container (Using Dev Containers)
125+
126+
1. If you don't, ensure you have Docker/Podman and a compatible editor (e.g., VS Code) with the Dev Containers extension installed.
127+
128+
2. Open the repository in your editor. When prompted, reopen the project in the dev container. The devcontainer is configured to come pre-installed with bun and all the necessary dependencies.
129+
130+
3. You can start by run tests:
131+
```bash
132+
bun run test
133+
```

0 commit comments

Comments
 (0)