Skip to content

Instantly share code, notes, and snippets.

@helloworld
Created November 6, 2024 02:57
Show Gist options
  • Save helloworld/afc94a70c5531b54fa02f9931a38cf84 to your computer and use it in GitHub Desktop.
Save helloworld/afc94a70c5531b54fa02f9931a38cf84 to your computer and use it in GitHub Desktop.

Welcome to Exponent, your AI pair programmer!

IF YOU RECEIVED AN INVITATION EMAIL: follow the instructions in the invitiation to sign in, then begin at step 3.

  1. Navigate to https://exponent.run in your browser and click "Sign in" in the top right.
Screenshot 2024-11-05 at 11 08 13 AM
  1. Sign in using your Microsoft or Google account.
  2. Once you are logged in, click through the product description screens. You do not need to install the desktop app yet.
  3. When you reach this screen in Exponent, go to the installation instructions HERE and follow them for your OS/environment.
    1. NOTE that on MacOS, if you are installing Python for the first time, you may need to use python3 and pip3 everywhere instead of python and pip, respectively, when running commands

Screenshot%202024-11-05%20at%2011 17 10%E2%80%AFAM

  1. Log in to Exponent from your shell by running exponent login --key <api-key>. If this is your first time logging in, this command should be visible on your screen in Exponent like so:

Screenshot%202024-11-05%20at%2011 15 42%E2%80%AFAM

  1. Now cd my-project [very important!] in your terminal to navigate to the first project you'd like to try using Exponent with, and run exponent run. Full instructions for starting a chat can be found at https://docs.exponent.run/usage/exponent-web. Exponent should open and you should see the Connected status in the middle of the screen.
Screenshot 2024-11-05 at 11 24 02 AM
  1. Now let's make sure the connection is working with List all of the files example message in the bottom left of the screen:
Screenshot 2024-11-05 at 12 09 21 PM
  1. When Exponent responds, it will offer a command to run on your machine. This is the start of what makes Exponent special: it's able to run commands and edit files on your behalf. No copy-pasting or context switching required. You can accept the command by clicking the button or using the keyboard shortcut.
Screenshot 2024-11-05 at 12 09 54 PM
  1. Now let's try creating a new file edit command. Send a message to Exponent saying something like "Create a new markdown file with a poem about cardboard boxes". Once it completes, you can navigate to this folder on your computer through Finder or your text editor like VSCode, and you should see that new file! You can then tell Exponent "delete that file" to clear it.

  2. You're ready to start exploring! Running commands and editing files are the core actions that Exponent can take for you, and they can be combined in very expressive ways. The best advice I can give you now is to have fun. Be silly and playful. Ask Exponent to rename your variables to all rhyme, or to act like a grumpy senior developer and review the last commit in the repository. This is the best way to build your skill at using AI to code.

  3. It's a good idea to read through the documentation (won't take long) to learn about the other features in Exponent: https://docs.exponent.run/home. File referencing is one that you will find yourself using a lot: https://docs.exponent.run/usage/exponent-web#referencing-files

  4. Please reach out to [email protected] or join the Discord (https://discord.gg/exponent) if you have any questions or run into any issues!

  5. Here is a brief list of things you might like to try with Exponent. If you don't know what to ask, pick one of these that seems interesting!

Category Task Example Prompt
Code Analysis Dependency audit "Find an unused dependencies in this project"
Code duplication check "Find duplicate code blocks in this codebase"
Security scan "Check my code for hardcoded secrets or API keys"
Complexity analysis "Find the most complex functions in my codebase (highest cyclomatic complexity)"
Refactoring Pattern implementation "Convert this class to use the Builder pattern"
Modern syntax update "Update this JavaScript code to use modern ES6+ features"
Test coverage "Generate unit tests for all public methods in this class"
Documentation "Add docstring comments to all functions in this file"
Code organization "Split this large module into smaller, logical components"
Build & Deploy CI/CD setup "Create a GitHub Actions workflow for running tests and linting"
Build optimization "Analyze and optimize my webpack build configuration"
Release automation "Create a script to automate version bumping and changelog generation"
Data Processing Log analysis "Parse my nginx logs and show me the top 10 IP addresses making requests"
Data transformation "Convert this CSV data into a normalized SQLite database"
Format conversion "Transform this XML API response into a JSON structure"
Data validation "Check this dataset for inconsistencies and missing values"
API Development Endpoint creation "Create an API endpoint for a healthcheck, with tests"
API documentation "Generate OpenAPI/Swagger documentation for existing endpoints"
Integration tests "Write integration tests for this API endpoint"
Rate limiting "Implement rate limiting for my API endpoints"
Performance Load testing "Create a script to load test my API with 1000 concurrent users"
Memory profiling "Find memory leaks in this application"
Query optimization "Analyze and optimize slow SQL queries in my application"
Asset optimization "Optimize all images in my project directory"
Development Workflow Custom CLI "Look at all of the git commands I've run and create aliases for the most common ones"
Development tools "Write an alias to autogenerate git commit messages"
System Admin Monitoring "Create a script that alerts me when CPU usage exceeds 80%"
Log rotation "Implement log rotation for all my application logs"
Security audit "Check my system for files with unsafe permissions"
Resource tracking "Track and report on disk space usage trends"
Database Schema migration "Generate a migration script to add new columns to these tables"
Data seeding "Create realistic test data for my development database"
Query generation "Generate optimized SQL queries for these complex reports"
Index optimization "Analyze and suggest indexes for improving query performance"
Git Operations Branch cleanup "Find and delete all local branches that have been merged into main"
Git history analysis "Show me which files changed the most in the last month"
Commit message fixes "Update all commit messages containing 'WIP' to include a proper description"
Feature branch creation "Create a new branch from main, push it, and set up tracking for feature/user-auth"
Git stats visualization "Generate a graph showing commit frequency by day of week for the last year"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment