Skip to content

Commit a02cc74

Browse files
committed
chore: rename cursor-cli to cursor-tool and update references
* updated package.json and pnpm-lock.yaml to reflect the new package name * modified README and documentation to replace cursor-cli with cursor-tool * adjusted scripts and comments in code to reference cursor-tool for token extraction
1 parent fa337f3 commit a02cc74

13 files changed

Lines changed: 61 additions & 52 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This repository contains TypeScript libraries and tools for working with the Cur
1010
This monorepo contains the following packages:
1111

1212
- [`cursor-api`](./packages/cursor-api/README.md): TypeScript library for interacting with the Cursor API
13-
- [`cursor-cli`](./packages/cursor-cli/README.md): CLI tools for Cursor IDE
13+
- [`cursor-tool`](./packages/cursor-tool/README.md): CLI tools for Cursor IDE
1414

1515
## Getting Started
1616

@@ -55,7 +55,7 @@ pnpm get-token
5555
cursor-api/
5656
├── packages/
5757
│ ├── cursor-api/ # Main API library
58-
│ └── cursor-cli/ # CLI tools
58+
│ └── cursor-tool/ # CLI tools
5959
├── e2e/ # End-to-end tests
6060
└── .github/ # GitHub workflows
6161
```
@@ -87,7 +87,7 @@ To manually publish packages:
8787
pnpm run release
8888

8989
# Publish a specific package
90-
cd packages/cursor-cli
90+
cd packages/cursor-tool
9191
pnpm publish
9292
```
9393

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"type-check": "pnpm -r type-check",
4747
"ci": "pnpm run lint && pnpm run type-check && pnpm run test:coverage && pnpm run build:verify",
4848
"prepare": "husky || true",
49-
"get-token": "pnpm --filter=cursor-cli start -- token"
49+
"get-token": "pnpm --filter=cursor-tool start -- token"
5050
},
5151
"devDependencies": {
5252
"@bufbuild/protobuf": "^2.5.2",

packages/cursor-api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ main()
5151

5252
## Authentication
5353

54-
To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-cli` tool:
54+
To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-tool` tool:
5555

5656
```bash
5757
# Install the CLI tool
58-
npm install -g cursor-cli
58+
npm install -g cursor-tool
5959

6060
# Extract your token and checksum
61-
cursor-cli token
61+
cursor-tool token
6262
```
6363

6464
For more details, see the [Authentication Guide](./docs/AUTHENTICATION.md).

packages/cursor-api/docs/AUTHENTICATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ The Cursor API requires two authentication parameters:
99
1. **API Key** (Token): A JWT token that authenticates your requests
1010
2. **Checksum**: A validation string that includes your machine identifiers
1111

12-
## Using cursor-cli (Recommended)
12+
## Using cursor-tool (Recommended)
1313

14-
The easiest way to get your authentication credentials is using the `cursor-cli` tool:
14+
The easiest way to get your authentication credentials is using the `cursor-tool` tool:
1515

1616
```bash
1717
# Install the CLI tool
18-
npm install -g cursor-cli
18+
npm install -g cursor-tool
1919

2020
# Extract your token and checksum
21-
cursor-cli token
21+
cursor-tool token
2222
```
2323

2424
This will output your token and checksum, which you can use to initialize the API client.
@@ -105,7 +105,7 @@ const completion = await cursor.chat.completions.create({
105105

106106
If you encounter authentication issues:
107107

108-
1. **Token Expired**: Cursor tokens can expire. Extract a new token using `cursor-cli`.
108+
1. **Token Expired**: Cursor tokens can expire. Extract a new token using `cursor-tool`.
109109
2. **Invalid Checksum**: Make sure you're using the correct checksum that matches your machine IDs.
110110
3. **Network Issues**: Ensure your network allows connections to Cursor API endpoints.
111111

packages/cursor-api/docs/QUICK_START.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ pnpm add cursor-api
1919

2020
## Authentication
2121

22-
To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-cli` tool:
22+
To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-tool` tool:
2323

2424
```bash
2525
# Install the CLI tool
26-
npm install -g cursor-cli
26+
npm install -g cursor-tool
2727

2828
# Extract your token and checksum
29-
cursor-cli token
29+
cursor-tool token
3030
```
3131

3232
This will output your token and checksum, which you'll need to initialize the client.

packages/cursor-api/scripts/debug-auth.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ interface DebugConfig {
1515
}
1616

1717
/**
18-
* Get authentication credentials using cursor-cli
18+
* Get authentication credentials using cursor-tool
1919
*/
2020
function getCredentialsFromCli(): { apiKey: string; checksum: string } | null {
2121
try {
22-
console.log('🔑 Trying to get credentials from cursor-cli...')
23-
// Get the path to the cursor-cli package
24-
const cliPath = join(__dirname, '../../../packages/cursor-cli')
22+
console.log('🔑 Trying to get credentials from cursor-tool...')
23+
// Get the path to the cursor-tool package
24+
const cliPath = join(__dirname, '../../../packages/cursor-tool')
2525

26-
// Run the cursor-cli token command
26+
// Run the cursor-tool token command
2727
const output = execSync('pnpm start -- token', {
2828
cwd: cliPath,
2929
stdio: ['ignore', 'pipe', 'pipe'],
@@ -37,13 +37,13 @@ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null {
3737
if (tokenMatch && checksumMatch) {
3838
const apiKey = tokenMatch[1]?.trim() ?? ''
3939
const checksum = checksumMatch[1]?.trim() ?? ''
40-
console.log('✅ Successfully retrieved credentials from cursor-cli')
40+
console.log('✅ Successfully retrieved credentials from cursor-tool')
4141
return { apiKey, checksum }
4242
}
4343

4444
return null
4545
} catch (error) {
46-
console.error('❌ Failed to get credentials from cursor-cli:', error)
46+
console.error('❌ Failed to get credentials from cursor-tool:', error)
4747
return null
4848
}
4949
}
@@ -54,9 +54,9 @@ async function debugAuth(): Promise<void> {
5454
let apiKey = process.env['CURSOR_API_KEY']
5555
let checksum = process.env['CURSOR_CHECKSUM']
5656

57-
// If environment variables are not set, try to get credentials from cursor-cli
57+
// If environment variables are not set, try to get credentials from cursor-tool
5858
if (!apiKey || !checksum) {
59-
console.log('⚠️ Missing environment variables, trying cursor-cli...')
59+
console.log('⚠️ Missing environment variables, trying cursor-tool...')
6060
const credentials = getCredentialsFromCli()
6161
if (credentials) {
6262
apiKey = credentials.apiKey
@@ -84,9 +84,11 @@ async function debugAuth(): Promise<void> {
8484
console.log(' - CURSOR_CHECKSUM environment variable not set')
8585
}
8686
console.log()
87-
console.log('Please set these environment variables or install cursor-cli:')
88-
console.log('1. Install cursor-cli: npm install -g cursor-cli')
89-
console.log('2. Run: cursor-cli token')
87+
console.log(
88+
'Please set these environment variables or install cursor-tool:'
89+
)
90+
console.log('1. Install cursor-tool: npm install -g cursor-tool')
91+
console.log('2. Run: cursor-tool token')
9092
console.log('3. Set environment variables:')
9193
console.log(' export CURSOR_API_KEY="<token>"')
9294
console.log(' export CURSOR_CHECKSUM="<checksum>"')
@@ -168,7 +170,7 @@ async function debugAuth(): Promise<void> {
168170

169171
console.log('\n🎯 Debug Summary:')
170172
console.log(' - If authentication failed, double-check your credentials')
171-
console.log(' - Try using cursor-cli to extract fresh credentials')
173+
console.log(' - Try using cursor-tool to extract fresh credentials')
172174
console.log(
173175
' - For further help, create an issue with the debug output above'
174176
)

packages/cursor-api/scripts/verify.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ interface VerificationResult {
1212
}
1313

1414
/**
15-
* Get authentication credentials using cursor-cli
15+
* Get authentication credentials using cursor-tool
1616
*/
1717
function getCredentialsFromCli(): { apiKey: string; checksum: string } | null {
1818
try {
19-
console.log('🔑 Trying to get credentials from cursor-cli...')
20-
// Get the path to the cursor-cli package
21-
const cliPath = join(__dirname, '../../../packages/cursor-cli')
19+
console.log('🔑 Trying to get credentials from cursor-tool...')
20+
// Get the path to the cursor-tool package
21+
const cliPath = join(__dirname, '../../../packages/cursor-tool')
2222

23-
// Run the cursor-cli token command
23+
// Run the cursor-tool token command
2424
const output = execSync('pnpm start -- token', {
2525
cwd: cliPath,
2626
stdio: ['ignore', 'pipe', 'pipe'],
@@ -34,13 +34,13 @@ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null {
3434
if (tokenMatch && checksumMatch) {
3535
const apiKey = tokenMatch[1]?.trim() ?? ''
3636
const checksum = checksumMatch[1]?.trim() ?? ''
37-
console.log('✅ Successfully retrieved credentials from cursor-cli')
37+
console.log('✅ Successfully retrieved credentials from cursor-tool')
3838
return { apiKey, checksum }
3939
}
4040

4141
return null
4242
} catch (error) {
43-
console.error('❌ Failed to get credentials from cursor-cli:', error)
43+
console.error('❌ Failed to get credentials from cursor-tool:', error)
4444
return null
4545
}
4646
}
@@ -52,7 +52,7 @@ async function verify(): Promise<void> {
5252
let apiKey = process.env['CURSOR_API_KEY']
5353
let checksum = process.env['CURSOR_CHECKSUM']
5454

55-
// If environment variables are not set, try to get credentials from cursor-cli
55+
// If environment variables are not set, try to get credentials from cursor-tool
5656
if (!apiKey || !checksum) {
5757
const credentials = getCredentialsFromCli()
5858
if (credentials) {
@@ -64,8 +64,8 @@ async function verify(): Promise<void> {
6464
if (!apiKey) {
6565
console.error('❌ CURSOR_API_KEY environment variable not set')
6666
console.log('\n📋 To get your API key:')
67-
console.log('1. Install cursor-cli: npm install -g cursor-cli')
68-
console.log('2. Run: cursor-cli token')
67+
console.log('1. Install cursor-tool: npm install -g cursor-tool')
68+
console.log('2. Run: cursor-tool token')
6969
console.log('3. Set environment variables:')
7070
console.log(' export CURSOR_API_KEY="<token>"')
7171
console.log(' export CURSOR_CHECKSUM="<checksum>"')

packages/cursor-tool/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# cursor-tool
2+
3+
## 2.0.0
4+
5+
### Major Changes
6+
7+
- 6281df4: refactor: restructure project for monorepo setup and update ESLint configuration
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cursor CLI
1+
# Cursor Tool
22

33
Command-line tools for Cursor IDE.
44

@@ -11,13 +11,13 @@ Command-line tools for Cursor IDE.
1111
### Global Installation
1212

1313
```bash
14-
npm install -g cursor-cli
14+
npm install -g cursor-tool
1515
```
1616

1717
### Local Installation
1818

1919
```bash
20-
npm install cursor-cli
20+
npm install cursor-tool
2121
```
2222

2323
## Usage
@@ -26,16 +26,16 @@ npm install cursor-cli
2626

2727
```bash
2828
# If installed globally
29-
cursor-cli token
29+
cursor-tool token
3030

3131
# If installed locally
32-
npx cursor-cli token
32+
npx cursor-tool token
3333
```
3434

3535
### Programmatic Usage
3636

3737
```typescript
38-
import { getCursorTokenInfo } from 'cursor-cli'
38+
import { getCursorTokenInfo } from 'cursor-tool'
3939

4040
const tokenInfo = getCursorTokenInfo()
4141
console.log(tokenInfo.token)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "cursor-cli",
3-
"version": "1.0.0",
2+
"name": "cursor-tool",
3+
"version": "2.0.0",
44
"description": "CLI tools for Cursor IDE",
55
"author": "xwartz",
66
"license": "MIT",
77
"bin": {
8-
"cursor-cli": "./bin/index.js"
8+
"cursor-tool": "./bin/index.js"
99
},
1010
"scripts": {
1111
"start": "tsx src/index.ts",
@@ -34,7 +34,7 @@
3434
"repository": {
3535
"type": "git",
3636
"url": "https://github.com/xwartz/cursor-api",
37-
"directory": "packages/cursor-cli"
37+
"directory": "packages/cursor-tool"
3838
},
3939
"engines": {
4040
"node": ">=18.0.0"

0 commit comments

Comments
 (0)