Common workflows
Each task in this document includes clear instructions, example commands, and best practices to help you get the most from Command Code.
You can quickly get a high-level overview of a codebase by navigating to the project root directory and starting Command Code.
Navigate to the project root directory
Navigate to project
cd /path/to/project
Start Command Code
Start Command Code
cmd
Ask for a high-level overview
Get overview
> give me brief overview of this codebase
Dive deeper into specific components
Explore architecture
> explain the architecture patterns used in this codebase
Understand payment system
> how is payment system implemented in this codebase?
You can tell Command Code your taste preferences to start building your profile while you code.
Tell your taste preferences
Here are some examples of taste preferences you can tell Command Code related to your projects:
Tell your taste preferences
> I always use pnpm instead of npm
> I use TypeScript for CLI projects
> I use tsup as build tool
> I use commandar for CLI commands
Sync Taste across environments
You can use your taste profiles from anywhere by pushing them to the Command Code Studio.
Push Taste
npx taste push
Suppose you've been working on a task with Command Code and need to continue where you left off in a later session.
Command Code provides two options for resuming previous conversations:
--continueto automatically continue the most recent conversation--resumeto display a conversation picker
Continue the most recent conversation
Continue conversation
cmd --continue
This immediately resumes your most recent conversation without any prompts.
Show conversation picker
Resume conversation
cmd --resume
This displays an interactive conversation selector with a clean list view showing:
- Session summary (or initial prompt)
- Metadata: time elapsed, message count, and git branch
Use arrow keys to navigate and press Enter to select a conversation. Press Esc to exit.
Resume conversation
Modified # Messages Git Branch Summary
❯ 1. 20 hours ago 172 main Follow this practice and up...
2. 21 hours ago 13 main Add the common worflows her...
3. 22 hours ago 2 main does this {src/components/u...
4. 22 hours ago 82 main pnpm dlx shadcn@latest add ...
5. 1 day ago 2 ankit/features all tools support you have
6. 2 days ago 20 ankit/commands Update the content in each ...
7. 3 days ago 28 main For each command make a fol...
8. 6 days ago 11 main Why Command Code similar to...
Suppose you need to locate code related to a specific feature or functionality.
Ask Command Code to find relevant files
Find files
> find the files that handle authentication logic
Get context on how components interact
Understand interactions
> how do these files handle authentication logic?
Understand the execution flow
Explain authentication flow
> explain the authentication flow from front-end to database
Suppose you've encountered an error message and need to find and fix its source.
Share the error with Command Code
Report error
> I'm seeing an build error when I run `npm run build`.
Tell Command Code your Taste preferences
Taste Preferences
> I prefer to run `pnpm run build` after the change to see the build error
Ask for fix recommendations
Get suggestions
> suggest a few ways to fix the bugs in @user.ts
Apply the fix
Apply fix
> update @user.ts to fix the bugs
Suppose you need to update old code to use modern patterns and practices.
Identify legacy code for refactoring
Find deprecated code
> find deprecated API endpoints in this codebase
Get refactoring recommendations
Get recommendations
> suggest how to refactor @auth.ts to use OAuth2 authentication
Apply the changes safely
Refactor code
> refactor @auth.ts to use OAuth2 authentication
Verify the refactoring
Run tests
> run tests for the refactored code
Suppose you need to add tests for uncovered code.
Identify untested code
Find untested code
> find functions and files in which are not covered by tests
Tell Command Code your Taste preferences for testing
Test Preferences
> I prefer to use Vitest for testing
> I use __test__ prefix for test files
Generate test scaffolding
Add tests
> add tests for those functions and files
Add meaningful test cases
Add edge cases
> add test cases for edge conditions in those functions and files
Run and verify tests
Verify tests
> run the new tests and fix any failures
Suppose you need to create a well-documented pull request for your changes.
Summarize your changes
Summarize changes
> summarize the changes I've made to the authentication logic
Generate a PR with Command Code
Create PR
> create a pr for those changes
Add information about the changes
Add information about the changes
> add information about the changes I've made to the PR description
Suppose you need to add or update documentation for your code.
Identify undocumented code
Find undocumented code
> find functions without proper documentation in this codebase
Generate documentation
Add documentation
> add documentation for those functions in this codebase
Improve the documentation with your reviews
Improve docs
> improve the documentation with your review and suggestions
Verify documentation
Check standards
> check if the documentation follows our project standards
It supports images in the conversation. You can use images to debug UI bugs, describe UI elements, and check for issues in diagrams.
Add an image to the conversation
You can copy paste an image into the CLI or reference an image file in the conversation.
How to add an image to the conversation
> Copy an image and paste it into the CLI
How to reference an image file in the conversation
> Reference an image file in the conversation
Ask Command Code to analyze the image
Describe UI
> What are the UI elements used in this image describe them [#Image#1]
Generate CSS
> Genreate the CSS to match the same design shown in the image [#Image#1]
Analyze diagram
> Analyze this diagram and suggest improvements [#Image#1]
Use images for context
Debug with image
> Debug this UI bug with the image [#Image#1]
Schema analysis
> Analyze this schema and suggest modifications for the new feature [#Image#1]
Use @ to quickly include files or directories in the conversation.
Reference a single file
Reference file
> Explain the logic in this file @auth.ts
The will help Command Code to understand the context of the file and provide better suggestions.
Reference a directory
Reference directory
> Look at this directory @src/app and explain the structure?
This provides a directory listing with file information and explains the structure of the directory.
You can use Git worktrees to work on multiple tasks simultaneously using your taste preferences without giving lot of context again and again to ship code faster.
What are Git worktrees?
Git worktrees allow you to check out multiple branches from the same repository into separate directories. Each worktree has its own working directory with isolated files, while sharing the same Git history. You can learn more about Git worktrees in the official Git worktree documentation.
Create a new worktree
New worktree with new branch
git worktree add ../project-feature-auth -b feature-auth
New worktree with existing branch
git worktree add ../project-auth auth-bugfix
This creates a new directory with a separate working copy of your repository.
Run Command Code in each worktree
Navigate to worktree
cd ../project-feature-auth
Start Command Code
cmd
Run Command Code in another worktree
Switch worktree
cd ../project-auth-bugfix
Start Command Code
cmd
Manage your worktrees
List worktrees
git worktree list
Remove worktree
git worktree remove ../project-auth-bugfix
Command Code has built-in access to its documentation and can answer questions about its own features and limitations.
Example questions
PR capabilities
> can you help me to create a pull requests?
Tools capabilities
> What tools are available to you?