You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

0 Días
15 Hrs
13 Min
3 Seg
Curso de tips y trucos de IA

Curso de tips y trucos de IA

Amazon Web Services (AWS)

Amazon Web Services (AWS)

Tutorial de Cursor, editor de código con AI

3/4
Resources

AI-assisted programming is revolutionizing the way we develop software. Cursor is positioned as one of the most powerful code editors on the market, combining the familiarity of Visual Studio Code with advanced artificial intelligence capabilities. In this article, we will explore how to use Cursor to create a complete project from scratch, taking full advantage of its code generation and development assistance features.

What is Cursor and why should you use it?

Cursor is a text editor based on Visual Studio Code that integrates artificial intelligence in all its functionalities. Unlike other editors, Cursor not only allows you to write code, but actively assists you in the development process through:

  • Code generation from natural language instructions.
  • Error resolution and assisted debugging
  • Indexing external documentation to improve context
  • Ability to understand and process images such as diagrams or schematics

It is important to note that to get the most out of Cursor, you still need fundamental software engineering skills. The tool enhances your capabilities, but it does not replace the need to understand basic programming concepts.

How to create a project from scratch with Cursor?

To demonstrate Cursor's capabilities, let's create an API project with FastAPI and Python. The interesting thing is that most of the code will be generated by the AI built into the editor.

Initial project setup

The first thing we need to do is open the Cursor chat with the keyboard shortcut Command + L on Mac (or Control + L on Windows). This allows us to interact with the AI through a conversational interface.

For this project, we will select the Claude 3.7 model, which has been shown to generate better code according to benchmarks. Then, we can start with a simple prompt:

I want to create a project with Python in which an API is created with FastAPI. Create the main skeleton of the application and generate the necessary commands to be able to create a Python project. Use UV to create the project.

The AI will provide us step by step with the necessary commands to:

  1. Create the folder structure
  2. Install the necessary dependencies
  3. Set up the basic project files

A key advantage of Cursor is that we can directly execute the suggested commands from the interface, greatly simplifying the setup process.

How to take advantage of Cursor's multimodal capabilities?

One of the most powerful features of Cursor is its ability to process different types of input, including images. This is extremely useful when working with architectural diagrams or schematics.

Generating code from diagrams

Let's imagine we have a simple diagram of a "Dish" entity with three attributes: ID (integer), name (string) and price (float). We can export this diagram as an image and ask Cursor to generate the corresponding code:

Generate a Pydantic model that complies with what you have in the image.

The AI will recognize the structure of the diagram and generate the appropriate code:

from pydantic import BaseModelfrom typing import Optional
class Plato(BaseModel): id: int name: str price: float.

Then we can ask you to place this code in a specific file:

I need what you just generated to be inside a file named schemas.py.

And Cursor will take care of creating the file and placing the generated code in it.

Indexing external documentation

A particularly useful feature of Cursor is its ability to index external documentation. This allows the AI to have a more complete context about the technologies we are using.

To index FastAPI documentation, we simply:

  1. Copy the URL of the documentation (fastapi.tiangolo.com).
  2. Open the Cursor configuration
  3. Go to the "Documents" section
  4. Add the documentation URL

Once indexed, we can reference this documentation in our prompts:

In the main file, generate the endpoints needed to make a CRUD of the Plato schema. Use the information you know from FastAPI.

The AI will use the indexed documentation to generate high quality code following FastAPI best practices.

How to set rules to maintain code consistency?

Cursor allows you to define rules for the AI to follow when generating code, which is extremely useful for maintaining consistency and following your team's standards.

Cursor rule files

We can create files with a .cursor-rules extension that define the global rules for our project:

Every function should have a docstring that explains what the function is for.The documentation should be in English.

Context-specific rules

For more specific rules, we can create a .cursor/rules/ folder structure with MDX files defining rules for particular contexts:

// .cursor/rules/functions.mdxThis file is useful for when you have to generate docstrings on functions---extensions: [".py"]---Make the documentation in English, and for each function generate docstrings.

The Cursor community has also created a repository of predefined rules in cursor.directory, where we can find and generate rules for different technologies and scenarios.

How to integrate Cursor with the Git workflow?

Cursor also facilitates integration with Git, allowing us to generate commit messages based on the changes made. Simply put:

  1. We stage the changes.
  2. We ask Cursor to generate a commit message
  3. We commit and push to the repository.

This streamlines the process of documenting changes and keeps a clear history of the changes made.

The combination of all these features makes Cursor an extremely powerful tool for modern software development, allowing us to focus on the business logic while the AI takes care of the more repetitive and mechanical tasks.

