Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Load nvm if available
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Use Node version from .nvmrc if it exists
[ -f .nvmrc ] && nvm use

# Ensure nvm's Node takes precedence in PATH
if [ -n "$NVM_DIR" ] && [ -d "$NVM_DIR/versions/node" ]; then
NODE_VERSION=$(nvm version)
if [ -n "$NODE_VERSION" ] && [ "$NODE_VERSION" != "system" ]; then
export PATH="$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH"
fi
fi

# Try pnpm first, fallback to npx if pnpm not found
if command -v pnpm >/dev/null 2>&1; then
pnpm run validate
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default defineConfig({
{
text: "Essential Guides",
items: [
{ text: "📚 Examples & Tutorials", link: "/guide/examples" },
{ text: "🛡️ Security & Privacy", link: "/guide/security" },
{ text: "🔍 Troubleshooting", link: "/guide/troubleshooting" },
{ text: "💻 CLI Usage", link: "/guide/cli-usage" },
Expand Down
2 changes: 2 additions & 0 deletions docs/automation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ const cookies = await getCookie({

## Next Steps

- [📚 View Complete Examples →](/guide/examples) - Comprehensive working examples
- [Start with Shell Scripts →](/automation/shell-scripts)
- [Read Browser Automation Guide →](/automation/browser-automation)
- [Check the API Reference →](/reference/)

## Need Help?

- [📚 Examples & Tutorials →](/guide/examples) - Complete working examples
- [Check the Troubleshooting Guide →](/guide/troubleshooting)
- [Review Security Best Practices →](/guide/security)
- [Read API Documentation →](/reference/)
13 changes: 12 additions & 1 deletion docs/automation/shell-scripts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Shell Script Automation 📜

Learn how to automate tasks with get-cookie using shell scripts.
Learn how to automate tasks with get-cookie using shell scripts. For complete working examples, see the [Examples Guide](../guide/examples.md) and the `examples/` directory in the repository.

## Basic Scripts

Expand Down Expand Up @@ -310,3 +310,14 @@ debug "Cookie result: ${cookie:0:10}..."
export COOKIE_HASH=$(echo "$cookie" | sha256sum)
# Use COOKIE_HASH for tracking, not the actual cookie
```

## Example Scripts

For comprehensive shell script examples, see:

- **[Quick Start Examples](../guide/examples.md#quick-start-examples)** - Essential patterns and reusable functions
- **[curl Integration Examples](../guide/examples.md#curl-integration-examples)** - Complete curl integration guide
- **[GitHub Authentication Examples](../guide/examples.md#github-authentication-examples)** - GitHub-specific patterns
- **[CLI Features Examples](../guide/examples.md#cli-features-examples)** - All CLI feature demonstrations

All example scripts are available in the `examples/` directory of the repository.
10 changes: 10 additions & 0 deletions docs/guide/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ if [ -n "$AUTH_COOKIE" ]; then
fi
```

## Complete Examples

For comprehensive examples covering all CLI features and use cases, see:

- **[Examples & Tutorials Guide](./examples.md)** - Complete working examples
- **Quick Start:** `examples/quick-start.sh` - Essential patterns
- **curl Integration:** `examples/curl-integration.sh` - Comprehensive curl guide
- **GitHub Auth:** `examples/github-auth.sh` - GitHub authentication patterns
- **CLI Features:** `examples/features-demo.sh` - All feature demonstrations

## Error Handling

The CLI uses exit codes to indicate status:
Expand Down
Loading
Loading