diff --git a/.changeset/dirty-cycles-juggle.md b/.changeset/dirty-cycles-juggle.md new file mode 100644 index 0000000..d870693 --- /dev/null +++ b/.changeset/dirty-cycles-juggle.md @@ -0,0 +1,6 @@ +--- +'cursor-tool': minor +'cursor-api': minor +--- + +chore: rename cursor-cli to cursor-tool diff --git a/README.md b/README.md index 01f79a9..4d9c6e2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This repository contains TypeScript libraries and tools for working with the Cur This monorepo contains the following packages: - [`cursor-api`](./packages/cursor-api/README.md): TypeScript library for interacting with the Cursor API -- [`cursor-cli`](./packages/cursor-cli/README.md): CLI tools for Cursor IDE +- [`cursor-tool`](./packages/cursor-tool/README.md): CLI tools for Cursor IDE ## Getting Started @@ -55,7 +55,7 @@ pnpm get-token cursor-api/ ├── packages/ │ ├── cursor-api/ # Main API library -│ └── cursor-cli/ # CLI tools +│ └── cursor-tool/ # CLI tools ├── e2e/ # End-to-end tests └── .github/ # GitHub workflows ``` @@ -87,7 +87,7 @@ To manually publish packages: pnpm run release # Publish a specific package -cd packages/cursor-cli +cd packages/cursor-tool pnpm publish ``` diff --git a/package.json b/package.json index b779520..2b45cc6 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "type-check": "pnpm -r type-check", "ci": "pnpm run lint && pnpm run type-check && pnpm run test:coverage && pnpm run build:verify", "prepare": "husky || true", - "get-token": "pnpm --filter=cursor-cli start -- token" + "get-token": "pnpm --filter=cursor-tool start -- token" }, "devDependencies": { "@bufbuild/protobuf": "^2.5.2", diff --git a/packages/cursor-api/README.md b/packages/cursor-api/README.md index 84e69e7..4f64fa5 100644 --- a/packages/cursor-api/README.md +++ b/packages/cursor-api/README.md @@ -51,14 +51,14 @@ main() ## Authentication -To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-cli` tool: +To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-tool` tool: ```bash # Install the CLI tool -npm install -g cursor-cli +npm install -g cursor-tool # Extract your token and checksum -cursor-cli token +cursor-tool token ``` For more details, see the [Authentication Guide](./docs/AUTHENTICATION.md). diff --git a/packages/cursor-api/docs/AUTHENTICATION.md b/packages/cursor-api/docs/AUTHENTICATION.md index ad7d3a1..3bf1efc 100644 --- a/packages/cursor-api/docs/AUTHENTICATION.md +++ b/packages/cursor-api/docs/AUTHENTICATION.md @@ -9,16 +9,16 @@ The Cursor API requires two authentication parameters: 1. **API Key** (Token): A JWT token that authenticates your requests 2. **Checksum**: A validation string that includes your machine identifiers -## Using cursor-cli (Recommended) +## Using cursor-tool (Recommended) -The easiest way to get your authentication credentials is using the `cursor-cli` tool: +The easiest way to get your authentication credentials is using the `cursor-tool` tool: ```bash # Install the CLI tool -npm install -g cursor-cli +npm install -g cursor-tool # Extract your token and checksum -cursor-cli token +cursor-tool token ``` 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({ If you encounter authentication issues: -1. **Token Expired**: Cursor tokens can expire. Extract a new token using `cursor-cli`. +1. **Token Expired**: Cursor tokens can expire. Extract a new token using `cursor-tool`. 2. **Invalid Checksum**: Make sure you're using the correct checksum that matches your machine IDs. 3. **Network Issues**: Ensure your network allows connections to Cursor API endpoints. diff --git a/packages/cursor-api/docs/QUICK_START.md b/packages/cursor-api/docs/QUICK_START.md index c30b807..dd85030 100644 --- a/packages/cursor-api/docs/QUICK_START.md +++ b/packages/cursor-api/docs/QUICK_START.md @@ -19,14 +19,14 @@ pnpm add cursor-api ## Authentication -To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-cli` tool: +To use the Cursor API, you need an authentication token and checksum. You can obtain these using the `cursor-tool` tool: ```bash # Install the CLI tool -npm install -g cursor-cli +npm install -g cursor-tool # Extract your token and checksum -cursor-cli token +cursor-tool token ``` This will output your token and checksum, which you'll need to initialize the client. diff --git a/packages/cursor-api/scripts/debug-auth.ts b/packages/cursor-api/scripts/debug-auth.ts index ea7f37f..07d2ae8 100644 --- a/packages/cursor-api/scripts/debug-auth.ts +++ b/packages/cursor-api/scripts/debug-auth.ts @@ -15,15 +15,15 @@ interface DebugConfig { } /** - * Get authentication credentials using cursor-cli + * Get authentication credentials using cursor-tool */ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null { try { - console.log('🔑 Trying to get credentials from cursor-cli...') - // Get the path to the cursor-cli package - const cliPath = join(__dirname, '../../../packages/cursor-cli') + console.log('🔑 Trying to get credentials from cursor-tool...') + // Get the path to the cursor-tool package + const cliPath = join(__dirname, '../../../packages/cursor-tool') - // Run the cursor-cli token command + // Run the cursor-tool token command const output = execSync('pnpm start -- token', { cwd: cliPath, stdio: ['ignore', 'pipe', 'pipe'], @@ -37,13 +37,13 @@ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null { if (tokenMatch && checksumMatch) { const apiKey = tokenMatch[1]?.trim() ?? '' const checksum = checksumMatch[1]?.trim() ?? '' - console.log('✅ Successfully retrieved credentials from cursor-cli') + console.log('✅ Successfully retrieved credentials from cursor-tool') return { apiKey, checksum } } return null } catch (error) { - console.error('❌ Failed to get credentials from cursor-cli:', error) + console.error('❌ Failed to get credentials from cursor-tool:', error) return null } } @@ -54,9 +54,9 @@ async function debugAuth(): Promise { let apiKey = process.env['CURSOR_API_KEY'] let checksum = process.env['CURSOR_CHECKSUM'] - // If environment variables are not set, try to get credentials from cursor-cli + // If environment variables are not set, try to get credentials from cursor-tool if (!apiKey || !checksum) { - console.log('⚠️ Missing environment variables, trying cursor-cli...') + console.log('⚠️ Missing environment variables, trying cursor-tool...') const credentials = getCredentialsFromCli() if (credentials) { apiKey = credentials.apiKey @@ -84,9 +84,11 @@ async function debugAuth(): Promise { console.log(' - CURSOR_CHECKSUM environment variable not set') } console.log() - console.log('Please set these environment variables or install cursor-cli:') - console.log('1. Install cursor-cli: npm install -g cursor-cli') - console.log('2. Run: cursor-cli token') + console.log( + 'Please set these environment variables or install cursor-tool:' + ) + console.log('1. Install cursor-tool: npm install -g cursor-tool') + console.log('2. Run: cursor-tool token') console.log('3. Set environment variables:') console.log(' export CURSOR_API_KEY=""') console.log(' export CURSOR_CHECKSUM=""') @@ -168,7 +170,7 @@ async function debugAuth(): Promise { console.log('\n🎯 Debug Summary:') console.log(' - If authentication failed, double-check your credentials') - console.log(' - Try using cursor-cli to extract fresh credentials') + console.log(' - Try using cursor-tool to extract fresh credentials') console.log( ' - For further help, create an issue with the debug output above' ) diff --git a/packages/cursor-api/scripts/verify.ts b/packages/cursor-api/scripts/verify.ts index 3c34b9a..9094655 100644 --- a/packages/cursor-api/scripts/verify.ts +++ b/packages/cursor-api/scripts/verify.ts @@ -12,15 +12,15 @@ interface VerificationResult { } /** - * Get authentication credentials using cursor-cli + * Get authentication credentials using cursor-tool */ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null { try { - console.log('🔑 Trying to get credentials from cursor-cli...') - // Get the path to the cursor-cli package - const cliPath = join(__dirname, '../../../packages/cursor-cli') + console.log('🔑 Trying to get credentials from cursor-tool...') + // Get the path to the cursor-tool package + const cliPath = join(__dirname, '../../../packages/cursor-tool') - // Run the cursor-cli token command + // Run the cursor-tool token command const output = execSync('pnpm start -- token', { cwd: cliPath, stdio: ['ignore', 'pipe', 'pipe'], @@ -34,13 +34,13 @@ function getCredentialsFromCli(): { apiKey: string; checksum: string } | null { if (tokenMatch && checksumMatch) { const apiKey = tokenMatch[1]?.trim() ?? '' const checksum = checksumMatch[1]?.trim() ?? '' - console.log('✅ Successfully retrieved credentials from cursor-cli') + console.log('✅ Successfully retrieved credentials from cursor-tool') return { apiKey, checksum } } return null } catch (error) { - console.error('❌ Failed to get credentials from cursor-cli:', error) + console.error('❌ Failed to get credentials from cursor-tool:', error) return null } } @@ -52,7 +52,7 @@ async function verify(): Promise { let apiKey = process.env['CURSOR_API_KEY'] let checksum = process.env['CURSOR_CHECKSUM'] - // If environment variables are not set, try to get credentials from cursor-cli + // If environment variables are not set, try to get credentials from cursor-tool if (!apiKey || !checksum) { const credentials = getCredentialsFromCli() if (credentials) { @@ -64,8 +64,8 @@ async function verify(): Promise { if (!apiKey) { console.error('❌ CURSOR_API_KEY environment variable not set') console.log('\n📋 To get your API key:') - console.log('1. Install cursor-cli: npm install -g cursor-cli') - console.log('2. Run: cursor-cli token') + console.log('1. Install cursor-tool: npm install -g cursor-tool') + console.log('2. Run: cursor-tool token') console.log('3. Set environment variables:') console.log(' export CURSOR_API_KEY=""') console.log(' export CURSOR_CHECKSUM=""') diff --git a/packages/cursor-cli/CHANGELOG.md b/packages/cursor-tool/CHANGELOG.md similarity index 89% rename from packages/cursor-cli/CHANGELOG.md rename to packages/cursor-tool/CHANGELOG.md index 43b849c..3a1b2f5 100644 --- a/packages/cursor-cli/CHANGELOG.md +++ b/packages/cursor-tool/CHANGELOG.md @@ -1,4 +1,4 @@ -# cursor-cli +# cursor-tool ## 2.0.0 diff --git a/packages/cursor-cli/README.md b/packages/cursor-tool/README.md similarity index 85% rename from packages/cursor-cli/README.md rename to packages/cursor-tool/README.md index 52bddb4..47a505f 100644 --- a/packages/cursor-cli/README.md +++ b/packages/cursor-tool/README.md @@ -1,4 +1,4 @@ -# Cursor CLI +# Cursor Tool Command-line tools for Cursor IDE. @@ -11,13 +11,13 @@ Command-line tools for Cursor IDE. ### Global Installation ```bash -npm install -g cursor-cli +npm install -g cursor-tool ``` ### Local Installation ```bash -npm install cursor-cli +npm install cursor-tool ``` ## Usage @@ -26,16 +26,16 @@ npm install cursor-cli ```bash # If installed globally -cursor-cli token +cursor-tool token # If installed locally -npx cursor-cli token +npx cursor-tool token ``` ### Programmatic Usage ```typescript -import { getCursorTokenInfo } from 'cursor-cli' +import { getCursorTokenInfo } from 'cursor-tool' const tokenInfo = getCursorTokenInfo() console.log(tokenInfo.token) diff --git a/packages/cursor-cli/package.json b/packages/cursor-tool/package.json similarity index 88% rename from packages/cursor-cli/package.json rename to packages/cursor-tool/package.json index 3e127d7..c05c7fa 100644 --- a/packages/cursor-cli/package.json +++ b/packages/cursor-tool/package.json @@ -1,11 +1,11 @@ { - "name": "cursor-cli", + "name": "cursor-tool", "version": "2.0.0", "description": "CLI tools for Cursor IDE", "author": "xwartz", "license": "MIT", "bin": { - "cursor-cli": "./bin/index.js" + "cursor-tool": "./bin/index.js" }, "scripts": { "start": "tsx src/index.ts", @@ -34,7 +34,7 @@ "repository": { "type": "git", "url": "https://github.com/xwartz/cursor-api", - "directory": "packages/cursor-cli" + "directory": "packages/cursor-tool" }, "engines": { "node": ">=18.0.0" diff --git a/packages/cursor-cli/src/index.ts b/packages/cursor-tool/src/index.ts similarity index 98% rename from packages/cursor-cli/src/index.ts rename to packages/cursor-tool/src/index.ts index b34c406..78db53f 100644 --- a/packages/cursor-cli/src/index.ts +++ b/packages/cursor-tool/src/index.ts @@ -207,13 +207,13 @@ function tokenCommand() { function showHelp() { console.log('Cursor CLI - Command-line tools collection\n') console.log('Usage:') - console.log(' cursor-cli [command]') + console.log(' cursor-tool [command]') console.log('\nCommands:') console.log(' token Extract Cursor Token information') console.log(' help Show help information') console.log('\nExamples:') - console.log(' cursor-cli token') - console.log(' cursor-cli help') + console.log(' cursor-tool token') + console.log(' cursor-tool help') } /** diff --git a/packages/cursor-cli/tsconfig.json b/packages/cursor-tool/tsconfig.json similarity index 100% rename from packages/cursor-cli/tsconfig.json rename to packages/cursor-tool/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 254f49b..2042cfd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,7 +84,7 @@ importers: specifier: ^11.0.3 version: 11.1.0 - packages/cursor-cli: + packages/cursor-tool: dependencies: better-sqlite3: specifier: ^11.1.2