Skip to content

Commit a109aed

Browse files
committed
docs: add detailed installation guide for macOS and Linux
1 parent a018feb commit a109aed

File tree

4 files changed

+294
-0
lines changed

4 files changed

+294
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ An open-source mono-repository containing the MyCoder agent and cli.
44

55
!NOTE: To get started with the mycoder agent, [please see the CLI package](packages/cli)
66

7+
For detailed installation instructions for macOS and Linux, [see our installation guide](docs/installation.md)
8+
79
## Features
810

911
- 🤖 **AI-Powered**: Leverages Anthropic's Claude and OpenAI models for intelligent decision making

docs/installation.md

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
---
2+
title: MyCoder Installation Guide for macOS and Linux
3+
shortTitle: Installation Guide
4+
date: 2025-03-07
5+
author: MyCoder Team
6+
excerpt: Detailed instructions for installing MyCoder on macOS and Linux systems, including Node.js setup using NVM.
7+
topics: installation, macos, linux, nodejs, nvm
8+
readTimeMinutes: 5
9+
---
10+
11+
# MyCoder Installation Guide for macOS and Linux
12+
13+
This guide provides detailed instructions for installing MyCoder on macOS and Linux operating systems. We'll cover how to install Node.js using NVM (Node Version Manager) and then install the MyCoder CLI.
14+
15+
## Prerequisites
16+
17+
Before installing MyCoder, make sure your system meets the following requirements:
18+
19+
- macOS 10.15+ or Linux (Ubuntu, Debian, CentOS, Fedora, etc.)
20+
- Terminal access
21+
- Internet connection
22+
- Basic command-line knowledge
23+
24+
## Installing Node.js with NVM (Recommended)
25+
26+
Using NVM (Node Version Manager) is the recommended way to install Node.js as it allows you to easily switch between different Node.js versions.
27+
28+
### 1. Install NVM
29+
30+
#### macOS and Linux
31+
32+
Open your terminal and run the following command:
33+
34+
```bash
35+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
36+
```
37+
38+
Or using wget:
39+
40+
```bash
41+
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
42+
```
43+
44+
After installation, you'll need to close and reopen your terminal, or run the following to use NVM right away:
45+
46+
```bash
47+
export NVM_DIR="$HOME/.nvm"
48+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
49+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
50+
```
51+
52+
To verify that NVM is installed, run:
53+
54+
```bash
55+
nvm --version
56+
```
57+
58+
### 2. Install Node.js
59+
60+
MyCoder requires Node.js version 20.0.0 or later. Install it using NVM:
61+
62+
```bash
63+
nvm install 20
64+
nvm use 20
65+
```
66+
67+
To verify the installation, run:
68+
69+
```bash
70+
node --version
71+
```
72+
73+
This should display a version number that starts with `v20.x.x`.
74+
75+
## Alternative: Direct Node.js Installation
76+
77+
If you prefer not to use NVM, you can install Node.js directly.
78+
79+
### macOS
80+
81+
1. Using Homebrew (recommended for macOS):
82+
83+
```bash
84+
# Install Homebrew if you don't have it
85+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
86+
87+
# Install Node.js
88+
brew install node
89+
```
90+
91+
2. Using the official installer:
92+
- Download the macOS installer from [Node.js official website](https://nodejs.org/)
93+
- Run the installer and follow the instructions
94+
95+
### Linux
96+
97+
#### Ubuntu/Debian:
98+
99+
```bash
100+
# Add NodeSource repository
101+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
102+
103+
# Install Node.js
104+
sudo apt-get install -y nodejs
105+
```
106+
107+
#### CentOS/RHEL/Fedora:
108+
109+
```bash
110+
# Add NodeSource repository
111+
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
112+
113+
# Install Node.js
114+
sudo yum install -y nodejs
115+
```
116+
117+
#### Arch Linux:
118+
119+
```bash
120+
sudo pacman -S nodejs npm
121+
```
122+
123+
## Installing MyCoder
124+
125+
Once Node.js is installed, you can install MyCoder globally using npm:
126+
127+
```bash
128+
npm install -g mycoder
129+
```
130+
131+
To verify the installation, run:
132+
133+
```bash
134+
mycoder --version
135+
```
136+
137+
This should display the current version of MyCoder.
138+
139+
## Setting Up API Keys
140+
141+
MyCoder requires an API key from your chosen AI provider. You can set this up using environment variables:
142+
143+
```bash
144+
# For Anthropic (recommended)
145+
export ANTHROPIC_API_KEY=your-api-key
146+
147+
# Or for OpenAI
148+
export OPENAI_API_KEY=your-api-key
149+
150+
# Or for Mistral AI
151+
export MISTRAL_API_KEY=your-api-key
152+
153+
# Or for xAI/Grok
154+
export XAI_API_KEY=your-api-key
155+
```
156+
157+
To make these environment variables persistent, add them to your shell profile file:
158+
159+
### For Bash (macOS and Linux)
160+
161+
```bash
162+
echo 'export ANTHROPIC_API_KEY=your-api-key' >> ~/.bashrc
163+
source ~/.bashrc
164+
```
165+
166+
### For Zsh (default on macOS)
167+
168+
```bash
169+
echo 'export ANTHROPIC_API_KEY=your-api-key' >> ~/.zshrc
170+
source ~/.zshrc
171+
```
172+
173+
Alternatively, you can create a `.env` file in your working directory with the appropriate key:
174+
175+
```
176+
ANTHROPIC_API_KEY=your-api-key
177+
```
178+
179+
## GitHub Integration (Optional)
180+
181+
If you plan to use MyCoder's GitHub integration, you'll need to install the GitHub CLI (`gh`):
182+
183+
### macOS
184+
185+
```bash
186+
brew install gh
187+
```
188+
189+
### Linux
190+
191+
#### Ubuntu/Debian:
192+
193+
```bash
194+
# Add the GitHub CLI repository
195+
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
196+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
197+
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
198+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
199+
&& sudo apt update \
200+
&& sudo apt install gh -y
201+
```
202+
203+
#### Fedora/CentOS/RHEL:
204+
205+
```bash
206+
sudo dnf install gh
207+
```
208+
209+
#### Arch Linux:
210+
211+
```bash
212+
sudo pacman -S github-cli
213+
```
214+
215+
After installation, authenticate with GitHub:
216+
217+
```bash
218+
gh auth login
219+
```
220+
221+
Follow the interactive prompts to complete the authentication process.
222+
223+
## Basic Usage
224+
225+
Once installed, you can start using MyCoder:
226+
227+
```bash
228+
# Interactive mode
229+
mycoder -i
230+
231+
# Run with a prompt
232+
mycoder "Implement a React component that displays a list of items"
233+
234+
# Enable GitHub mode
235+
mycoder config set githubMode true
236+
```
237+
238+
For more detailed usage instructions, see the [MyCoder Usage Guide](usage.md).
239+
240+
## Troubleshooting
241+
242+
### Common Issues on macOS
243+
244+
1. **Permission Errors**: If you encounter permission errors when installing packages globally:
245+
246+
```bash
247+
sudo npm install -g mycoder
248+
```
249+
250+
2. **Command Not Found**: If the `mycoder` command is not found after installation, check your PATH:
251+
252+
```bash
253+
echo $PATH
254+
```
255+
256+
Ensure that the npm global bin directory is in your PATH. You can add it with:
257+
258+
```bash
259+
echo 'export PATH="$PATH:$(npm config get prefix)/bin"' >> ~/.zshrc
260+
source ~/.zshrc
261+
```
262+
263+
### Common Issues on Linux
264+
265+
1. **Missing Dependencies**: If you encounter missing dependencies:
266+
267+
```bash
268+
# For Ubuntu/Debian
269+
sudo apt-get install -y build-essential
270+
271+
# For CentOS/RHEL/Fedora
272+
sudo yum group install "Development Tools"
273+
```
274+
275+
2. **Node.js Version Conflicts**: If you have multiple Node.js versions installed:
276+
277+
```bash
278+
# Use NVM to switch to the correct version
279+
nvm use 20
280+
```
281+
282+
## Getting Help
283+
284+
If you encounter any issues during installation or usage:
285+
286+
- Check the [MyCoder documentation](https://github.com/drivecore/mycoder/tree/main/docs)
287+
- Join the [MyCoder Discord community](https://discord.gg/5K6TYrHGHt) for support
288+
- Open an issue on the [GitHub repository](https://github.com/drivecore/mycoder/issues)

docs/usage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ npm install -g mycoder
4848
npx mycoder
4949
```
5050

51+
For detailed installation instructions for macOS and Linux, including how to set up Node.js using NVM, [see our installation guide](installation.md).
52+
5153
### Supported AI Providers
5254

5355
MyCoder supports multiple AI providers:

packages/cli/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Command-line interface for AI-powered coding tasks.
1818
npm install -g mycoder
1919
```
2020

21+
For detailed installation instructions for macOS and Linux, including how to set up Node.js using NVM, [see our installation guide](../../docs/installation.md).
22+
2123
## Usage
2224

2325
```bash

0 commit comments

Comments
 (0)