mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-21 06:48:04 +00:00
docs: 更新文档和技能
This commit is contained in:
+349
@@ -0,0 +1,349 @@
|
||||
# How to SSH to Your Local Computer from Anywhere via Mobile, Based on FRP Implementation
|
||||
|
||||
Don't know how to set it up? Install Codex on both your server and computer (if you don't know how, ask GPT; just type commands in the terminal). Then paste this document into Codex and let it configure everything for you. If you really can't figure it out, just contact me: telegram=https://t.me/desci0 x=https://x.com/123olp (P.S.: Paid setup service available)
|
||||
|
||||
# 📌 Prerequisites
|
||||
|
||||
Before deploying the FRP server and client, please ensure you have the following environment and tools. These prerequisites are necessary for the FRP tunnel to function correctly.
|
||||
|
||||
## 1. Basic Environment Requirements
|
||||
|
||||
### ✔ A permanently online **AWS EC2 instance**
|
||||
|
||||
* Recommended OS: Ubuntu 20.04/22.04 (this article uses Ubuntu as an example)
|
||||
* Must have a public IP address (AWS provides this by default)
|
||||
* Requires permission to modify security group rules (to open FRP ports)
|
||||
|
||||
Purpose: To act as the FRP server (frps), providing a fixed access point for your Windows computer.
|
||||
|
||||
## 2. An internet-connected **Windows computer**
|
||||
|
||||
* Windows 10 or Windows 11
|
||||
* Requires normal user privileges (but some configurations need administrator privileges)
|
||||
* **OpenSSH Server** must be installed
|
||||
|
||||
Purpose: To act as the FRP client (frpc), automatically connecting to AWS regardless of the network it's on.
|
||||
|
||||
## 3. Required Software / Repositories to Download
|
||||
|
||||
### ✔ FRP (Fast Reverse Proxy)
|
||||
|
||||
Official Repository Address:
|
||||
|
||||
```
|
||||
https://github.com/fatedier/frp
|
||||
```
|
||||
|
||||
Version used in this deployment:
|
||||
|
||||
```
|
||||
frp_0.58.1
|
||||
```
|
||||
|
||||
Download Page:
|
||||
|
||||
```
|
||||
https://github.com/fatedier/frp/releases
|
||||
```
|
||||
|
||||
Needed to download:
|
||||
|
||||
* Linux version (for AWS)
|
||||
* Windows version (for local computer)
|
||||
|
||||
## 4. Required Software to Install
|
||||
|
||||
### ✔ Windows: OpenSSH Server + OpenSSH Client
|
||||
|
||||
Installation Path:
|
||||
|
||||
```
|
||||
Settings → Apps → Optional features → Add a feature
|
||||
```
|
||||
|
||||
Purpose: Provides SSH login capability, allowing FRP to forward SSH to Windows.
|
||||
|
||||
## 5. Terminal Tool
|
||||
|
||||
### ✔ Termius (Recommended)
|
||||
|
||||
* Used to connect to your Windows via SSH from your phone or computer
|
||||
* Supports generating SSH keys
|
||||
* Supports managing multiple hosts
|
||||
|
||||
You must use Termius to generate the SSH private key (because you've enabled "key-only login").
|
||||
|
||||
Official Download:
|
||||
|
||||
```
|
||||
https://termius.com
|
||||
```
|
||||
|
||||
## 6. Network and Port Requirements
|
||||
|
||||
The following ports must be open in the AWS Security Group:
|
||||
|
||||
| Port | Purpose | Required |
|
||||
| :---------------------------------------- | :------------------------- | :------- |
|
||||
| **FRP Control Port** (e.g., 1234 or 114514) | frpc → frps connection | ✔ Required |
|
||||
| **SSH Mapping Port** (e.g., 12345 or 114515) | Termius → Windows SSH | ✔ Required |
|
||||
|
||||
If using UFW (Ubuntu Firewall), also need:
|
||||
|
||||
```
|
||||
sudo ufw allow <FRP Control Port>/tcp
|
||||
sudo ufw allow <SSH Mapping Port>/tcp
|
||||
```
|
||||
|
||||
## 7. Public Key / Private Key Preparation (Key Login Required)
|
||||
|
||||
You need to prepare in advance:
|
||||
|
||||
* SSH private key generated by Termius (local)
|
||||
* SSH public key generated by Termius (needs to be placed in Windows' `authorized_keys`)
|
||||
|
||||
This deployment has disabled password login, so **the private key must be kept secure, otherwise you will not be able to log in to Windows**.
|
||||
|
||||
## 8. Basic Linux Operation Skills
|
||||
|
||||
Needs knowledge of the following basic commands (very simple):
|
||||
|
||||
```
|
||||
cd /path
|
||||
nano / vim / notepad
|
||||
chmod / chown
|
||||
ps -ef | grep
|
||||
ss -lnpt
|
||||
nohup <cmd> &
|
||||
tail -f
|
||||
```
|
||||
|
||||
All covered in your document, no extra requirements.
|
||||
|
||||
# 📌 Summary of Prerequisites (Final Version)
|
||||
|
||||
```
|
||||
Must have:
|
||||
- AWS EC2 (Ubuntu, with public IP)
|
||||
- Windows computer (OpenSSH Server installed)
|
||||
- Termius (for SSH + key generation)
|
||||
- FRP (Download Linux + Windows versions)
|
||||
- AWS security group has FRP control port and SSH mapping port open
|
||||
- Termius generated SSH key pair
|
||||
```
|
||||
|
||||
As long as the above prerequisites are met, your FRP tunnel, SSH key login, and cross-network remote access to your computer will 100% work correctly.
|
||||
|
||||
If you wish, I can also help you:
|
||||
|
||||
* String the entire document into a professional, formalized, integrated tutorial
|
||||
* Add "Scope, Version Description, Architecture Overview Diagram, Flowchart" to your document
|
||||
* Provide a systemd service template for FRP deployment
|
||||
* Provide a background frpc auto-start script for Windows (more reliable)
|
||||
|
||||
Let me know if you need any of these!
|
||||
|
||||
# FRP Server Deployment Guide
|
||||
|
||||
This guide documents the FRP server configuration and operation methods on the current AWS EC2 (Ubuntu) instance, for future maintenance or reconstruction.
|
||||
|
||||
## Basic Information
|
||||
- Working directory: `/home/ubuntu/.frp`
|
||||
- FRP version: `frp_0.58.1_linux_amd64`
|
||||
- Executable: `/home/ubuntu/.frp/frp_0.58.1_linux_amd64/frps`
|
||||
- Configuration file: `/home/ubuntu/.frp/frp_0.58.1_linux_amd64/frps.ini`
|
||||
- Log file: `/home/ubuntu/.frp/frps.log`
|
||||
- Startup script: `/home/ubuntu/.frp/start_frps.sh`
|
||||
- Listening ports:
|
||||
- Control port `bind_port = 1234`
|
||||
- SSH mapping port `12345`
|
||||
- Token: `123456`
|
||||
|
||||
## Installation Steps
|
||||
1. Create directory and download FRP:
|
||||
```bash
|
||||
mkdir -p /home/ubuntu/.frp
|
||||
cd /home/ubuntu/.frp
|
||||
wget https://github.com/fatedier/frp/releases/download/v0.58.1/frp_0.58.1_linux_amd64.tar.gz
|
||||
tar -zxf frp_0.58.1_linux_amd64.tar.gz
|
||||
```
|
||||
2. Create configuration `/home/ubuntu/.frp/frp_0.58.1_linux_amd64/frps.ini`:
|
||||
```ini
|
||||
[common]
|
||||
bind_port = 1234
|
||||
token = 123456
|
||||
```
|
||||
3. Write startup script `/home/ubuntu/.frp/start_frps.sh` (ready):
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
BASE_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
FRP_DIR="$BASE_DIR/frp_0.58.1_linux_amd64"
|
||||
FRPS_BIN="$FRP_DIR/frps"
|
||||
CONFIG_FILE="$FRP_DIR/frps.ini"
|
||||
LOG_FILE="$BASE_DIR/frps.log"
|
||||
|
||||
if ! [ -x "$FRPS_BIN" ]; then
|
||||
echo "frps binary not found at $FRPS_BIN" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! [ -f "$CONFIG_FILE" ]; then
|
||||
echo "Config not found at $CONFIG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PIDS=$(pgrep -f "frps.*frps\.ini" || true)
|
||||
if [ -n "$PIDS" ]; then
|
||||
echo "frps is running; restarting (pids: $PIDS)..."
|
||||
kill $PIDS
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
echo "Starting frps with $CONFIG_FILE (log: $LOG_FILE)"
|
||||
cd "$FRP_DIR"
|
||||
nohup "$FRPS_BIN" -c "$CONFIG_FILE" >"$LOG_FILE" 2>&1 &
|
||||
|
||||
sleep 1
|
||||
PIDS=$(pgrep -f "frps.*frps\.ini" || true)
|
||||
if [ -n "$PIDS" ]; then
|
||||
echo "frps started (pid: $PIDS)"
|
||||
else
|
||||
echo "frps failed to start; check $LOG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
## Start and Stop
|
||||
- Start/Restart:
|
||||
```bash
|
||||
cd /home/ubuntu/.frp
|
||||
bash ./start_frps.sh
|
||||
```
|
||||
- Check process: `ps -ef | grep frps`
|
||||
- Check listening: `ss -lnpt | grep 1234`
|
||||
- View logs: `tail -n 50 /home/ubuntu/.frp/frps.log`
|
||||
- Stop (if manual): `pkill -f "frps.*frps.ini"`
|
||||
|
||||
## Security Group and Firewall
|
||||
- AWS Security Group (sg-099756caee5666062) needs to open inbound TCP 1234 (FRP control) and 12345 (SSH mapping).
|
||||
- If using ufw, execute:
|
||||
```bash
|
||||
sudo ufw allow 1234/tcp
|
||||
sudo ufw allow 12345/tcp
|
||||
```
|
||||
|
||||
## Remote Client Requirements
|
||||
- In Windows `frpc.ini`, `server_addr` points to this EC2 public IP, `server_port=1234`, `remote_port=12345`, token matches server.
|
||||
- Termius/SSH client uses `ssh lenovo@<AWS IP> -p 12345`, authentication method is key (private key generated by Termius Keychain).
|
||||
|
||||
## Maintenance Suggestions
|
||||
- FRP official has indicated that INI format will be deprecated in the future; subsequent upgrades recommend switching to TOML/YAML.
|
||||
- `start_frps.sh` can be registered as a systemd service to ensure automatic startup after instance reboot.
|
||||
- Regularly check `frps.log` for abnormal connections or errors, and ensure the token is not leaked.
|
||||
|
||||
FRP Windows Client Configuration Guide
|
||||
================================
|
||||
Last Updated: 2025-12-05
|
||||
Applicable Environment: Windows 10/11, user lenovo, OpenSSH Server already installed on this machine.
|
||||
|
||||
I. Directories and Files
|
||||
- FRP Program Directory: C:\frp\
|
||||
- frpc.exe
|
||||
- frpc.ini (client configuration)
|
||||
- start_frpc.bat (background startup script)
|
||||
- SSH Keys:
|
||||
- Private key: C:\Users\lenovo\.ssh\666
|
||||
- Public key: C:\Users\lenovo\.ssh\666.pub
|
||||
- Administrator authorized public key: C:\ProgramData\ssh\666_keys
|
||||
|
||||
II. frpc.ini Content (currently effective)
|
||||
[common]
|
||||
server_addr = 13.14.223.23
|
||||
server_port = 1234
|
||||
token = 123456
|
||||
|
||||
[ssh]
|
||||
type = tcp
|
||||
local_ip = 127.0.0.1
|
||||
local_port = 22
|
||||
remote_port = 12345
|
||||
|
||||
III. Startup and Autostart
|
||||
1) Manual foreground verification (optional)
|
||||
PowerShell:
|
||||
cd C:\frp
|
||||
.\frpc.exe -c frpc.ini
|
||||
|
||||
2) Background quick start
|
||||
Double-click C:\frp\start_frpc.bat
|
||||
|
||||
3) Startup autostart (simple way)
|
||||
Copy start_frpc.bat to the Startup folder:
|
||||
C:\Users\lenovo\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
|
||||
Automatically starts in the background on next login.
|
||||
|
||||
IV. SSH Connection Method
|
||||
- Terminal command:
|
||||
ssh -i "C:\Users\lenovo\.ssh\666" -p 12345 lenovo@13.14.223.23
|
||||
|
||||
- Termius entry:
|
||||
Host 13.14.223.23
|
||||
Port 12345
|
||||
User lenovo
|
||||
Key Select C:\Users\lenovo\.ssh\666 (no passphrase)
|
||||
|
||||
V. Permissions and Security
|
||||
- Private key permissions restricted to lenovo, SYSTEM readable.
|
||||
- sshd has password login disabled (PasswordAuthentication no), key-only.
|
||||
- Administrator group users use C:\ProgramData\ssh\666_keys as the authorization list.
|
||||
|
||||
VI. Common Checks
|
||||
- Check frpc running: Task Manager or
|
||||
netstat -ano | findstr 1234
|
||||
- Check frpc logs (WSL version, if needed): /tmp/frpc-wsl.log
|
||||
- Test SSH: If the above ssh command returns ok, it's working.
|
||||
|
||||
VII. Troubleshooting Quick Reference
|
||||
- "Permission denied (publickey)":
|
||||
* Confirm 666 public key is in C:\ProgramData\ssh\666_keys
|
||||
* Confirm private key path/permissions are correct.
|
||||
- "Connection refused": frps not running or ports 1234/12345 not open.
|
||||
- frpc not connecting: Run frpc in foreground to check prompts, or check if server_addr, token in frpc.ini match.
|
||||
|
||||
|
||||
Termius (Mobile) Connection Steps:
|
||||
|
||||
1. Create Host
|
||||
- Host (Address): 13.14.223.23
|
||||
- Port: 12345
|
||||
- Label can be customized (e.g., FRP-Home)
|
||||
2. Authentication method select Key
|
||||
- In Authentication, select Key
|
||||
- Click Import Key (or "From file/paste")
|
||||
- Import the content of the local private key 666 (it is recommended to transfer it securely to the mobile phone and then paste it; if Termius supports importing from a file, select that file).
|
||||
The private key content is at PC path: C:\Users\lenovo\.ssh\666 (plain text, starting with -----BEGIN OPENSSH PRIVATE KEY-----).
|
||||
- Leave Passphrase empty (this key has no passphrase).
|
||||
3. Username
|
||||
- Username: lenovo
|
||||
4. Save and Connect
|
||||
- Accept the fingerprint prompt on first connection.
|
||||
5. Optional Security Measures
|
||||
- Set a local encryption password for this private key in Termius (App-layer protection).
|
||||
- If it is inconvenient to copy the private key, you can generate a new key on the mobile end and append its public key to C:\ProgramData\ssh\666_keys, but currently 666 is already usable, just import as above.
|
||||
|
||||
One-click startup command (execute in current administrator PowerShell)
|
||||
|
||||
# Allow, prevent blocking & direct foreground startup
|
||||
Add-MpPreference -ExclusionPath "C:\frp"
|
||||
Unblock-File C:\frp\frpc.exe
|
||||
cd C:\frp
|
||||
.\frpc.exe -c frpc.ini
|
||||
|
||||
If you want to start in the background (without occupying a window):
|
||||
|
||||
cd C:\frp
|
||||
Start-Process -FilePath ".\frpc.exe" -ArgumentList "-c frpc.ini" -WindowStyle Hidden
|
||||
|
||||
Need autostart on boot (highest privilege):
|
||||
|
||||
schtasks /Create /TN "FRPClient" /TR "C:\frp\frpc.exe -c C:\frp\frpc.ini" /SC ONLOGON /RL HIGHEST /F /RU lenovo
|
||||
@@ -0,0 +1,169 @@
|
||||
# LazyVim Shortcut Cheatsheet
|
||||
|
||||
| Shortcut | Function |
|
||||
|-------------|---------------------------------|
|
||||
| **General** | |
|
||||
| `<Space>` | Show keybinds menu (after 1s) |
|
||||
| `<Space>sk` | Search all keybinds |
|
||||
| `u` | Undo |
|
||||
| `Ctrl+r` | Redo |
|
||||
| `.` | Repeat last operation |
|
||||
| `Esc` | Exit insert mode/cancel |
|
||||
| **File** | |
|
||||
| `<Space>ff` | Find file |
|
||||
| `<Space>fr` | Recently opened files |
|
||||
| `<Space>fn` | New file |
|
||||
| `<Space>fs` | Save file |
|
||||
| `<Space>fS` | Save as |
|
||||
| `<Space>e` | Toggle sidebar |
|
||||
| `<Space>E` | Locate current file in sidebar |
|
||||
| **Search** | |
|
||||
| `<Space>sg` | Global text search (grep) |
|
||||
| `<Space>sw` | Search word under cursor |
|
||||
| `<Space>sb` | Search current buffer |
|
||||
| `<Space>ss` | Search symbol |
|
||||
| `<Space>sS` | Workspace search symbol |
|
||||
| `<Space>sh` | Search help documentation |
|
||||
| `<Space>sm` | Search marks |
|
||||
| `<Space>sr` | Search and replace |
|
||||
| `/` | Search current file |
|
||||
| `n` | Next search result |
|
||||
| `N` | Previous search result |
|
||||
| `*` | Search word under cursor |
|
||||
| **Buffer (Tabs)** | |
|
||||
| `Shift+h` | Previous buffer |
|
||||
| `Shift+l` | Next buffer |
|
||||
| `<Space>bb` | Switch to other buffer |
|
||||
| `<Space>bd` | Close current buffer |
|
||||
| `<Space>bD` | Force close buffer |
|
||||
| `<Space>bo` | Close other buffers |
|
||||
| `<Space>bp` | Pin buffer |
|
||||
| `<Space>bl` | Delete left buffers |
|
||||
| `<Space>br` | Delete right buffers |
|
||||
| `[b` | Previous buffer |
|
||||
| `]b` | Next buffer |
|
||||
| **Window/Split** | |
|
||||
| `Ctrl+h` | Move to left window |
|
||||
| `Ctrl+j` | Move to down window |
|
||||
| `Ctrl+k` | Move to up window |
|
||||
| `Ctrl+l` | Move to right window |
|
||||
| `<Space>-` | Horizontal split |
|
||||
| `<Space>|` | Vertical split |
|
||||
| `<Space>wd` | Close current window |
|
||||
| `<Space>ww` | Switch window |
|
||||
| `<Space>wo` | Close other windows |
|
||||
| `Ctrl+Up` | Increase window height |
|
||||
| `Ctrl+Down` | Decrease window height |
|
||||
| `Ctrl+Left` | Decrease window width |
|
||||
| `Ctrl+Right`| Increase window width |
|
||||
| **Terminal**| |
|
||||
| `Ctrl+/` | Floating terminal |
|
||||
| `<Space>ft` | Floating terminal |
|
||||
| `<Space>fT` | Terminal in current directory |
|
||||
| `Ctrl+\` | Exit terminal mode |
|
||||
| **Code Navigation** | |
|
||||
| `gd` | Go to definition |
|
||||
| `gD` | Go to declaration |
|
||||
| `gr` | View references |
|
||||
| `gI` | Go to implementation |
|
||||
| `gy` | Go to type definition |
|
||||
| `K` | View documentation hover |
|
||||
| `gK` | Signature help |
|
||||
| `Ctrl+k` | Insert mode signature help |
|
||||
| `]d` | Next diagnostic |
|
||||
| `[d` | Previous diagnostic |
|
||||
| `]e` | Next error |
|
||||
| `[e` | Previous error |
|
||||
| `]w` | Next warning |
|
||||
| `[w` | Previous warning |
|
||||
| **Code Actions** | |
|
||||
| `<Space>ca` | Code action |
|
||||
| `<Space>cA` | Source code action |
|
||||
| `<Space>cr` | Rename |
|
||||
| `<Space>cf` | Format file |
|
||||
| `<Space>cd` | Line diagnostic info |
|
||||
| `<Space>cl` | LSP info |
|
||||
| `<Space>cm` | Mason (Manage LSP) |
|
||||
| **Comments**| |
|
||||
| `gcc` | Comment/uncomment current line |
|
||||
| `gc` | Comment selected area |
|
||||
| `gco` | Add comment below |
|
||||
| `gcO` | Add comment above |
|
||||
| `gcA` | Add comment at end of line |
|
||||
| **Git** | |
|
||||
| `<Space>gg` | Open lazygit |
|
||||
| `<Space>gG` | Lazygit in current directory |
|
||||
| `<Space>gf` | Git file list |
|
||||
| `<Space>gc` | Git commit history |
|
||||
| `<Space>gs` | Git status |
|
||||
| `<Space>gb` | Git blame current line |
|
||||
| `<Space>gB` | Open repository in browser |
|
||||
| `]h` | Next git hunk |
|
||||
| `[h` | Previous git hunk |
|
||||
| `<Space>ghp`| Preview hunk |
|
||||
| `<Space>ghs`| Stage hunk |
|
||||
| `<Space>ghr`| Reset hunk |
|
||||
| `<Space>ghS`| Stage entire file |
|
||||
| `<Space>ghR`| Reset entire file |
|
||||
| `<Space>ghd`| Diff current file |
|
||||
| **Selection/Edit** | |
|
||||
| `v` | Enter visual mode |
|
||||
| `V` | Line visual mode |
|
||||
| `Ctrl+v` | Block visual mode |
|
||||
| `y` | Yank |
|
||||
| `d` | Delete/Cut |
|
||||
| `p` | Paste |
|
||||
| `P` | Paste before |
|
||||
| `c` | Change |
|
||||
| `x` | Delete character |
|
||||
| `r` | Replace character |
|
||||
| `~` | Toggle case |
|
||||
| `>>` | Increase indent |
|
||||
| `<<` | Decrease indent |
|
||||
| `=` | Auto indent |
|
||||
| `J` | Join lines |
|
||||
| **Movement**| |
|
||||
| `h/j/k/l` | Left/Down/Up/Right |
|
||||
| `w` | Next word start |
|
||||
| `b` | Previous word start |
|
||||
| `e` | Next word end |
|
||||
| `0` | Start of line |
|
||||
| `$` | End of line |
|
||||
| `^` | First non-blank char of line |
|
||||
| `gg` | Start of file |
|
||||
| `G` | End of file |
|
||||
| `{` | Previous paragraph |
|
||||
| `}` | Next paragraph |
|
||||
| `%` | Jump to matching parenthesis |
|
||||
| `Ctrl+d` | Scroll down half page |
|
||||
| `Ctrl+u` | Scroll up half page |
|
||||
| `Ctrl+f` | Scroll down full page |
|
||||
| `Ctrl+b` | Scroll up full page |
|
||||
| `zz` | Center current line |
|
||||
| `zt` | Top current line |
|
||||
| `zb` | Bottom current line |
|
||||
| `Number+G` | Go to specific line |
|
||||
| **Folding** | |
|
||||
| `za` | Toggle fold |
|
||||
| `zA` | Recursively toggle fold |
|
||||
| `zo` | Open fold |
|
||||
| `zc` | Close fold |
|
||||
| `zR` | Open all folds |
|
||||
| `zM` | Close all folds |
|
||||
| **UI** | |
|
||||
| `<Space>uf` | Toggle format |
|
||||
| `<Space>us` | Toggle spell check |
|
||||
| `<Space>uw` | Toggle word wrap |
|
||||
| `<Space>ul` | Toggle line numbers |
|
||||
| `<Space>uL` | Toggle relative line numbers |
|
||||
| `<Space>ud` | Toggle diagnostics |
|
||||
| `<Space>uc` | Toggle invisible characters |
|
||||
| `<Space>uh` | Toggle highlights |
|
||||
| `<Space>un` | Close notifications |
|
||||
| **Exit** | |
|
||||
| `<Space>qq` | Quit all |
|
||||
| `<Space>qQ` | Force quit all |
|
||||
| `:w` | Save |
|
||||
| `:q` | Quit |
|
||||
| `:wq` | Save and quit |
|
||||
| `:q!` | Force quit without saving |
|
||||
@@ -0,0 +1,147 @@
|
||||
# auggie-mcp Detailed Configuration Document
|
||||
|
||||
## Installation Steps
|
||||
|
||||
### 1. Install Auggie CLI
|
||||
```bash
|
||||
npm install -g @augmentcode/auggie@prerelease
|
||||
```
|
||||
|
||||
### 2. User Authentication
|
||||
```bash
|
||||
# Method 1: Interactive login
|
||||
auggie login
|
||||
|
||||
# Method 2: Use token (suitable for CI/CD)
|
||||
export AUGMENT_API_TOKEN="your-token"
|
||||
export AUGMENT_API_URL="https://i0.api.augmentcode.com/"
|
||||
```
|
||||
|
||||
## Claude Code Configuration
|
||||
|
||||
### Add to User Configuration (Global)
|
||||
```bash
|
||||
claude mcp add-json auggie-mcp --scope user '{
|
||||
"type": "stdio",
|
||||
"command": "auggie",
|
||||
"args": ["--mcp"],
|
||||
"env": {
|
||||
"AUGMENT_API_TOKEN": "your-token",
|
||||
"AUGMENT_API_URL": "https://i0.api.augmentcode.com/"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### Add to Project Configuration (Current Project)
|
||||
```bash
|
||||
claude mcp add-json auggie-mcp --scope project '{
|
||||
"type": "stdio",
|
||||
"command": "auggie",
|
||||
"args": ["-w", "/path/to/project", "--mcp"],
|
||||
"env": {
|
||||
"AUGMENT_API_TOKEN": "your-token",
|
||||
"AUGMENT_API_URL": "https://i0.api.augmentcode.com/"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
## Codex Configuration
|
||||
|
||||
Edit `~/.codex/config.toml`:
|
||||
```toml
|
||||
[mcp_servers."auggie-mcp"]
|
||||
command = "auggie"
|
||||
args = ["-w", "/path/to/project", "--mcp"]
|
||||
startup_timeout_ms = 20000
|
||||
```
|
||||
|
||||
## Verify Installation
|
||||
|
||||
```bash
|
||||
# Check MCP status
|
||||
claude mcp list
|
||||
|
||||
# Should display:
|
||||
# auggie-mcp: auggie --mcp - ✓ Connected
|
||||
|
||||
# Test functionality
|
||||
claude --print "Use codebase-retrieval to search all files in the current directory"
|
||||
```
|
||||
|
||||
## Tool Usage Examples
|
||||
|
||||
### 1. Search Specific Files
|
||||
```bash
|
||||
# Search all Python files
|
||||
claude --print "Use codebase-retrieval to search *.py files"
|
||||
|
||||
# Search specific directory
|
||||
claude --print "Use codebase-retrieval to search files in src/ directory"
|
||||
```
|
||||
|
||||
### 2. Code Analysis
|
||||
```bash
|
||||
# Analyze function implementation
|
||||
claude --print "Use codebase-retrieval to find the implementation of the main function"
|
||||
|
||||
# Search API endpoints
|
||||
claude --print "Use codebase-retrieval to search all API endpoint definitions"
|
||||
```
|
||||
|
||||
## Environment Variable Configuration
|
||||
|
||||
Create `~/.augment/config` file:
|
||||
```json
|
||||
{
|
||||
"apiToken": "your-token",
|
||||
"apiUrl": "https://i0.api.augmentcode.com/",
|
||||
"defaultModel": "gpt-4",
|
||||
"workspaceRoot": "/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### 1. Connection Failure
|
||||
```bash
|
||||
# Check token
|
||||
auggie token print
|
||||
|
||||
# Re-login
|
||||
auggie logout && auggie login
|
||||
```
|
||||
|
||||
### 2. Path Error
|
||||
```bash
|
||||
# Use absolute path
|
||||
auggie -w $(pwd) --mcp
|
||||
|
||||
# Check if path exists
|
||||
ls -la /path/to/project
|
||||
```
|
||||
|
||||
### 3. Permission Issues
|
||||
```bash
|
||||
# Check file permissions
|
||||
ls -la ~/.augment/
|
||||
|
||||
# Fix permissions
|
||||
chmod 600 ~/.augment/session.json
|
||||
```
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
### Custom Cache Directory
|
||||
```bash
|
||||
export AUGMENT_CACHE_DIR="/custom/cache/path"
|
||||
```
|
||||
|
||||
### Set Retry Timeout
|
||||
```bash
|
||||
export AUGMENT_RETRY_TIMEOUT=30
|
||||
```
|
||||
|
||||
### Disable Confirmation Prompt
|
||||
```bash
|
||||
auggie --allow-indexing --mcp
|
||||
```
|
||||
@@ -0,0 +1,48 @@
|
||||
## tmux Shortcut Cheatsheet (Prefix Ctrl+b)
|
||||
|
||||
### Sessions
|
||||
| Operation | Shortcut |
|
||||
|---|---|
|
||||
| Detach session | d |
|
||||
| List sessions | s |
|
||||
| Rename session | $ |
|
||||
|
||||
### Windows
|
||||
| Operation | Shortcut |
|
||||
|---|---|
|
||||
| Create new window | c |
|
||||
| Close window | & |
|
||||
| Next window | n |
|
||||
| Previous window | p |
|
||||
| Switch to Nth window | 0-9 |
|
||||
| Rename window | , |
|
||||
| List windows | w |
|
||||
|
||||
### Panes
|
||||
| Operation | Shortcut |
|
||||
|---|---|
|
||||
| Split pane horizontally | % |
|
||||
| Split pane vertically | " |
|
||||
| Switch pane | Arrow keys |
|
||||
| Close pane | x |
|
||||
| Show pane numbers | q |
|
||||
| Toggle pane fullscreen/restore | z |
|
||||
| Swap pane positions | { / } |
|
||||
| Break pane into new window | ! |
|
||||
|
||||
### Others
|
||||
| Operation | Shortcut |
|
||||
|---|---|
|
||||
| Enter copy mode | [ |
|
||||
| Paste | ] |
|
||||
| Show time | t |
|
||||
| Command mode | : |
|
||||
| List shortcuts | ? |
|
||||
|
||||
### Command Line
|
||||
bash
|
||||
tmux # Create new session
|
||||
tmux new -s name # Create named session
|
||||
tmux ls # List sessions
|
||||
tmux attach -t name # Attach to session
|
||||
tmux kill-session -t name # Kill session
|
||||
Reference in New Issue
Block a user