Have you tried Cursor or other AI-assisted programming tools? Share your experience and tell us how these technologies are transforming the way you program.

Contributions 17

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?

Una clase realmente interesante, aquí te confirmas que la IA no te va a reemplazar, lo que te reemplazará será alguien que sepa usarla. Los fundamentos son clave, tener criterio para aceptar o rechazar las soluciones de la IA, tener criterio para plantear la necesidad, para iterar la solución, aquí está la clave. Mientras veía la clase me preguntaba, ¿Hasta donde podría llegar con este mismo proyecto usando VSCode y GitHub Copilot? 🤔 Pero creo que tan solo con el uso multimodal para convertir una imagen en un CRUD, la inclusión de documentación completa del frameworks desde su origen y las Cursor Rules, con esto Cursor supera las expectativas. Gracias Platzi porque nunca paro de aprender 💚🚀
La inteligencia Artificial no nos reemplazará si seguimos pensando. Vital siempre aplicar pensamiento crítico en cada actividad, no solo con la IA, sino en nuestra cotidianidad. Creo que ese es uno de los mayores desafíos de la humanidad, de cara a todos los cambios que se están suscitando y que, de no ser bien manejados, tendrían repercusiones no tan positivas a todos los niveles. No se trata solo de delegar todo a la inteligencia artificial por la ventaja de lo expedito y eficiente, sino también que seamos "Supervisores" de su trabajo, creando una simbiosis que nos permita avanzar con ella sin perder nuestras capacidades humanas esenciales: la empatía, la intuición y la ética. Solo así podremos lograr una verdadera colaboración con la inteligencia artificial, una en la que no seamos simples usuarios pasivos, sino aliados conscientes y responsables en la construcción de un futuro más justo, equilibrado y realmente inteligente.
No encuentro el curso actualizado de fundamentos de ingeniería de software
Sinceramente no me lo esperaba. Es muy bueno, apenas llevo 30 minutos probando la herramienta pero wow !!! 100%
cursor es una herramienta genial , esta clase muestra lo e estado pensado la AI es una herramienta como lo es la mezcladora en la construcion te permite hacer tareas antes era dificiles o mas que todo tediosas en menor tiempo
Esta Clase esta en Youtube, fue de hace algunas semanas 2025 (Febrero, Marzo)
Muy bueno
Una forma que tengo de ver a las IAs es como si fueran maquinarias virtuales En la vida real, cuando logramos construir maquinarias, estas no extinguieron trabajadores en la agricultura o en la construcción Lo mismo: a nivel virtual las IAs son como maquinarias enormes, que necesitan alguien que las maneje Esta precioso cursor, aunque me da la impresión de ser un mod de VS Code, un mod demasiado bueno
Gracias
Gracias por compartir este valioso conocimiento.
esa clase es oro puro, son superpoderes para los que ya tenemos conocimientos avanzados, los que están iniciando les recomiendo primero fundamentos de ingeniería de software, la parte de la documentación es impresionante, me dieron muchas ideas para crear proyectos interesantes usando los agentes.
Excalidraw: <https://excalidraw.com/>
**Cursor: editor con inteligencia artificial** Se recomienda Cursor por su integración total con AI, ideal para generar y editar código de forma inteligente. **Conocimientos básicos son clave** Aunque Cursor automatiza tareas, es esencial entender fundamentos de programación y depuración para usarlo bien. **Creación y gestión de proyectos con AI** Permite crear APIs con FastAPI desde lenguaje natural, editar, depurar, ejecutar código y resolver errores automáticamente. **Modelado desde imágenes y generación de CRUD** Interpreta imágenes para crear modelos de datos y genera CRUDs completos usando documentación indexada. **Automatización de estilo y control de versiones** Con reglas personalizadas y soporte para Git, garantiza buenas prácticas y facilita la colaboración. **Resumen** Cursor potencia el desarrollo con AI, automatiza tareas complejas y mejora la productividad manteniendo calidad.
Excelente clase! me gusta mucho este formato.
Excelente la clase y super útil. Probé Cursor por primera vez para mejorar el código de una aplicación en Python, me sorprendió el resultado, resolvió muy bien las solicitudes y el ahorro de tiempo es impresionante. Ahora a probar y depurar el código 🧑🏻‍💻
Usene de botón de, estamos perdidos y la IA nos va a reemplazar :O
Lo estoy probando y me pierdo un poco con el IDE, supongo que sera la constumbre. El tema que es pago, te da la versión por default. Yo quisiera dejarlo en modo free, para ver las limitaciones que tiene, pero no puedo. Voy a tener que esperar 14 dias para saber.