Installation
Detailed Installation Guide for CLI Code
Video Guide
PS: Will add later
Step-by-Step Guide
This comprehensive guide will walk you through the complete installation and setup process for CLI Code. Follow each step carefully to ensure a smooth setup experience.
Prerequisites
Before you begin, make sure you have the following installed on your system:
- Node.js (version 16 or higher)
- npm (comes with Node.js)
- Git (for version control)
- VS Code or Cursor (recommended editors)
You can check your installations by running:
node --version
npm --version
git --version
Step 1: Login to Website
- Open your web browser and navigate to clicode.vercel.app
- Click the "Sign In" button in the top-right corner
- Choose GitHub as your authentication method
- Authorize CLI Code to access your GitHub account
- Complete the sign-in process
Note: CLI Code uses GitHub OAuth for secure authentication. Your GitHub credentials are never stored or accessed by CLI Code.
Step 2: Generate Refresh Token
- After successful login, navigate to the Dashboard Page
- Look for the "Refresh Token" section
- Click the "Generate New Token" button
- Copy the generated token immediately - it will only be shown once!
- Store the token securely (you'll need it for CLI configuration)
Security Tip: Treat your refresh token like a password. Don't share it publicly or commit it to version control.
Step 3: Install CLI Code
Open your terminal and run the following command:
npm i cli-code
This will:
- Download and install CLI Code globally on your system
- Make the
cli-code
command available from anywhere in your terminal - Install all necessary dependencies
- Create a config file in
~/.config/cli-code/config.json
- It will also install the VS Code Context Bridge Extension on your VS Code.
- You have to manually install the extension in your Cursor. follow this guide
Alternative Installation Methods:
- Using yarn:
yarn global add cli-code
- Using pnpm:
pnpm add -g cli-code
Step 4: Configure CLI Code
Run the configuration command:
cli-code
This will start an interactive setup process on first run. Follow the prompts:
-
Enter Refresh Token: Paste the token you copied from the dashboard
-
Select AI Provider: Choose from available options:
- OpenAI (GPT-4, GPT-3.5-turbo)
- Anthropic (Claude-3, Claude-2)
- Google (Gemini Pro, Gemini Flash)
- OpenRouter (access to multiple models)
- Custom (for other compatible APIs)
-
Get API Key: Visit your chosen provider's website:
- OpenAI: platform.openai.com/api-keys
- Anthropic: console.anthropic.com
- Google: makersuite.google.com/app/apikey
- OpenRouter: openrouter.ai/keys
-
Enter API Key: Paste your provider's API key when prompted
-
Select Model: Choose from available models for your provider
Configuration File Location: Your settings are stored in
~/.cli-code/config.json
(Linux/Mac) or%APPDATA%\cli-code\config.json
(Windows)
Step 5: Open Codebase in Editor
-
Launch VS Code (or Cursor) and wait for it to fully initialize
-
Open your project folder:
- Use
File > Open Folder
orCtrl/Cmd + K, Ctrl/Cmd + O
- Navigate to your project directory
- Select the folder and click "Open"
- Use
-
Verify Editor Integration:
- Ensure VS Code/Cursor is properly loaded with your project
- Check that your file explorer shows your project structure
- Open a code file to confirm everything is working
Step 6: Start Using CLI Code
-
Open Terminal in your editor:
- VS Code: `Ctrl/Cmd + `` (backtick)
- Or use
Terminal > New Terminal
from the menu
-
Navigate to your project directory (if not already there):
cd /path/to/your/project
-
Launch CLI Code:
cli-code
-
Begin coding with AI assistance:
- CLI Code will detect your current file and context
- Ask questions about your code
- Request code generation or modifications
- Get explanations for complex functions
Step 7: Verify Installation
Test that everything is working correctly:
-
Check CLI Code version:
cli-code --version
-
Test basic functionality:
cli-code --help
Troubleshooting
Common Issues and Solutions
Issue: "Command not found: cli-code"
- Solution: Ensure Node.js and npm are properly installed, then reinstall CLI Code
Issue: "Invalid refresh token"
- Solution: Generate a new token from the dashboard and reconfigure
Issue: "API key error"
- Solution: Verify your API key is correct and has sufficient credits/quota
Issue: "Editor integration not working"
- Solution: Ensure VS Code/Cursor is fully loaded and you're in the correct project directory
Getting Help
If you encounter any issues:
- Check the CLI Code documentation
- Visit the GitHub repository for issues
- Contact support through the website
Next Steps
Now that CLI Code is installed and configured, you can:
- Explore the documentation to learn advanced features
- Try different AI models to find the best fit for your workflow
- Set up custom prompts for your specific use cases
- Integrate with your existing tools and workflows
- Join the community to share tips and get help
🚀 Congratulations! You're now ready to supercharge your coding workflow with AI assistance directly in your terminal.