@bniladridas/cursor 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,15 +105,18 @@ jobs:
105
105
  release:
106
106
  needs: [linux, macos, windows]
107
107
  runs-on: ubuntu-latest
108
- env:
109
- GH_TOKEN: ${{ github.token }}
110
-
111
108
  steps:
112
109
  - uses: actions/checkout@v6
113
110
  with:
114
111
  ref: main
115
112
  fetch-depth: 0
116
113
 
114
+ - uses: actions/create-github-app-token@v3
115
+ id: app-token
116
+ with:
117
+ client-id: ${{ secrets.CURSOR_BOT_CLIENT_ID }}
118
+ private-key: ${{ secrets.CURSOR_BOT_PRIVATE_KEY }}
119
+
117
120
  - name: Download artifacts
118
121
  uses: actions/download-artifact@v6
119
122
  with:
@@ -133,6 +136,8 @@ jobs:
133
136
  echo "SOURCE_SHA=$(sha256sum /tmp/source.tar.gz | cut -d' ' -f1)" >> $GITHUB_ENV
134
137
 
135
138
  - name: Publish release
139
+ env:
140
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
136
141
  run: |
137
142
  gh release create "$GITHUB_REF_NAME" \
138
143
  $(find release -name '*.tar.gz' -o -name '*.zip' | sed 's|^| |') \
@@ -152,19 +157,12 @@ jobs:
152
157
  npm version "$version" --no-git-tag-version --allow-same-version
153
158
 
154
159
  - name: Publish npm
155
- if: env.NPM_TOKEN != ''
156
160
  env:
157
161
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
158
162
  run: |
159
163
  echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
160
164
  npm publish --access public --provenance 2>&1 || echo "already published"
161
165
 
162
- - uses: actions/create-github-app-token@v3
163
- id: app-token
164
- with:
165
- client-id: ${{ secrets.CURSOR_BOT_CLIENT_ID }}
166
- private-key: ${{ secrets.CURSOR_BOT_PRIVATE_KEY }}
167
-
168
166
  - name: Create version update PR
169
167
  uses: peter-evans/create-pull-request@v8
170
168
  with:
package/CMakeLists.txt CHANGED
@@ -1,7 +1,8 @@
1
1
  cmake_minimum_required(VERSION 3.14)
2
2
 
3
- # Get version from git tag if available, fallback to 0.1.6
4
- find_package(Git)
3
+ # Try to get version from git tag
4
+ find_package(Git QUIET)
5
+ set(PROJECT_VERSION "0.0.0")
5
6
  if(GIT_FOUND)
6
7
  execute_process(
7
8
  COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
@@ -12,11 +13,16 @@ if(GIT_FOUND)
12
13
  )
13
14
  if(GIT_TAG)
14
15
  string(REGEX REPLACE "^v" "" PROJECT_VERSION ${GIT_TAG})
15
- else()
16
- set(PROJECT_VERSION "0.1.6")
17
16
  endif()
18
- else()
19
- set(PROJECT_VERSION "0.1.6")
17
+ endif()
18
+
19
+ # Fallback: extract from source dir name (e.g., cursor-0.1.8 from tarball)
20
+ if(PROJECT_VERSION STREQUAL "0.0.0")
21
+ get_filename_component(SOURCE_DIR_NAME ${CMAKE_SOURCE_DIR} NAME)
22
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" EXTRACTED_VERSION ${SOURCE_DIR_NAME})
23
+ if(EXTRACTED_VERSION)
24
+ set(PROJECT_VERSION ${EXTRACTED_VERSION})
25
+ endif()
20
26
  endif()
21
27
 
22
28
  project(cursor VERSION ${PROJECT_VERSION} LANGUAGES CXX)
@@ -317,43 +323,38 @@ if(NOT CPR_FOUND)
317
323
  message(FATAL_ERROR "Failed to find or build CPR. Please install it manually or check your network connection.")
318
324
  endif()
319
325
  endif()
320
- # Enable testing
321
- enable_testing()
326
+ option(CURSOR_BUILD_TESTS "Build tests" ON)
322
327
 
323
- # Fetch Google Test
324
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
328
+ if(CURSOR_BUILD_TESTS)
329
+ enable_testing()
325
330
 
326
- # Only fetch and build gtest if not already found
327
- if(NOT TARGET gtest)
328
- message(STATUS "Downloading and building Google Test...")
329
- FetchContent_Declare(
330
- googletest
331
- GIT_REPOSITORY https://github.com/google/googletest.git
332
- GIT_TAG v1.14.0
333
- GIT_SHALLOW TRUE
334
- )
331
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
335
332
 
