chore: apply linting fixes to iCloud support and launcher command
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,8 @@ Then generate a customized CLAUDE.md file tailored to their needs.
|
|||||||
- Check these paths with appropriate depth limits:
|
- Check these paths with appropriate depth limits:
|
||||||
- `~/Documents` (maxdepth 3)
|
- `~/Documents` (maxdepth 3)
|
||||||
- `~/Desktop` (maxdepth 3)
|
- `~/Desktop` (maxdepth 3)
|
||||||
- `~/Library/Mobile Documents/iCloud~md~obsidian/Documents` (maxdepth 5 - iCloud vaults)
|
- `~/Library/Mobile Documents/iCloud~md~obsidian/Documents` (maxdepth 5 -
|
||||||
|
iCloud vaults)
|
||||||
- Home directory `~/` (maxdepth 2)
|
- Home directory `~/` (maxdepth 2)
|
||||||
- Current directory parent (maxdepth 2)
|
- Current directory parent (maxdepth 2)
|
||||||
- If found, ask: "Found Obsidian vault at [path]. Is this the vault you want
|
- If found, ask: "Found Obsidian vault at [path]. Is this the vault you want
|
||||||
@@ -71,8 +72,10 @@ Then generate a customized CLAUDE.md file tailored to their needs.
|
|||||||
- Detect if using PARA, Zettelkasten, Johnny Decimal, or custom
|
- Detect if using PARA, Zettelkasten, Johnny Decimal, or custom
|
||||||
- If not the right one or none found:
|
- If not the right one or none found:
|
||||||
- Ask: "Is your vault stored in iCloud Drive? (yes/no)"
|
- Ask: "Is your vault stored in iCloud Drive? (yes/no)"
|
||||||
- If yes: "Please enter the full path to your vault (e.g., ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/YourVault)"
|
- If yes: "Please enter the full path to your vault (e.g., ~/Library/Mobile
|
||||||
- If no: "Please enter the path to your existing vault, or type 'skip' to start fresh"
|
Documents/iCloud~md~obsidian/Documents/YourVault)"
|
||||||
|
- If no: "Please enter the path to your existing vault, or type 'skip' to
|
||||||
|
start fresh"
|
||||||
- If no existing vault or user skips, they're starting fresh
|
- If no existing vault or user skips, they're starting fresh
|
||||||
|
|
||||||
4. **Ask Configuration Questions**
|
4. **Ask Configuration Questions**
|
||||||
@@ -373,6 +376,7 @@ find ~ -maxdepth 2 -type d -name ".obsidian" 2>/dev/null
|
|||||||
```
|
```
|
||||||
|
|
||||||
The iCloud path requires:
|
The iCloud path requires:
|
||||||
|
|
||||||
- Higher maxdepth (5) due to nested folder structure
|
- Higher maxdepth (5) due to nested folder structure
|
||||||
- Escaped spaces in path name
|
- Escaped spaces in path name
|
||||||
- Silent error handling (2>/dev/null) as many users won't have iCloud
|
- Silent error handling (2>/dev/null) as many users won't have iCloud
|
||||||
@@ -435,8 +439,8 @@ First-run marker removed
|
|||||||
|
|
||||||
Now let me ask you a few questions to customize your setup:
|
Now let me ask you a few questions to customize your setup:
|
||||||
|
|
||||||
🔍 **Searching for existing Obsidian vaults...**
|
🔍 **Searching for existing Obsidian vaults...** [Searches ~/Documents,
|
||||||
[Searches ~/Documents, ~/Desktop, iCloud Drive, home directory, and parent directories]
|
~/Desktop, iCloud Drive, home directory, and parent directories]
|
||||||
|
|
||||||
### Case 1: Single Vault Found
|
### Case 1: Single Vault Found
|
||||||
|
|
||||||
@@ -493,8 +497,8 @@ Is your vault stored in iCloud Drive? (yes/no)
|
|||||||
|
|
||||||
User: yes
|
User: yes
|
||||||
|
|
||||||
Please enter the full path to your vault:
|
Please enter the full path to your vault: (Example: ~/Library/Mobile
|
||||||
(Example: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/YourVault)
|
Documents/iCloud~md~obsidian/Documents/YourVault)
|
||||||
|
|
||||||
User: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/MyVault
|
User: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/MyVault
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ argument-hint: (optional shell: bash/zsh/fish)
|
|||||||
|
|
||||||
# Install Claudesidian Command
|
# Install Claudesidian Command
|
||||||
|
|
||||||
Creates a shell alias/function that allows you to run `claudesidian` from anywhere
|
Creates a shell alias/function that allows you to run `claudesidian` from
|
||||||
to open your vault in Claude Code.
|
anywhere to open your vault in Claude Code.
|
||||||
|
|
||||||
## Task
|
## Task
|
||||||
|
|
||||||
Install a shell command that:
|
Install a shell command that:
|
||||||
|
|
||||||
1. Changes to your claudesidian vault directory
|
1. Changes to your claudesidian vault directory
|
||||||
2. Launches Claude Code
|
2. Launches Claude Code
|
||||||
3. Works from any directory in your terminal
|
3. Works from any directory in your terminal
|
||||||
@@ -29,16 +30,20 @@ Similar to having a quick launcher for your vault.
|
|||||||
### 2. **Create the Command**
|
### 2. **Create the Command**
|
||||||
|
|
||||||
The command will be an alias that:
|
The command will be an alias that:
|
||||||
|
|
||||||
- Changes to the vault directory: `cd /path/to/your/vault`
|
- Changes to the vault directory: `cd /path/to/your/vault`
|
||||||
- Tries to resume existing session: `claude --resume 2>/dev/null`
|
- Tries to resume existing session: `claude --resume 2>/dev/null`
|
||||||
- Falls back to new session if no existing one: `|| claude`
|
- Falls back to new session if no existing one: `|| claude`
|
||||||
- All in one command: `(cd /path/to/vault && (claude --resume 2>/dev/null || claude))`
|
- All in one command:
|
||||||
|
`(cd /path/to/vault && (claude --resume 2>/dev/null || claude))`
|
||||||
|
|
||||||
This automatically enters resume mode if there's an existing session, or starts a new one if not.
|
This automatically enters resume mode if there's an existing session, or starts
|
||||||
|
a new one if not.
|
||||||
|
|
||||||
### 3. **Install to Shell Config**
|
### 3. **Install to Shell Config**
|
||||||
|
|
||||||
Add the alias to the appropriate config file:
|
Add the alias to the appropriate config file:
|
||||||
|
|
||||||
- **Bash**: `~/.bashrc` or `~/.bash_profile`
|
- **Bash**: `~/.bashrc` or `~/.bash_profile`
|
||||||
- **Zsh**: `~/.zshrc`
|
- **Zsh**: `~/.zshrc`
|
||||||
- **Fish**: `~/.config/fish/config.fish`
|
- **Fish**: `~/.config/fish/config.fish`
|
||||||
@@ -73,7 +78,8 @@ fi
|
|||||||
## Installation Steps
|
## Installation Steps
|
||||||
|
|
||||||
1. **Get vault path**: Use `pwd` to get current directory
|
1. **Get vault path**: Use `pwd` to get current directory
|
||||||
2. **Check if already installed**: Search config file for existing `claudesidian` alias
|
2. **Check if already installed**: Search config file for existing
|
||||||
|
`claudesidian` alias
|
||||||
3. **Add alias**: Append to config file if not present
|
3. **Add alias**: Append to config file if not present
|
||||||
4. **Show success message**: With instructions to reload shell
|
4. **Show success message**: With instructions to reload shell
|
||||||
|
|
||||||
@@ -99,7 +105,8 @@ fi
|
|||||||
|
|
||||||
## Important Notes
|
## Important Notes
|
||||||
|
|
||||||
- The command uses a subshell `()` so it returns to your original directory after
|
- The command uses a subshell `()` so it returns to your original directory
|
||||||
|
after
|
||||||
- Automatically tries to resume existing sessions, falls back to new session
|
- Automatically tries to resume existing sessions, falls back to new session
|
||||||
- If alias already exists, ask user if they want to replace it
|
- If alias already exists, ask user if they want to replace it
|
||||||
- Always show what will be added before modifying config files
|
- Always show what will be added before modifying config files
|
||||||
@@ -108,11 +115,13 @@ fi
|
|||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
Install for current shell:
|
Install for current shell:
|
||||||
|
|
||||||
```
|
```
|
||||||
/install-claudesidian-command
|
/install-claudesidian-command
|
||||||
```
|
```
|
||||||
|
|
||||||
Install for specific shell:
|
Install for specific shell:
|
||||||
|
|
||||||
```
|
```
|
||||||
/install-claudesidian-command zsh
|
/install-claudesidian-command zsh
|
||||||
/install-claudesidian-command bash
|
/install-claudesidian-command bash
|
||||||
@@ -121,11 +130,13 @@ Install for specific shell:
|
|||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
The alias uses a clever pattern:
|
The alias uses a clever pattern:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
alias claudesidian='(cd /path/to/vault && (claude --resume 2>/dev/null || claude))'
|
alias claudesidian='(cd /path/to/vault && (claude --resume 2>/dev/null || claude))'
|
||||||
```
|
```
|
||||||
|
|
||||||
1. `(cd /path/to/vault && ...)` - Subshell that changes directory temporarily
|
1. `(cd /path/to/vault && ...)` - Subshell that changes directory temporarily
|
||||||
2. `claude --resume 2>/dev/null` - Tries to resume existing session, suppresses error
|
2. `claude --resume 2>/dev/null` - Tries to resume existing session, suppresses
|
||||||
|
error
|
||||||
3. `|| claude` - If resume fails (no session), starts new session
|
3. `|| claude` - If resume fails (no session), starts new session
|
||||||
4. After Claude exits, returns to original directory automatically
|
4. After Claude exits, returns to original directory automatically
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ Pre-configured AI assistants ready to use:
|
|||||||
- `de-ai-ify` - Remove AI writing patterns from text
|
- `de-ai-ify` - Remove AI writing patterns from text
|
||||||
- `upgrade` - Update to the latest claudesidian version
|
- `upgrade` - Update to the latest claudesidian version
|
||||||
- `init-bootstrap` - Re-run the setup wizard
|
- `init-bootstrap` - Re-run the setup wizard
|
||||||
- `install-claudesidian-command` - Install shell command to launch vault from anywhere
|
- `install-claudesidian-command` - Install shell command to launch vault from
|
||||||
|
anywhere
|
||||||
|
|
||||||
Run with: `/[command-name]` in Claude Code
|
Run with: `/[command-name]` in Claude Code
|
||||||
|
|
||||||
@@ -274,12 +275,14 @@ Install a shell command to launch your vault from any directory:
|
|||||||
```
|
```
|
||||||
|
|
||||||
This creates a `claudesidian` alias that:
|
This creates a `claudesidian` alias that:
|
||||||
|
|
||||||
- Changes to your vault directory automatically
|
- Changes to your vault directory automatically
|
||||||
- Tries to resume your existing session (if one exists)
|
- Tries to resume your existing session (if one exists)
|
||||||
- Falls back to starting a new session
|
- Falls back to starting a new session
|
||||||
- Returns to your original directory when done
|
- Returns to your original directory when done
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From anywhere in your terminal:
|
# From anywhere in your terminal:
|
||||||
claudesidian
|
claudesidian
|
||||||
@@ -287,7 +290,8 @@ claudesidian
|
|||||||
# It will automatically resume your last session or start a new one
|
# It will automatically resume your last session or start a new one
|
||||||
```
|
```
|
||||||
|
|
||||||
The command is added to your shell config (~/.zshrc, ~/.bashrc, etc.) so it persists across terminal sessions.
|
The command is added to your shell config (~/.zshrc, ~/.bashrc, etc.) so it
|
||||||
|
persists across terminal sessions.
|
||||||
|
|
||||||
### Git Integration
|
### Git Integration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user