All Products
Search
Document Center

Object Storage Service:Use the OSS documentation in Cursor

Last Updated:Aug 12, 2025

Set the OSS documentation as an AI knowledge source in Cursor. The Cursor Agent can then use the latest official documentation to automatically generate standard SDK call code and ossutil usage examples. It can also fix API call issues and provide accurate configuration recommendations.

Configure the Cursor documentation data source

You can configure Cursor's @Docs data source to easily provide this document to Cursor.

Steps:

  1. Open Cursor settings

    • In the menu bar, click Cursor > Settings.

  2. Navigate to the Docs configuration

    • In the navigation pane on the left, click Indexing & Docs.

    • The document configuration page opens.

  3. Add the OSS documentation source

    • Click Add Docs.image

    • Enter the URL for the official OSS documentation: https://www.alibabacloud.com/help/en/oss/. Enter a name that is easy to recognize, such as "Aliyun OSS Docs".image

    • Confirm that the documentation source is added to the list and that its status is Indexed.image

Use the OSS documentation for Q&A

After you complete the configuration, you can query the OSS documentation data source in Cursor.

Method:

  1. Use @Docs in the chat window

    • Open the Cursor AI chat window.

    • Enter @Aliyun OSS Docs followed by your question.

    • For example: @Aliyun OSS Docs How do I use the OSS Java SDK to create a client and configure access credentials?image

  2. Obtain precise answers

    • The AI provides accurate answers based on the OSS documentation. These answers include code examples, configuration steps, and other details.image

  3. Optimize query results

    • Be specific: Avoid broad questions. Ask about a specific feature or scenario.

    • Include keywords: Include OSS-related keywords in your question, such as "bucket", "object", and "permission".

    • Ask in steps: For complex operations, ask questions in multiple steps.

      # Good query examples
      @Docs How do I use the Java SDK to upload a file to OSS?
      @Docs How do I configure cross-origin resource sharing (CORS) for OSS?
      @Docs How do I set permissions using a Resource Access Management (RAM) policy in OSS?
      @Docs I need to upload a file to OSS in my Node.js project. Provide a complete code example.
      @Docs Provide best practices for multipart uploads of large files to OSS.
      @Docs Provide detailed troubleshooting steps for OSS CDN cache configuration issues.
      
      # Queries to avoid
      @Docs How do I use OSS? (Too broad)
      @Docs Upload file (Lacks context)

Use the OSS documentation to resolve errors

  1. If you encounter an error when you use the Alibaba Cloud OSS SDK to upload or download files, or perform other operations, you can use the documentation data source to automatically fix the error.

    image

  2. Open the Cursor Agent chat window. Enter `@Aliyun OSS Docs` followed by a description of your specific problem. The AI uses the latest official OSS documentation to provide a precise troubleshooting procedure and solution, which helps you optimize your code and resolve the error.imageimageimage

Use the OSS documentation to generate ossutil commands

You can use Cursor's AI capabilities to describe an operation in natural language. Using the official OSS documentation as a data source, Cursor automatically generates and runs command-line operations for tasks such as uploads, downloads, and canonical name (CNAME) configurations. The AI references the documentation and your current file directory to generate commands that you can run directly.

Method:

  1. Use @Docs in the chat window

    • Open the Cursor AI chat window. Enter @Aliyun OSS Docs followed by a description of the operation.

    • For example: @Aliyun OSS Docs Use ossutil to upload the cname-configuration.xml file to the bucket named examplebucketimage

  • Generate and run the command based on the documentation

    • The AI analyzes whether the cname-configuration.xml file exists in the current directory.

      image

    • Then, based on the key elements in your description, such as "upload", the filename, and the bucket name, the AI generates the corresponding ossutil command from the official OSS documentation. If you have configured your access credentials, Cursor can also run the command for you.

      image