336
- # For Windows: Prevent overriding the parent project's compiler/linker settings
337
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
338
-
339
- # Build static libraries to avoid runtime dependencies
340
- set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
333
+ if(NOT TARGET gtest)
334
+ message(STATUS "Downloading and building Google Test...")
335
+ FetchContent_Declare(
336
+ googletest
337
+ GIT_REPOSITORY https://github.com/google/googletest.git
338
+ GIT_TAG v1.14.0
339
+ GIT_SHALLOW TRUE
340
+ )
341
341
 
342
- # Make sure we're not overriding compiler flags
343
- set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
344
- set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
345
- set(BUILD_GTEST ON CACHE BOOL "" FORCE)
342
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
343
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
344
+ set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
345
+ set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
346
+ set(BUILD_GTEST ON CACHE BOOL "" FORCE)
346
347
 
347
- FetchContent_MakeAvailable(googletest)
348
+ FetchContent_MakeAvailable(googletest)
348
349
 
349
- # Create an interface library for gtest to make it easier to link
350
- if(NOT TARGET gtest_all_tests)
351
- add_library(gtest_all_tests INTERFACE)
352
- target_link_libraries(gtest_all_tests
353
- INTERFACE
354
- GTest::GTest
355
- GTest::Main
356
- )
350
+ if(NOT TARGET gtest_all_tests)
351
+ add_library(gtest_all_tests INTERFACE)
352
+ target_link_libraries(gtest_all_tests
353
+ INTERFACE
354
+ GTest::GTest
355
+ GTest::Main
356
+ )
357
+ endif()
357
358
  endif()
358
359
  endif()
359
360
 
@@ -517,26 +518,26 @@ target_link_libraries(cursor-agent PRIVATE
517
518
  cursor_lib
518
519
  )
519
520
 
520
- # Test executable
521
- add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
522
- target_include_directories(cursor-tests PRIVATE
523
- ${CMAKE_CURRENT_SOURCE_DIR}/include
524
- ${CMAKE_CURRENT_BINARY_DIR}/include
525
- )
526
- target_link_libraries(cursor-tests PRIVATE
527
- cursor_lib
528
- gtest_main
529
- gtest
530
- )
531
- add_test(NAME basic_tests COMMAND cursor-tests)
521
+ if(CURSOR_BUILD_TESTS)
522
+ add_executable(cursor-tests tests/main_test.cpp src/utils/version.cpp)
523
+ target_include_directories(cursor-tests PRIVATE
524
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
525
+ ${CMAKE_CURRENT_BINARY_DIR}/include
526
+ )
527
+ target_link_libraries(cursor-tests PRIVATE
528
+ cursor_lib
529
+ gtest_main
530
+ gtest
531
+ )
532
+ add_test(NAME basic_tests COMMAND cursor-tests)
532
533
 
533
- # Set target properties for test executable
534
- set_target_properties(cursor-tests PROPERTIES
535
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
536
- MACOSX_RPATH ON
537
- INSTALL_RPATH "@executable_path/lib"
538
- BUILD_WITH_INSTALL_RPATH TRUE
539
- )
534
+ set_target_properties(cursor-tests PROPERTIES
535
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
536
+ MACOSX_RPATH ON
537
+ INSTALL_RPATH "@executable_path/lib"
538
+ BUILD_WITH_INSTALL_RPATH TRUE
539
+ )
540
+ endif()
540
541
 
541
542
  # Set target properties
