Basic Usage
This guide introduces common use cases for Carry Code to help you get started quickly.
Scenario 1: Let AI Write Code
Section titled “Scenario 1: Let AI Write Code”When you need to complete a programming task, just tell AI what you want.
Example
Section titled “Example”Write a script to batch rename files, replacing spaces with underscoresAI will:
- Analyze your requirements
- Write complete code
- Explain how the code works
- Ask if you want to execute
More Examples
Section titled “More Examples”| Requirement | Conversation |
|---|---|
| Write an API | Write a simple REST API with Express.js, including user registration and login |
| Write a scraper | Write a Python script to crawl images from a webpage and save them locally |
| Write a utility script | Write a Shell script to batch compress all PDF files in the current directory |
Scenario 2: Let AI Find Bugs
Section titled “Scenario 2: Let AI Find Bugs”When you encounter errors, send the code and error message to AI.
Example
Section titled “Example”This code has an error, help me find the problem:
def calculate(a, b): return a / b
print(calculate(10, 0))AI will:
- Analyze the error (division by zero)
- Provide a fix
- Explain the changes
Better Ways to Ask
Section titled “Better Ways to Ask”My code has an error. The error message is:[paste error message]
The code is:[paste code]
Please help me find and fix the problem.Scenario 3: Let AI Explain Code
Section titled “Scenario 3: Let AI Explain Code”Don’t understand some code? Just send it to AI for explanation.
Example
Section titled “Example”Explain what this code does:
const result = arr.filter(x => x > 0).map(x => x * 2).reduce((a, b) => a + b, 0);AI will:
- Explain the code logic line by line
- Provide execution flow diagrams if helpful
- Offer simplified versions if available
More Scenarios
Section titled “More Scenarios”| Scenario | Conversation |
|---|---|
| Understand open source | Help me analyze the main structure of this project |
| Learn new syntax | What’s the difference between TypeScript’s type and interface? |
| Understand algorithms | Explain how this sorting algorithm works |
Scenario 4: Let AI Refactor Code
Section titled “Scenario 4: Let AI Refactor Code”Code works but is messy? Let AI help you optimize.
Example
Section titled “Example”This code works but feels messy, can you help me optimize it?
[paste your code]AI will:
- Analyze code issues
- Provide an optimized version
- Explain what improvements were made
Common Refactoring Needs
Section titled “Common Refactoring Needs”| Requirement | Conversation |
|---|---|
| Improve performance | This code is too slow, help me optimize |
| Improve readability | This code is hard to understand, please refactor for clarity |
| Add error handling | Help me add error handling to this function |
Scenario 5: Let AI Write Tests
Section titled “Scenario 5: Let AI Write Tests”Don’t want to write tests manually? Let AI help.
Example
Section titled “Example”Write unit tests for this function:
function sum(a, b) { return a + b;}AI will generate complete test cases including normal and edge cases.
Better Ways to Ask
Section titled “Better Ways to Ask”Write Jest tests for this function, covering:1. Normal addition2. Negative numbers3. Decimal numbers
[paste function code]Scenario 6: Let AI Write Documentation
Section titled “Scenario 6: Let AI Write Documentation”Need documentation for your project? Let AI generate it.
Example
Section titled “Example”Write a README.md for this projectAI will analyze the project structure and generate a README with:
- Project description
- Installation instructions
- Usage instructions
- API documentation (if applicable)
Partial Documentation
Section titled “Partial Documentation”Add JSDoc comments to this function:
function calculate(a, b) { return a + b;}Scenario 7: Let AI Analyze Projects
Section titled “Scenario 7: Let AI Analyze Projects”Want to understand an unfamiliar project? Let AI analyze it.
Example
Section titled “Example”Analyze the structure of this projectAI will:
- List the project directory structure
- Explain main files and their purposes
- Describe the tech stack
More Specific Analysis
Section titled “More Specific Analysis”| Requirement | Conversation |
|---|---|
| Analyze dependencies | What dependencies does this project use? |
| Find code | Where is the user login code? |
| Analyze architecture | How is this project organized? |
Scenario 8: Execute Shell Commands
Section titled “Scenario 8: Execute Shell Commands”Carry Code can help you execute terminal commands.
Example
Section titled “Example”Run `npm install` to install dependenciesOr:
List files in the current directory- AI will ask for confirmation before executing
- Dangerous commands (like deleting files) require extra confirmation
- You can adjust permission levels using the
/approvalcommand
Common Keyboard Shortcuts
Section titled “Common Keyboard Shortcuts”| Shortcut | Action |
|---|---|
Enter | Send message |
Shift + Enter | New line (multi-line input) |
Shift + Tab | Switch Build/Plan mode |
↑ / ↓ | Browse message history |
Ctrl + C | Interrupt AI response |
Ctrl + D | Exit the program |
Next Steps
Section titled “Next Steps”- Dual Mode - Learn more about Build and Plan modes
- Session Management - Manage your conversation sessions
- AI Model Configuration - Add more AI models