Basic to Advanced Cody AI Workshop Content
You can install VS Code directly from the VS Code extension marketplace listing or by following these steps directly within VS Code:
- Open VS Code editor on your local machine
- Click the Extensions icon in the Activity Bar on the side of VS Code, or use the keyboard shortcut Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows/Linux)
- Type Cody AI in the search bar and click the Install button
- After installing, you may be prompted to reload VS Code to activate the extension
- Install mise tool manager following instructions at mise.jdx.dev
- Clone this repository and navigate to the project directory
- Run
mise install
to automatically install Python and uv package manager - Run
uv pip install -e ".[dev]"
to install the project and development dependencies
- Install Python 3.8 or newer
- Clone this repository and navigate to the project directory
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
- Install dependencies:
pip install -e ".[dev]"
This workshop is designed to provide hands-on training for engineers on using Cody, Sourcegraph's AI coding assistant. The session progresses from basic concepts to advanced techniques, ensuring participants leave with practical experience they can immediately apply to their daily work.
The repository contains progressive exercises in the following categories:
-
Beginner Exercises
- Basic prompt formulation
- Code explanation
- Simple code generation
- Documentation assistance
-
Intermediate Exercises
- Debugging workflows
- Test generation
- Code refactoring
-
Advanced Exercises
- Code refactoring - pt 2
- Security vulnerability detection
- Performance optimization suggestions
├── 1_beginner
│ ├── exercise_1_code_explanation
│ │ ├── README.md
│ │ └── sample_code.py
│ ├── exercise_2_documentation
│ │ ├── README.md
│ │ └── undocumented_code.py
│ └── exercise_3_simple_generation
│ ├── generate_function.py
│ └── README.md
├── 2_intermediate
│ ├── exercise_1_debugging
│ │ ├── buggy_code.py
│ │ └── README.md
│ ├── exercise_2_test_generation
│ │ ├── code_to_test.py
│ │ └── README.md
│ └── exercise_3_refactoring
│ ├── README.md
│ └── refactor_me.py
├── 3_advanced
│ ├── exercise_1_complex_refactoring
│ │ ├── complex_app.py
│ │ └── README.md
│ ├── exercise_2_security_review
│ │ ├── README.md
│ │ ├── security_review.py
│ │ ├── setup_users_db.py
│ │ └── users.db
│ └── exercise_3_performance
│ ├── optimise_me.py
│ └── README.md