542
543
  set_target_properties(cursor-agent PROPERTIES
@@ -626,7 +627,7 @@ add_custom_target(test-quick
626
627
  # Code coverage target (requires lcov)
627
628
  find_program(LCOV_EXE lcov)
628
629
  find_program(GENHTML_EXE genhtml)
629
- if(LCOV_EXE)
630
+ if(LCOV_EXE AND CURSOR_BUILD_TESTS)
630
631
  add_custom_target(coverage
631
632
  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
632
633
  COMMAND ctest --output-on-failure
package/Formula/cursor.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  class Cursor < Formula
2
2
  desc "Professional AI agent with command execution and file operations"
3
3
  homepage "https://github.com/bniladridas/cursor"
4
- url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.7.tar.gz"
5
- sha256 "3bd73b2bde8ae719f84e0027b4e01588e6cdc786556a68c5db9aaaf9a8a9dfe1"
4
+ url "https://github.com/bniladridas/cursor/archive/refs/tags/v0.1.9.tar.gz"
5
+ sha256 "f5e1f0380c218a528ad3de6a3239f0cd5a8ba6356849a68348c8b61d2e8e2e0e"
6
6
  license "Apache-2.0"
7
7
 
8
8
  depends_on "cmake" => :build
@@ -10,29 +10,28 @@ class Cursor < Formula
10
10
  depends_on "nlohmann-json"
11
11
 
12
12
  def install
13
- system "cmake", "-S", ".", "-B", "build", *std_cmake_args
13
+ system "cmake", "-S", ".", "-B", "build", "-DCURSOR_BUILD_TESTS=OFF", *std_cmake_args
14
14
  system "cmake", "--build", "build"
15
- bin.install "build/bin/cursor-agent" => "cursor"
15
+ bin.install "build/bin/cursor-agent"
16
16
 
17
- # Install configuration template
18
- (etc/"cursor").install ".env.example" => "config.env"
17
+ (etc/"cursor-agent").install ".env.example" => "config.env"
19
18
  end
20
19
 
21
20
  def post_install
22
- (var/"cursor").mkpath
23
- unless (etc/"cursor/.env").exist?
24
- cp etc/"cursor/config.env", etc/"cursor/.env"
21
+ (var/"cursor-agent").mkpath
22
+ unless (etc/"cursor-agent/.env").exist?
23
+ cp etc/"cursor-agent/config.env", etc/"cursor-agent/.env"
25
24
  end
26
25
  end
27
26
 
28
27
  test do
29
- system "#{bin}/cursor", "--version"
28
+ system "#{bin}/cursor-agent", "--version"
30
29
  end
31
30
 
32
31
  def caveats
33
32
  <<~EOS
34
33
  Configuration file is located at:
35
- #{etc}/cursor/.env
34
+ #{etc}/cursor-agent/.env
36
35
 
37
36
  Edit this file with your API keys:
38
37
  - TOGETHER_API_KEY (for online mode)
@@ -40,7 +39,7 @@ class Cursor < Formula
40
39
  - SERPAPI_KEY (for web search)
41
40
 
42
41
  Data directory:
43
- #{var}/cursor/
42
+ #{var}/cursor-agent/
44
43
  EOS
45
44
  end
46
45
  end
package/README.md CHANGED
@@ -1,46 +1,33 @@
1
1
  # Cursor
2
2
 
3
- Cursor is a terminal-based agent for macOS, Linux, and containerized environments.
3
+ [![CI](https://github.com/bniladridas/cursor/actions/workflows/ci.yml/badge.svg)](https://github.com/bniladridas/cursor/actions/workflows/ci.yml)
4
+ [![Release](https://github.com/bniladridas/cursor/actions/workflows/release.yml/badge.svg)](https://github.com/bniladridas/cursor/actions/workflows/release.yml)
5
+ [![npm](https://img.shields.io/npm/v/@bniladridas/cursor)](https://www.npmjs.com/package/@bniladridas/cursor)
6
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)
4
7
 
5
- It works with codebases, files, commands, and repositories through a CLI interface.
8
+ Cursor is a cross-platform AI coding agent that works with codebases, files, commands, and repositories through a CLI interface.
6
9
 
7
- Homebrew:
10
+ ## Install
8
11
 
12
+ **npm** (binary: `cursor`):
9
13
  ```bash
10
- brew install cursor
14
+ npm i -g @bniladridas/cursor
11
15
  ```
12
16
 
13
- npm:
14
-
17
+ **Homebrew** (binary: `cursor-agent`):
15
18
  ```bash
16
- npm i -g @bniladridas/cursor
19
+ brew tap bniladridas/cursor https://github.com/bniladridas/cursor
20
+ brew install cursor
17
21
  ```
18
22
 
19
- Build from source:
20
-
23
+ **From source** (binary: `cursor`):
21
24
  ```bash
22
- cmake -S . -B build
23
- cmake --build build
24
- ./build/cursor-tests
25
+ cmake -S . -B build && cmake --build build
26
+ ./build/cursor-tests # run tests
25
27
  ```
26
28
 
27
- The project is written in C++20 and uses CMake for building and testing.
28
-
29
- Source layout:
30
-
31
- ```text
32
- src/
33
- agent.cpp
34
- memory_manager.cpp
35
- services/
36
- utils/
37
-
38
- include/
39
- agent.h
40
- services/
41
- utils/
42
- ```
29
+ ## Platforms
43
30
 
44
- License: Apache 2.0
31
+ Pre-built binaries for Linux (amd64), macOS (arm64), and Windows (amd64) are available on the [releases page](https://github.com/bniladridas/cursor/releases).
45
32
 
46
- ![Cursor](.github/packaging/brand-cursor.png)
33
+ [![Cursor](.github/packaging/brand-cursor.png)](https://github.com/bniladridas/cursor/releases)
package/install.js CHANGED
@@ -7,10 +7,11 @@ const pkg = require('./package.json');
7
7
  const version = pkg.version;
8
8
  const binaryDir = path.join(__dirname, 'binary');
9
9
 
10
+ const arch = process.arch === 'x64' ? 'amd64' : process.arch;
10
11
  const platformMap = {
11
- darwin: 'cursor-macos.tar.gz',
12
- linux: 'cursor-linux.tar.gz',
13
- win32: 'cursor-windows.zip',
12
+ darwin: `cursor_v${version}_darwin_arm64.tar.gz`,
13
+ linux: `cursor_v${version}_linux_amd64.tar.gz`,
14
+ win32: `cursor_v${version}_windows_amd64.zip`,
14
15
  };
15
16
 
16
17
  const archive = platformMap[process.platform];
@@ -26,24 +27,31 @@ fs.mkdirSync(binaryDir, { recursive: true });
26
27
  console.log(`downloading cursor v${version}...`);
27
28
 
28
29
  const file = fs.createWriteStream(path.join(binaryDir, archive));
29
- https.get(url, (res) => {
30
- if (res.statusCode !== 200) {
31
- console.error(`download failed (${res.statusCode}): ${url}`);
32
- process.exit(1);
33
- }
34
- res.pipe(file);
35
- file.on('finish', () => {
36
- file.close();
37
- console.log('extracting...');
38
- if (process.platform === 'win32') {
39
- execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
40
- } else {
41
- execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
30
+ function download(url) {
31
+ https.get(url, (res) => {
32
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
33
+ download(res.headers.location);
34
+ return;
35
+ }
36
+ if (res.statusCode !== 200) {
37
+ console.error(`download failed (${res.statusCode}): ${url}`);
38
+ process.exit(1);
42
39
  }
43
- fs.unlinkSync(path.join(binaryDir, archive));
44
- console.log('done');
40
+ res.pipe(file);
41
+ file.on('finish', () => {
42
+ file.close();
43
+ console.log('extracting...');
44
+ if (process.platform === 'win32') {
45
+ execSync(`tar -xf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
46
+ } else {
47
+ execSync(`tar -xzf "${path.join(binaryDir, archive)}" -C "${binaryDir}"`, { stdio: 'inherit' });
48
+ }
49
+ fs.unlinkSync(path.join(binaryDir, archive));
50
+ console.log('done');
51
+ });
52
+ }).on('error', (err) => {
53
+ console.error(`download failed: ${err.message}`);
54
+ process.exit(1);
45
55
  });
46
- }).on('error', (err) => {
47
- console.error(`download failed: ${err.message}`);
48
- process.exit(1);
49
- });
56
+ }
57
+ download(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bniladridas/cursor",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Cross-platform AI coding agent",
5
5
  "bin": {
6
6
  "cursor": "cli.js"
@@ -1,3 +1,3 @@
1
- cfc6263cc63d3a900e0dd1df6c5a10e73e0b1efa151ac709d6411c8174e1b81b release/cursor-macos/cursor_v0.1.7_darwin_arm64.tar.gz
2
- ad1b59a23a845cc9b95352176caa10601a667dc823d16571d8eceb69bbde236b release/cursor-linux/cursor_v0.1.7_linux_amd64.tar.gz
3
- 2dd5225fd8fa6fd53314af61239a88902dcc337040784f30995758c2b931c369 release/cursor-windows/cursor__windows_amd64.zip
1
+ dae4ec4d23edaaddb6470b13977fb7776d2169c78925a62931d781bdae45738a release/cursor-macos/cursor_v0.1.9_darwin_arm64.tar.gz
2
+ 108f843a6dbe1aa8b8a9bf68e35359f258df39921d93a9919192ff734837bc50 release/cursor-linux/cursor_v0.1.9_linux_amd64.tar.gz
3
+ e3ee1d44f26cb7e1ee103de0fd69139a68d7e6875dc22854ce6893b838b3ffc6 release/cursor-windows/cursor__windows_amd64.zip