# API AI Prompt Setup
Source: https://docs.getsnippets.ai/api-reference/api-ai-prompt-setup
Set up Snippets AI API access in seconds using AI-powered assistance
## Set up Snippets AI API access in seconds
Copy the AI instruction prompt and paste it into your IDE AI agent (Cursor, Windsurf, GitHub Copilot, etc.) so it can set up API access quickly.
Click to get the AI setup prompt that will configure your API access
automatically
## How It Works
The AI setup prompt contains pre-configured instructions that guide your IDE's AI agent through the entire API setup process. Simply copy the prompt and let AI handle the technical details.
### Quick Steps
Click the button above to access the AI setup prompt
Copy the entire prompt from the page
Paste it into your IDE's AI chat or prompt box
Your AI agent will automatically configure the Snippets AI API access for
you
## Supported AI Agents
This setup prompt works with any IDE that has an AI agent with a prompt box:
Cursor AI IDE
Windsurf AI IDE
GitHub Copilot Chat
VS Code with AI extensions
JetBrains AI Assistant
Zed AI
Claude for coding
Cline AI Assistant
Aider AI coding assistant
## What Gets Set Up
The AI prompt will help you:
* π Configure your API authentication
* π Set up proper headers and base URLs
* βοΈ Create reusable API client functions
* π§ͺ Add example requests to test the connection
* π Include error handling best practices
## Benefits
Skip the manual setup process. Let AI configure everything in seconds instead
of spending 15-20 minutes reading documentation and writing boilerplate code.
The AI ensures proper authentication, correct headers, and follows best
practices automatically - no typos or configuration mistakes.
Start making API calls right away. The AI sets up working examples you can
run immediately to verify your connection.
The generated code includes comments and follows industry best practices for
API integration, helping you learn as you go.
## Manual Setup Alternative
If you prefer to set up the API manually, check out our comprehensive guides:
Complete API overview and quick start guide
Step-by-step authentication setup
## Need Help?
Get help from our team
Full API reference
# Authentication
Source: https://docs.getsnippets.ai/api-reference/authentication
Learn how to authenticate your API requests
## Overview
The Snippets AI API uses **Bearer token authentication**. All API requests must include a valid API key in the `Authorization` header.
## Getting Your API Key
Navigate to your Snippets AI app
Click on **API Access**
Click **New API Key** and configure: - **Key name**: A descriptive name for
identification - **Team permissions**: Select which teams this key can
access - **All teams**: Toggle if you want workspace-wide access
Copy the secret key immediately - you won't be able to see it again!
**Keep your API key secure!** Never share it publicly or commit it to version
control. Anyone with your API key can access your snippets and consume your
API quota.
## Using Your API Key
Include your API key in the `Authorization` header of every request using the Bearer authentication scheme:
```
Authorization: Bearer YOUR_API_KEY
```
### Code Examples
```javascript JavaScript theme={null}
const axios = require('axios');
const API_KEY = process.env.SNIPPETS_AI_API_KEY;
const BASE_URL = 'https://www.getsnippets.ai/api/prompts';
// Configure axios with default headers
const api = axios.create({
baseURL: BASE_URL,
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
});
// Make a request
async function getSnippet(id) {
const response = await api.get('/snippet', {
params: { id },
});
return response.data;
}
```
```python Python theme={null}
import os
import requests
API_KEY = os.environ.get('SNIPPETS_AI_API_KEY')
BASE_URL = 'https://www.getsnippets.ai/api/prompts'
# Create a session with default headers
session = requests.Session()
session.headers.update({
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
})
# Make a request
def get_snippet(snippet_id):
response = session.get(
f'{BASE_URL}/snippet',
params={'id': snippet_id}
)
return response.json()
```
```bash cURL theme={null}
# Store your API key in an environment variable
export SNIPPETS_AI_API_KEY="your_api_key_here"
# Make a request
curl -X GET "https://www.getsnippets.ai/api/prompts/snippet?id=snippet_id" \
-H "Authorization: Bearer $SNIPPETS_AI_API_KEY" \
-H "Content-Type: application/json"
```
```php PHP theme={null}
```
## Team Permissions
API keys can be configured with different levels of access:
### All Teams Access
When enabled, the API key has access to all teams in your workspace, including newly created teams.
```json theme={null}
{
"is_all_teams": true,
"team_permissions": []
}
```
### Specific Team Access
Limit the API key to specific teams for better security:
```json theme={null}
{
"is_all_teams": false,
"team_permissions": ["team_uuid_1", "team_uuid_2"]
}
```
If you try to access a resource (snippet, folder, or tag) from a team that
your API key doesn't have permission for, you'll receive a `403 Forbidden`
error.
## Security Best Practices
Never hardcode API keys in your source code. Use environment variables or secure secret management systems:
```bash theme={null}
# .env file
SNIPPETS_AI_API_KEY=your_api_key_here
```
{' '}
Periodically rotate your API keys, especially if: - A team member with access
leaves - You suspect a key may have been compromised - You're decommissioning
an integration
{' '}
Create API keys with access only to the teams they need. Don't use all-teams
access unless necessary.
{' '}
Regularly check your API usage in the dashboard to detect any unusual activity
or unauthorized access.
Always make API requests over HTTPS. The API will reject requests made over plain HTTP.
## Managing API Keys
### Viewing API Keys
You can view all your API keys in the dashboard, including:
* Key name and creation date
* Last used timestamp
* Team permissions
* Active/inactive status
### Deactivating Keys
To deactivate an API key:
1. Go to Settings β API Keys
2. Find the key you want to deactivate
3. Click **Deactivate**
Deactivated keys will immediately stop working. Any integrations using that
key will start receiving `401 Unauthorized` errors.
### Deleting Keys
To permanently delete an API key:
1. First deactivate the key
2. Wait at least 24 hours (recommended)
3. Click **Delete** to permanently remove it
## Authentication Errors
Common authentication errors and how to resolve them:
**Invalid or inactive API key**
Your API key is either invalid, has been deactivated, or was never created.
```json theme={null}
{
"success": false,
"message": "Invalid or inactive API key"
}
```
**Solution**: Verify your API key is correct and active in the dashboard.
**Missing Authorization header**
The request didn't include an Authorization header.
```json theme={null}
{
"success": false,
"message": "Authorization header with Bearer token is required"
}
```
**Solution**: Ensure you're including `Authorization: Bearer YOUR_API_KEY` in all requests.
**Insufficient permissions**
Your API key doesn't have access to the requested team.
```json theme={null}
{
"success": false,
"message": "API key does not have access to this team"
}
```
**Solution**: Update your API key's team permissions or use a different key.
**Inactive subscription**
Your workspace subscription is not active.
```json theme={null}
{
"success": false,
"message": "Workspace subscription is not active"
}
```
**Solution**: Check your subscription status and update your billing information.
## Testing Your Authentication
Use this simple request to verify your API key is working:
```bash theme={null}
curl -X GET "https://www.getsnippets.ai/api/prompts/snippet?id=test" \
-H "Authorization: Bearer YOUR_API_KEY"
```
If authentication is successful but the snippet doesn't exist, you'll receive a `404 Not Found` error (which confirms authentication worked). If authentication fails, you'll receive a `401 Unauthorized` error.
## Need Help?
If you're having trouble with authentication:
Get help from our team
# Error Codes
Source: https://docs.getsnippets.ai/api-reference/errors
Complete reference for API error codes and how to handle them
## Error Response Format
All errors follow a consistent JSON format:
```json theme={null}
{
"success": false,
"message": "Human-readable error description",
"error": "Additional error details (optional)"
}
```
Some errors include additional context in the response:
```json theme={null}
{
"success": false,
"message": "Insufficient API requests",
"usage": {
"remainingRequests": 0,
"requiredRequests": 5
}
}
```
## HTTP Status Codes
### 2xx Success
The request was successful. Response includes the requested data.
```json theme={null}
{
"success": true,
"data": { /* requested data */ },
"usage": {
"remainingRequests": 99950
}
}
```
### 4xx Client Errors
**The request was malformed or contains invalid parameters.**
Common causes:
* Missing required parameters
* Invalid JSON in request body
* Invalid parameter values
* Invalid data types
* Field length violations
```json theme={null}
{
"success": false,
"message": "Snippet ID is required"
}
```
**How to fix:**
* Check that all required parameters are included
* Validate JSON syntax
* Verify parameter values match the expected format
* Review field length requirements in the API docs
**Authentication failed or API key is invalid.**
Common causes:
* Missing Authorization header
* Invalid API key format
* Inactive or deleted API key
* Expired API key
```json theme={null}
{
"success": false,
"message": "Invalid or inactive API key"
}
```
**How to fix:**
* Verify the Authorization header is included: `Authorization: Bearer YOUR_KEY`
* Check that the API key is correct
* Confirm the API key is active in your dashboard
* Create a new API key if necessary
**The API key doesn't have permission to access the resource.**
Common causes:
* API key lacks team permissions
* Workspace subscription is inactive
* Insufficient API request quota
* Attempting to access another workspace's resources
```json theme={null}
{
"success": false,
"message": "API key does not have access to this team"
}
```
**Insufficient quota example:**
```json theme={null}
{
"success": false,
"message": "Insufficient API requests. This operation requires 5 requests but you have 0 remaining.",
"usage": {
"remainingRequests": 0,
"requiredRequests": 5
}
}
```
**How to fix:**
* Update API key permissions to include the required teams
* Check your workspace subscription status
* Purchase additional API requests if quota is exhausted
* Verify you're accessing resources in your workspace
**The requested resource doesn't exist.**
Common causes:
* Invalid resource ID
* Resource was deleted
* Typo in the endpoint URL
* Resource belongs to a different workspace
```json theme={null}
{
"success": false,
"message": "Snippet not found"
}
```
**How to fix:**
* Verify the resource ID is correct
* Check if the resource was deleted
* Confirm the endpoint URL is correct
* Ensure the resource exists in your workspace
**Rate limit exceeded (20 requests per minute).**
The response includes a `Retry-After` header indicating how long to wait before retrying.
```json theme={null}
{
"success": false,
"message": "Rate limit exceeded. Too many requests from this API key. Try again in 120 seconds."
}
```
**Response headers:**
```
Retry-After: 120
```
**How to fix:**
* Implement exponential backoff
* Respect the `Retry-After` header
* Use request queuing
* Leverage batch endpoints to reduce request count
* See [Rate Limiting](/api-reference/rate-limiting) for detailed strategies
### 5xx Server Errors
**An unexpected error occurred on the server.**
```json theme={null}
{
"success": false,
"message": "Internal server error",
"error": "Failed to process request"
}
```
**How to fix:**
* Retry the request after a short delay
* Contact support if the problem continues
## Common Error Scenarios
### Authentication Errors
```json Missing Authorization Header theme={null}
{
"success": false,
"message": "Authorization header with Bearer token is required"
}
```
```json Invalid API Key Format theme={null}
{
"success": false,
"message": "API key cannot be empty"
}
```
```json Inactive API Key theme={null}
{
"success": false,
"message": "Invalid or inactive API key"
}
```
### Validation Errors
```json Missing Required Field theme={null}
{
"success": false,
"message": "Title is required"
}
```
```json Field Length Violation theme={null}
{
"success": false,
"message": "Title cannot exceed 200 characters"
}
```
```json Invalid Data Type theme={null}
{
"success": false,
"message": "Content must be a valid object"
}
```
```json Invalid JSON theme={null}
{
"success": false,
"message": "Invalid JSON in request body"
}
```
### Permission Errors
```json No Team Access theme={null}
{
"success": false,
"message": "API key does not have access to this team"
}
```
```json Wrong Workspace theme={null}
{
"success": false,
"message": "API key does not have access to this workspace"
}
```
```json Inactive Subscription theme={null}
{
"success": false,
"message": "Workspace subscription is not active"
}
```
### Resource Errors
```json Resource Not Found theme={null}
{
"success": false,
"message": "Snippet not found"
}
```
```json Folder Not Found theme={null}
{
"success": false,
"message": "Folder not found or does not belong to the specified workspace/team"
}
```
```json Tag Not Found theme={null}
{
"success": false,
"message": "Tags not found: tag_uuid_1, tag_uuid_2"
}
```
### Quota Errors
```json Insufficient Requests theme={null}
{
"success": false,
"message": "Insufficient API requests. This operation requires 10 requests but you only have 5 remaining.",
"usage": {
"remainingRequests": 5,
"requiredRequests": 10
}
}
```
```json No Requests Remaining theme={null}
{
"success": false,
"message": "No API requests remaining",
"usage": {
"remainingRequests": 0
}
}
```
### Variation Errors
```json Cannot Delete Last Variation theme={null}
{
"success": false,
"message": "Cannot delete variations. The following snippets would have no variations left: My Snippet. Snippets must have at least one variation.",
"affectedSnippets": [
{
"snippetId": "snippet_uuid",
"title": "My Snippet"
}
]
}
```
```json Variation Not Found theme={null}
{
"success": false,
"message": "Variations not found: variation_uuid_1, variation_uuid_2"
}
```
### Batch Operation Errors
```json Partial Success theme={null}
{
"success": true,
"data": {
"message": "Some snippets created successfully",
"createdSnippets": [
/* ... */
]
},
"usage": {
"remainingRequests": 99900,
"usageDeducted": 100
},
"metadata": {
"requestedCount": 100,
"createdCount": 95,
"failedCount": 5,
"isPartialSuccess": true,
"failures": [
{
"originalIndex": 10,
"title": "Failed Snippet",
"error": "Folder not found"
}
]
}
}
```
```json Complete Failure theme={null}
{
"success": false,
"message": "Failed to create any snippets",
"usage": {
"remainingRequests": 99900,
"usageDeducted": 100
},
"failures": [
/* ... */
]
}
```
## Error Handling Best Practices
### Retry Strategy
Implement intelligent retry logic with exponential backoff:
```javascript theme={null}
async function apiCallWithRetry(apiCall, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
return await apiCall();
} catch (error) {
const status = error.response?.status;
// Don't retry client errors (except 429)
if (status >= 400 && status < 500 && status !== 429) {
throw error;
}
// For 429 or 5xx, wait and retry
if (attempt < maxRetries - 1) {
const baseDelay =
status === 429
? parseInt(error.response?.headers['retry-after'] || 60) * 1000
: 1000;
const delay = baseDelay * Math.pow(2, attempt);
await new Promise((resolve) => setTimeout(resolve, delay));
} else {
throw error;
}
}
}
}
```
### Comprehensive Error Handler
```javascript theme={null}
function handleAPIError(error) {
if (!error.response) {
// Network error
console.error('Network error:', error.message);
return {
type: 'network',
message: 'Unable to connect to the API',
retryable: true,
};
}
const { status, data } = error.response;
switch (status) {
case 400:
return {
type: 'validation',
message: data.message || 'Invalid request',
retryable: false,
};
case 401:
return {
type: 'authentication',
message: 'Invalid API key',
retryable: false,
action: 'CHECK_API_KEY',
};
case 403:
if (data.message?.includes('API requests')) {
return {
type: 'quota',
message: 'API quota exceeded',
retryable: false,
action: 'UPGRADE_PLAN',
};
}
return {
type: 'permission',
message: data.message || 'Insufficient permissions',
retryable: false,
action: 'UPDATE_PERMISSIONS',
};
case 404:
return {
type: 'not_found',
message: data.message || 'Resource not found',
retryable: false,
};
case 429:
return {
type: 'rate_limit',
message: 'Rate limit exceeded',
retryable: true,
retryAfter: error.response.headers['retry-after'],
};
case 500:
default:
return {
type: 'server',
message: 'Server error occurred',
retryable: true,
};
}
}
// Usage
try {
const result = await apiCall();
} catch (error) {
const errorInfo = handleAPIError(error);
if (errorInfo.retryable) {
// Retry logic
} else {
// Show user-friendly error message
console.error(errorInfo.message);
}
}
```
### User-Friendly Messages
Map technical errors to user-friendly messages:
```javascript theme={null}
const ERROR_MESSAGES = {
'Invalid or inactive API key':
'There was an authentication problem. Please contact support.',
'API key does not have access to this team':
"You don't have permission to access this resource.",
'Insufficient API requests':
'API usage limit reached. Please upgrade your plan.',
'Rate limit exceeded':
'Too many requests. Please wait a moment and try again.',
'Snippet not found':
"The snippet you're looking for doesn't exist or was deleted.",
default: 'Something went wrong. Please try again or contact support.',
};
function getUserFriendlyMessage(apiError) {
return ERROR_MESSAGES[apiError.message] || ERROR_MESSAGES.default;
}
```
## Logging and Monitoring
Track errors to identify patterns and issues:
```javascript theme={null}
class APILogger {
logError(error, context) {
const logEntry = {
timestamp: new Date().toISOString(),
status: error.response?.status,
message: error.response?.data?.message,
endpoint: context.endpoint,
method: context.method,
requestId: error.response?.headers['x-request-id'],
// Don't log API keys!
user: context.userId,
};
// Send to your logging service
console.error('API Error:', logEntry);
// Alert on critical errors
if (error.response?.status >= 500) {
this.alertTeam(logEntry);
}
}
alertTeam(logEntry) {
// Send to Slack, PagerDuty, etc.
}
}
```
## Need Help?
If you're experiencing persistent errors:
Contact our support team
Review the full API documentation
# Create Folder
Source: https://docs.getsnippets.ai/api-reference/folders/create-folder
POST /folder
Creates a new folder. API Cost: 1 request.
# Create Multiple Folders
Source: https://docs.getsnippets.ai/api-reference/folders/create-folders
POST /folders
Creates multiple folders in a single request. API Cost: N requests (one per folder).
# Delete Folder
Source: https://docs.getsnippets.ai/api-reference/folders/delete-folder
DELETE /folder
Deletes a folder. Contained snippets are orphaned (folder_id set to null). API Cost: 1 request.
# Delete Multiple Folders
Source: https://docs.getsnippets.ai/api-reference/folders/delete-folders
DELETE /folders
Deletes multiple folders by their IDs. API Cost: N requests (one per folder).
# Get Folder
Source: https://docs.getsnippets.ai/api-reference/folders/get-folder
GET /folder
Retrieves a folder's metadata and its snippets with pagination. API Cost: 1 + N requests (1 for folder + N for snippets).
# Get Multiple Folders
Source: https://docs.getsnippets.ai/api-reference/folders/get-folders
GET /folders
Retrieves multiple folders and their snippets. API Cost: M + N requests (M for folders + N for total snippets).
# Update Folder
Source: https://docs.getsnippets.ai/api-reference/folders/update-folder
PUT /folder
Updates an existing folder. API Cost: 1 request.
# Update Multiple Folders
Source: https://docs.getsnippets.ai/api-reference/folders/update-folders
PUT /folders
Updates multiple folders in a single request. API Cost: N requests (one per folder).
# Introduction
Source: https://docs.getsnippets.ai/api-reference/introduction
Getting started with the Snippets AI API
## Welcome to the Snippets AI API
The Snippets AI API allows you to programmatically manage snippets, folders, tags, and variations. Build powerful integrations to automate your workflow and sync your code snippets across different platforms.
Learn how to authenticate your API requests
Understand rate limits and usage quotas
Reference for all API error codes
Learn about API usage costs and billing
## Base URL
All API requests should be made to:
```
https://www.getsnippets.ai/api/prompts
```
## Quick Start
Get up and running in minutes:
### 1. Get Your API Key
1. Log into your Snippets AI workspace
2. Navigate to Admin β API Access
3. Create a new API key with appropriate team permissions
4. Copy the secret key (you won't be able to see it again)
### 2. Make Your First Request
Here's a simple example to fetch a snippet:
```javascript theme={null}
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://www.getsnippets.ai/api/prompts';
async function getSnippet(snippetId) {
try {
const response = await axios.get(`${BASE_URL}/snippet`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {
id: snippetId,
},
});
console.log('Snippet:', response.data);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
getSnippet('your-snippet-id');
```
```python theme={null}
import requests
API_KEY = 'your_api_key_here'
BASE_URL = 'https://www.getsnippets.ai/api/prompts'
def get_snippet(snippet_id):
headers = {
'Authorization': f'Bearer {API_KEY}'
}
params = {
'id': snippet_id
}
response = requests.get(
f'{BASE_URL}/snippet',
headers=headers,
params=params
)
if response.status_code == 200:
print('Snippet:', response.json())
return response.json()
else:
print('Error:', response.json())
get_snippet('your-snippet-id')
```
```bash theme={null}
curl -X GET "https://www.getsnippets.ai/api/prompts/snippet?id=your-snippet-id" \
-H "Authorization: Bearer your_api_key_here"
```
## API Resources
The API is organized around four main resource types:
Manage your code and text snippets
Handle multiple versions of snippets
Organize snippets into folders
Categorize snippets with tags
## Key Features
### π Secure Authentication
All requests use Bearer token authentication with API keys that have granular team-level permissions.
### β‘ Rate Limited
The API is rate-limited to 20 requests per minute per API key to ensure fair usage and system stability.
### π° Usage-Based Billing
Pay only for what you use: \$10 per 100,000 API requests. Each endpoint clearly documents its cost.
### π Detailed Metadata
Every response includes usage information, pagination details, and comprehensive metadata about the operation.
### π Batch Operations
Save on API costs by using batch endpoints to create, update, or delete multiple resources at once.
## Response Format
All API responses follow a consistent format:
```json theme={null}
{
"success": true,
"data": {
// Response data here
},
"usage": {
"remainingRequests": 99850
},
"metadata": {
// Additional metadata
}
}
```
### Success Response
* `success`: Boolean indicating if the request was successful
* `data`: The requested data or result
* `usage`: Information about API usage and remaining quota
* `metadata`: Additional context about the operation
### Error Response
* `success`: Always `false` for errors
* `message`: Human-readable error description
* `error`: Additional error details (when available)
## Need Help?
Full documentation and guides
Contact our support team
# Rate Limiting
Source: https://docs.getsnippets.ai/api-reference/rate-limiting
Understand API rate limits and how to handle them
## Overview
To ensure fair usage and maintain system performance, the Snippets AI API implements rate limiting specifically for invalid API key attempts.
**20 invalid attempts** within a rolling window will result in a **5-minute
block** for that API key.
### General Rate Limit
There is **no general rate limit** for valid API requests. You can make as many valid requests as needed without encountering rate limiting errors, provided your API key is valid and has the necessary permissions.
## How the Invalid API Key Block Works
This security measure helps prevent brute-force attacks on API keys:
* Each API key has a counter for invalid access attempts.
* If 20 invalid attempts are detected within a short rolling window, the API key will be temporarily blocked.
* The block lasts for 5 minutes, after which the key is automatically unblocked, and the counter resets.
### Invalid Attempt Criteria
An "invalid attempt" is counted when:
* An API request is made with a non-existent API key.
* An API request is made with a valid API key, but it lacks the necessary permissions for the requested resource (e.g., wrong team ID).
## Checking Your API Key Status
### Blocked API Key Errors
When your API key is temporarily blocked due to excessive invalid attempts, you'll receive a `403 Forbidden` response (or similar, depending on exact implementation):
```json theme={null}
{
"success": false,
"message": "Too many invalid API key attempts. This API key has been temporarily blocked for 5 minutes."
}
```
This response may also include a `Retry-After` header with the number of seconds until the block is lifted.
## Handling Invalid API Key Blocks
### Exponential Backoff (Modified)
If you encounter a `403 Forbidden` error specifically related to an API key block, you should cease attempts for the specified `Retry-After` duration. If no `Retry-After` is provided, assume a 5-minute (300-second) wait.
```javascript JavaScript theme={null}
const axios = require('axios');
async function makeRequestWithBackoff(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await axios(url, options);
return response.data;
} catch (error) {
if (
error.response?.status === 403 &&
error.response?.data?.message?.includes(
'Too many invalid API key attempts'
)
) {
// Get retry-after from header (in seconds), default to 300 (5 minutes)
const retryAfter = parseInt(
error.response.headers['retry-after'] || 300
);
const waitTime = retryAfter * 1000;
console.log(`API key blocked. Waiting ${waitTime / 1000} seconds...`);
await new Promise((resolve) => setTimeout(resolve, waitTime));
// Retry the request after the block period
continue;
}
// Re-throw other errors, including other 403s (e.g., permission issues)
throw error;
}
}
throw new Error('Max retries exceeded for API key block');
}
// Usage
const result = await makeRequestWithBackoff(
'https://www.getsnippets.ai/api/prompts/snippet',
{
method: 'GET',
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: { id: 'snippet_id' },
}
);
```
```python Python theme={null}
import time
import requests
def make_request_with_backoff(
url: str,
headers: dict,
params: Optional[dict] = None,
max_retries: int = 3
) -> dict:
for attempt in range(max_retries):
try:
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
if e.response.status_code == 403 and "Too many invalid API key attempts" in e.response.json().get("message", ""):
# API key blocked - wait and retry
retry_after = int(
e.response.headers.get('Retry-After', 300)
)
print(f"API key blocked. Waiting {retry_after} seconds...")
time.sleep(retry_after)
# Retry the request
continue
# Re-raise other errors, including other 403s
raise
raise Exception('Max retries exceeded for API key block')
# Usage
result = make_request_with_backoff(
'https://www.getsnippets.ai/api/prompts/snippet',
headers={'Authorization': f'Bearer {API_KEY}'},
params={'id': 'snippet_id'}
)
```
## Best Practices
Always ensure you are using a valid and active API key. Double-check your key and its permissions in the Snippets AI dashboard.
{' '}
Distinguish between different 4xx errors. A `401 Unauthorized` means a
generally invalid key, while a `403 Forbidden` *might* indicate a temporary
block if the message specifically mentions "Too many invalid API key
attempts".
{' '}
Do not repeatedly try invalid API keys. This will lead to temporary blocks.
Regularly monitor logs and error reports from your applications to quickly identify if an API key is being blocked.
## FAQs
No, there is no general rate limit for valid API requests. You can make as many valid requests as your account quota allows.
{' '}
Your API key will be temporarily blocked for 5 minutes after 20 invalid
attempts. During this time, all requests with that key will fail.
{' '}
No, requests made with a temporarily blocked API key do not consume from your
API request quota. However, invalid attempts that lead to the block do count
towards the 20-attempt limit.
Repeated and excessive attempts to bypass the security block may lead to a permanent ban of the API key or even the associated workspace. We recommend resolving the underlying issue rather than repeatedly hitting the block.
## Need Help?
If you're having trouble with API key blocks:
Get help from our team
# Create Snippet
Source: https://docs.getsnippets.ai/api-reference/snippets/create-snippet
POST /snippet
Creates a new snippet with optional variations and tags. API Cost: 1 request.
## Overview
Creates a new snippet with optional variations, folder assignment, and tags. This endpoint allows you to create structured snippets programmatically.
**API Cost**: 1 request
## Code Examples
```javascript JavaScript - Basic Snippet theme={null}
const axios = require('axios');
const API_KEY = process.env.SNIPPETS_AI_API_KEY;
const BASE_URL = 'https://www.getsnippets.ai/api/prompts';
async function createSnippet(snippetData) {
try {
const response = await axios.post(`${BASE_URL}/snippet`, snippetData, {
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
});
console.log('Created snippet ID:', response.data.data.snippetId);
console.log('Remaining requests:', response.data.usage.remainingRequests);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
throw error;
}
}
// Basic snippet
const basicSnippet = {
title: 'My API Snippet',
content: {
type: 'plaintext',
content: "console.log('Hello, World!');",
},
teamId: 'your-team-id',
};
createSnippet(basicSnippet);
```
```javascript JavaScript - Full-Featured Snippet theme={null}
// Snippet with all optional fields
const fullSnippet = {
title: 'Customer Onboarding Email',
content: {
type: 'plaintext',
content: 'Dear {{customer_name}},\n\nWelcome to our platform!',
},
teamId: 'your-team-id',
note: 'Use this template for new customer onboarding',
shortcut: 'welcome_email',
folderId: 'folder-uuid',
tagIds: ['tag-uuid-1', 'tag-uuid-2'],
additionalVariations: [
{
content: {
type: 'plaintext',
content: 'Hola {{customer_name}},\n\nΒ‘Bienvenido!',
},
variationName: 'Spanish Version',
},
{
content: {
type: 'plaintext',
content: 'Bonjour {{customer_name}},\n\nBienvenue!',
},
variationName: 'French Version',
},
],
};
createSnippet(fullSnippet);
```
```python Python theme={null}
import os
import requests
API_KEY = os.environ.get('SNIPPETS_AI_API_KEY')
BASE_URL = 'https://www.getsnippets.ai/api/prompts'
def create_snippet(snippet_data):
try:
response = requests.post(
f'{BASE_URL}/snippet',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
},
json=snippet_data
)
response.raise_for_status()
data = response.json()
print(f"Created snippet ID: {data['data']['snippetId']}")
print(f"Remaining requests: {data['usage']['remainingRequests']}")
return data
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.json().get('message')}")
raise
# Basic snippet
basic_snippet = {
'title': 'My API Snippet',
'content': {
'type': 'plaintext',
'content': 'print("Hello, World!")'
},
'teamId': 'your-team-id'
}
create_snippet(basic_snippet)
```
```bash cURL theme={null}
curl -X POST "https://www.getsnippets.ai/api/prompts/snippet" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "My API Snippet",
"content": {
"type": "plaintext",
"content": "Hello, World!"
},
"teamId": "your-team-id",
"note": "Created via API",
"folderId": "folder-uuid",
"tagIds": ["tag-uuid-1"]
}'
```
## Real-World Use Case: Voice AI Integration
Here's a complete example of creating prompts for a voice AI system (like VAPI):
```javascript theme={null}
async function createVoiceAgentPrompts(clientData) {
const { clientName, industry, teamId, folderId } = clientData;
// Create a snippet with multiple language variations
const snippet = {
title: `${clientName} - ${industry} Agent`,
content: {
type: 'plaintext',
content: `You are a professional ${industry} assistant for ${clientName}.
Your role is to help customers with inquiries, schedule appointments,
and provide information about services. Be polite, professional, and helpful.`,
},
teamId: teamId,
folderId: folderId,
note: `Voice agent prompt for ${clientName}`,
shortcut: `${clientName.toLowerCase()}_agent`,
tagIds: [industryTagId, voiceAgentTagId],
additionalVariations: [
{
content: {
type: 'plaintext',
content: `Eres un asistente profesional de ${industry} para ${clientName}.
Tu funciΓ³n es ayudar a los clientes con consultas, programar citas
y proporcionar informaciΓ³n sobre servicios. SΓ© cortΓ©s, profesional y servicial.`,
},
variationName: 'Spanish Version',
},
{
content: {
type: 'plaintext',
content: `You are handling after-hours calls for ${clientName}.
Inform customers of business hours and offer to schedule a callback
during office hours. Be understanding and helpful.`,
},
variationName: 'After Hours',
},
],
};
try {
const response = await createSnippet(snippet);
console.log(`β
Created voice agent prompt: ${response.data.snippetId}`);
console.log(` Variations: ${response.data.metadata.totalVariations}`);
return response.data.snippetId;
} catch (error) {
console.error(
`β Failed to create prompt for ${clientName}:`,
error.message
);
throw error;
}
}
// Usage
createVoiceAgentPrompts({
clientName: 'Dental Clinic ABC',
industry: 'Healthcare',
teamId: 'healthcare-team-id',
folderId: 'dental-clients-folder-id',
});
```
## Response Example
```json theme={null}
{
"success": true,
"data": {
"snippetId": "550e8400-e29b-41d4-a716-446655440000"
},
"usage": {
"remainingRequests": 99999
},
"metadata": {
"totalVariations": 3,
"tagsAttached": 2
}
}
```
## Validation Rules
**Length**: 1-200 characters Cannot be empty or exceed 200 characters.
Must include `type` and `content` fields.
```json theme={null}
{
"type": "plaintext",
"content": "Your content here"
}
```
Must be a valid team ID that your API key has access to.
**Length**: 0-5000 characters (optional)
**Length**: 0-100 characters (optional)
Must be a valid folder ID in the same team (optional)
Array of valid tag IDs from the same team (optional)
## Batch Creation
To create multiple snippets, use the [batch endpoint](/api-reference/snippets/create-snippets) instead:
```javascript theme={null}
// Instead of this (inefficient):
for (const snippetData of snippets) {
await createSnippet(snippetData); // N API calls + N * rate limit issues
}
// Do this (efficient):
await createSnippets({ snippets }); // 1 API call, N request cost
```
## Error Handling
```javascript Validation Error Handling theme={null}
async function createSnippetSafe(snippetData) {
// Pre-validate before API call
if (!snippetData.title || snippetData.title.length === 0) {
throw new Error('Title is required');
}
if (snippetData.title.length > 200) {
throw new Error('Title cannot exceed 200 characters');
}
if (!snippetData.content) {
throw new Error('Content is required');
}
if (!snippetData.teamId) {
throw new Error('Team ID is required');
}
if (snippetData.note && snippetData.note.length > 5000) {
throw new Error('Note cannot exceed 5000 characters');
}
try {
return await createSnippet(snippetData);
} catch (error) {
const status = error.response?.status;
const message = error.response?.data?.message;
if (status === 400) {
throw new Error(`Validation error: ${message}`);
} else if (status === 403) {
if (message?.includes('team')) {
throw new Error('API key does not have access to this team');
} else if (message?.includes('folder')) {
throw new Error('Folder not found or not accessible');
} else if (message?.includes('tag')) {
throw new Error('One or more tags not found');
}
}
throw error;
}
}
```
## Best Practices
**Validate data before API calls** to catch errors early and save on API costs
**Use meaningful titles** that make snippets easy to identify
**Add notes** to provide context for team members
**Organize with folders** and tags for better management
**Create variations** for different use cases (languages, contexts, etc.)
Always verify that folder IDs and tag IDs exist and belong to the correct team
before creating snippets.
## Related Endpoints
* [Update Snippet](/api-reference/snippets/update-snippet) - Update an existing snippet
* [Create Multiple Snippets](/api-reference/snippets/create-snippets) - Batch create snippets
* [Get Snippet](/api-reference/snippets/get-snippet) - Retrieve a snippet
* [Create Folder](/api-reference/folders/create-folder) - Create a folder first
# Create Multiple Snippets
Source: https://docs.getsnippets.ai/api-reference/snippets/create-snippets
POST /snippets
Creates multiple snippets in a single request. API Cost: N requests (one per snippet).
# Delete Snippet
Source: https://docs.getsnippets.ai/api-reference/snippets/delete-snippet
DELETE /snippet
Deletes a snippet by its ID. API Cost: 1 request.
# Delete Multiple Snippets
Source: https://docs.getsnippets.ai/api-reference/snippets/delete-snippets
DELETE /snippets
Deletes multiple snippets by their IDs. API Cost: N requests (one per accessible snippet).
# Get Snippet
Source: https://docs.getsnippets.ai/api-reference/snippets/get-snippet
GET /snippet
Retrieves a single snippet by its ID. API Cost: 1 request.
## Overview
Retrieves a single snippet by its ID. This endpoint returns the complete snippet data including content, metadata, folder assignment, and timestamps.
**API Cost**: 1 request
## Code Examples
```javascript JavaScript theme={null}
const axios = require('axios');
const API_KEY = process.env.SNIPPETS_AI_API_KEY;
const BASE_URL = 'https://www.getsnippets.ai/api/prompts';
async function getSnippet(snippetId) {
try {
const response = await axios.get(`${BASE_URL}/snippet`, {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {
id: snippetId,
},
});
console.log('Snippet:', response.data.data);
console.log('Remaining requests:', response.data.usage.remainingRequests);
return response.data;
} catch (error) {
if (error.response) {
console.error('Error:', error.response.data.message);
console.error('Status:', error.response.status);
} else {
console.error('Error:', error.message);
}
throw error;
}
}
// Usage
getSnippet('550e8400-e29b-41d4-a716-446655440000');
```
```python Python theme={null}
import os
import requests
API_KEY = os.environ.get('SNIPPETS_AI_API_KEY')
BASE_URL = 'https://www.getsnippets.ai/api/prompts'
def get_snippet(snippet_id):
try:
response = requests.get(
f'{BASE_URL}/snippet',
headers={'Authorization': f'Bearer {API_KEY}'},
params={'id': snippet_id}
)
response.raise_for_status()
data = response.json()
print('Snippet:', data['data'])
print('Remaining requests:', data['usage']['remainingRequests'])
return data
except requests.exceptions.HTTPError as e:
print(f'Error: {e.response.json().get("message")}')
print(f'Status: {e.response.status_code}')
raise
# Usage
get_snippet('550e8400-e29b-41d4-a716-446655440000')
```
```bash cURL theme={null}
curl -X GET "https://www.getsnippets.ai/api/prompts/snippet?id=550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY"
```
```php PHP theme={null}
```
## Response Example
```json theme={null}
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Welcome Email Template",
"content": {
"type": "plaintext",
"content": "Welcome to our platform! We're excited to have you."
},
"snippet_note": "Use for new user onboarding",
"shortcut": "welcome_email",
"folder_id": "660e8400-e29b-41d4-a716-446655440001",
"team_id": "770e8400-e29b-41d4-a716-446655440002",
"workspace_id": "880e8400-e29b-41d4-a716-446655440003",
"is_archived": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "990e8400-e29b-41d4-a716-446655440004"
},
"usage": {
"remainingRequests": 99999
}
}
```
## Use Cases
Retrieve a specific prompt variation for use in voice AI services like VAPI:
```javascript theme={null}
async function getPromptForVoiceAgent(snippetId) {
const response = await getSnippet(snippetId);
const promptContent = response.data.content.content;
// Use with VAPI or similar service
const vapiCall = await initiateVoiceCall({
systemPrompt: promptContent,
phoneNumber: customerPhone
});
return vapiCall;
}
```
Fetch snippet data to display in your application:
```javascript theme={null}
async function displaySnippet(snippetId) {
const response = await getSnippet(snippetId);
const snippet = response.data;
// Render in UI
document.getElementById('snippet-title').textContent = snippet.title;
document.getElementById('snippet-content').textContent =
snippet.content.content;
document.getElementById('snippet-note').textContent =
snippet.snippet_note || 'No notes';
}
```
Check if a snippet exists before performing operations:
```javascript theme={null}
async function safeUpdateSnippet(snippetId, updates) {
try {
// Verify snippet exists
await getSnippet(snippetId);
// Proceed with update
return await updateSnippet(snippetId, updates);
} catch (error) {
if (error.response?.status === 404) {
console.log('Snippet not found, creating new one');
return await createSnippet(updates);
}
throw error;
}
}
```
Implement caching to reduce API calls:
```javascript theme={null}
const cache = new Map();
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
async function getCachedSnippet(snippetId) {
const cached = cache.get(snippetId);
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
console.log('Cache hit - saved 1 API request');
return cached.data;
}
const response = await getSnippet(snippetId);
cache.set(snippetId, {
data: response.data,
timestamp: Date.now()
});
return response.data;
}
```
## Error Handling
```javascript Comprehensive Error Handling theme={null}
async function getSnippetSafely(snippetId) {
try {
return await getSnippet(snippetId);
} catch (error) {
const status = error.response?.status;
const message = error.response?.data?.message;
switch (status) {
case 400:
throw new Error(`Invalid request: ${message}`);
case 401:
throw new Error('Invalid API key - check your authentication');
case 403:
throw new Error('Access denied - check team permissions');
case 404:
throw new Error(`Snippet ${snippetId} not found`);
case 429:
const retryAfter = error.response.headers['retry-after'];
throw new Error(`Rate limit exceeded. Retry after ${retryAfter}s`);
default:
throw new Error(`API error: ${message || 'Unknown error'}`);
}
}
}
```
```python Error Handling with Retry theme={null}
import time
def get_snippet_with_retry(snippet_id, max_retries=3):
for attempt in range(max_retries):
try:
return get_snippet(snippet_id)
except requests.exceptions.HTTPError as e:
if e.response.status_code == 429:
# Rate limit - wait and retry
retry_after = int(e.response.headers.get('Retry-After', 60))
if attempt < max_retries - 1:
print(f'Rate limited. Waiting {retry_after}s...')
time.sleep(retry_after)
continue
elif e.response.status_code == 404:
print(f'Snippet {snippet_id} not found')
return None
elif e.response.status_code in [401, 403]:
print(f'Authentication/permission error')
raise
else:
raise
raise Exception('Max retries exceeded')
```
## Common Issues
**Problem**: The snippet ID doesn't exist or was deleted.
**Solution**:
* Verify the snippet ID is correct
* Check if the snippet was deleted
* Ensure the snippet belongs to your workspace
{' '}
**Problem**: Your API key doesn't have access to the snippet's team.
**Solution**: - Check your API key's team permissions - Ensure the API key has
access to the required team - Verify your workspace subscription is active
**Problem**: Invalid or missing API key.
**Solution**:
* Check the Authorization header is properly formatted
* Verify your API key is active
* Ensure you're using `Bearer YOUR_API_KEY` format
## Best Practices
**Use caching** for frequently accessed snippets to reduce API calls
**Implement error handling** for all possible error scenarios
**Store snippet IDs** persistently to avoid lookup operations
**Monitor usage** through the response's usage field
**Validate IDs** before making requests to avoid unnecessary API calls
Don't fetch snippets in tight loops without caching - this will quickly
exhaust your API quota and hit rate limits.
## Related Endpoints
* [Get Multiple Snippets](/api-reference/snippets/get-snippets) - Fetch multiple snippets at once
* [Create Snippet](/api-reference/snippets/create-snippet) - Create a new snippet
* [Update Snippet](/api-reference/snippets/update-snippet) - Update an existing snippet
* [Get Snippet Variation](/api-reference/variations/get-variation) - Get a specific variation
# Get Multiple Snippets
Source: https://docs.getsnippets.ai/api-reference/snippets/get-snippets
GET /snippets
Retrieves multiple snippets by their IDs. API Cost: N requests (one per accessible snippet).
# Update Snippet
Source: https://docs.getsnippets.ai/api-reference/snippets/update-snippet
PUT /snippet
Updates an existing snippet. API Cost: 1 request.
# Create Tag
Source: https://docs.getsnippets.ai/api-reference/tags/create-tag
POST /tag
Creates a new tag. API Cost: 1 request.
# Create Multiple Tags
Source: https://docs.getsnippets.ai/api-reference/tags/create-tags
POST /tags
Creates multiple tags in a single request. API Cost: N requests (one per tag).
# Delete Tag
Source: https://docs.getsnippets.ai/api-reference/tags/delete-tag
DELETE /tag
Deletes a tag and its associations with snippets. API Cost: 1 request.
# Delete Multiple Tags
Source: https://docs.getsnippets.ai/api-reference/tags/delete-tags
DELETE /tags
Deletes multiple tags by their IDs. API Cost: N requests (one per tag).
# Get Tag
Source: https://docs.getsnippets.ai/api-reference/tags/get-tag
GET /tag
Retrieves a tag's metadata and its associated snippets. API Cost: 1 + N requests (1 for tag + N for snippets).
# Get Multiple Tags
Source: https://docs.getsnippets.ai/api-reference/tags/get-tags
GET /tags
Retrieves multiple tags by their IDs. API Cost: N requests (one per accessible tag).
# Update Tag
Source: https://docs.getsnippets.ai/api-reference/tags/update-tag
PUT /tag
Updates an existing tag. API Cost: 1 request.
# Update Multiple Tags
Source: https://docs.getsnippets.ai/api-reference/tags/update-tags
PUT /tags
Updates multiple tags in a single request. API Cost: N requests (one per tag).
# Usage & Billing
Source: https://docs.getsnippets.ai/api-reference/usage-billing
Understand API usage costs and billing
## Pricing Overview
The Snippets AI API uses a simple, transparent pricing model:
**\$10 USD per 100,000 requests** Pay only for what you use with no hidden fees
### What Counts as a Request?
Each API call counts toward your usage quota. The cost varies by endpoint:
* **Single resource operations**: 1 request (GET, POST, PUT, DELETE one item)
* **Batch operations**: N requests (where N = number of items processed)
* **Paginated operations**: 1 + N requests (1 for metadata + N for items returned)
## Request Costs by Endpoint
### Snippets
Fetch a single snippet
Create a new snippet
Update a snippet
Delete a snippet
Fetch multiple snippets - costs 1 request per accessible snippet
Create multiple snippets - costs 1 request per snippet created
Delete multiple snippets - costs 1 request per accessible snippet deleted
### Variations
Fetch a single variation
Update a variation
Delete variation(s) - costs 1 request per variation deleted
Get version history - costs 1 request per history record returned
### Folders
Get folder with snippets - costs 1 request for folder + 1 per snippet returned
Create a folder
Update a folder
Delete a folder (contained snippets are orphaned)
Get multiple folders - costs M requests for folders + N for total snippets
Create multiple folders - costs 1 request per folder
Update multiple folders - costs 1 request per folder
Delete multiple folders - costs 1 request per folder
### Tags
Get tag with snippets - costs 1 request for tag + 1 per snippet returned
Create a tag
Update a tag
Delete a tag
Get multiple tags - costs 1 request per accessible tag
Create multiple tags - costs 1 request per tag
Update multiple tags - costs 1 request per tag
Delete multiple tags - costs 1 request per tag
## Understanding Request Costs
### Single Operations (1 Request)
Simple operations on single resources always cost 1 request:
```javascript theme={null}
// Cost: 1 request
const snippet = await api.get('/snippet', {
params: { id: 'snippet_uuid' },
});
// Cost: 1 request
const result = await api.post('/folder', {
folderName: 'My Folder',
folderColor: '#3B82F6',
teamId: 'team_uuid',
});
```
### Batch Operations (N Requests)
Batch operations cost N requests, where N is the number of items:
```javascript theme={null}
// Cost: 10 requests (one per snippet)
const snippets = await api.get('/snippets', {
params: { ids: '["id1", "id2", ..., "id10"]' },
});
// Cost: 5 requests (one per folder created)
const result = await api.post('/folders', {
folders: [
/* 5 folder objects */
],
});
```
### Paginated Operations (1 + N Requests)
Operations that return a resource plus a list of items:
```javascript theme={null}
// Cost: 1 (folder) + 20 (snippets) = 21 requests
const folder = await api.get('/folder', {
params: {
folderId: 'folder_uuid',
limit: 20, // Returns up to 20 snippets
},
});
// To minimize costs, use smaller limit values:
// Cost: 1 + 5 = 6 requests
const folder = await api.get('/folder', {
params: {
folderId: 'folder_uuid',
limit: 5, // Returns only 5 snippets
},
});
```
## Checking Your Usage
Every API response includes usage information:
```json theme={null}
{
"success": true,
"data": {
/* response data */
},
"usage": {
"remainingRequests": 99750
}
}
```
For batch operations, you also get cost details:
```json theme={null}
{
"success": true,
"data": {
/* response data */
},
"usage": {
"remainingRequests": 99750,
"usageDeducted": 250
},
"metadata": {
"requestedCount": 250,
"accessibleCount": 250
}
}
```
## Cost Optimization Strategies
While batch endpoints are convenient, they can be expensive. Optimize by:
```javascript theme={null}
// β Expensive: Fetching 1000 snippets
// Cost: 1000 requests
const result = await api.get('/snippets', {
params: { ids: thousandSnippetIds }
});
// β
Better: Fetch only what you need
// Cost: 10 requests
const result = await api.get('/snippets', {
params: { ids: tenMostRecentIds }
});
// β
Best: Use pagination to spread costs
// Cost: 1 + 10 = 11 requests
const folder = await api.get('/folder', {
params: { folderId: 'id', limit: 10, offset: 0 }
});
```
Reduce API calls by caching frequently accessed data:
```javascript theme={null}
class SnippetCache {
constructor(ttl = 5 * 60 * 1000) { // 5 minutes
this.cache = new Map();
this.ttl = ttl;
}
async get(id) {
const cached = this.cache.get(id);
if (cached && Date.now() - cached.timestamp < this.ttl) {
console.log('Cache hit - saved 1 request');
return cached.data;
}
// Cache miss - fetch from API
const data = await fetchSnippet(id);
this.cache.set(id, {
data,
timestamp: Date.now()
});
return data;
}
invalidate(id) {
this.cache.delete(id);
}
}
```
When fetching folders or tags with snippets, use appropriate pagination:
```javascript theme={null}
// β Expensive: Fetch all snippets at once
// If folder has 1000 snippets, cost: 1 + 1000 = 1001 requests
const folder = await api.get('/folder', {
params: { folderId: 'id', limit: 100 } // max limit
});
// β
Efficient: Fetch only what's needed for UI
// Cost: 1 + 20 = 21 requests
const folder = await api.get('/folder', {
params: { folderId: 'id', limit: 20 } // show 20 per page
});
// Load more on demand
const nextPage = await api.get('/folder', {
params: { folderId: 'id', limit: 20, offset: 20 }
});
```
Version history can be expensive if not limited:
```javascript theme={null}
// β Expensive: Fetch all history
// If variation has 500 versions, cost: 500 requests
const history = await api.get('/snippet/variation/history', {
params: { variationId: 'id' } // no limit
});
// β
Efficient: Limit history records
// Cost: 10 requests
const history = await api.get('/snippet/variation/history', {
params: {
variationId: 'id',
limit: 10 // Only last 10 versions
}
});
// β
Even better: Use date filtering
// Cost: ~5 requests (only recent changes)
const history = await api.get('/snippet/variation/history', {
params: {
variationId: 'id',
fromDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
limit: 100
}
});
```
Don't use batch endpoints if you only need a few items:
```javascript theme={null}
// β Wasteful: Using batch endpoint for 1-2 items
// Cost: 2 requests
const result = await api.get('/snippets', {
params: { ids: 'id1,id2' }
});
// β
Efficient: Use single endpoint
// Cost: 2 requests (same cost, but simpler)
const snippet1 = await api.get('/snippet', { params: { id: 'id1' }});
const snippet2 = await api.get('/snippet', { params: { id: 'id2' }});
// β
When batch makes sense (10+ items)
// Much better than 50 individual calls
const result = await api.get('/snippets', {
params: { ids: fiftyIds }
});
```
## Billing Examples
### Example 1: Small Project
**Monthly Usage:**
* 5,000 snippet fetches
* 200 snippet creates
* 100 snippet updates
* 1,000 folder fetches with 10 snippets each
**Total Requests:**
* Snippets: 5,000 + 200 + 100 = 5,300
* Folders: 1,000 Γ (1 + 10) = 11,000
* **Total: 16,300 requests**
**Cost:** $10 Γ (16,300 / 100,000) = **$1.63/month\*\*
### Example 2: Medium Integration
**Monthly Usage:**
* 50,000 snippet fetches
* 5,000 snippet creates
* 10,000 snippet updates
* 5,000 variation fetches
* 2,000 folder operations
**Total Requests:**
* Snippets: 50,000 + 5,000 + 10,000 = 65,000
* Variations: 5,000
* Folders: 2,000
* **Total: 72,000 requests**
**Cost:** $10 Γ (72,000 / 100,000) = **$7.20/month\*\*
### Example 3: High-Volume Application
**Monthly Usage:**
* 500,000 snippet operations
* 100,000 variation operations
* 50,000 folder/tag operations
**Total Requests: 650,000**
**Cost:** $10 Γ (650,000 / 100,000) = **$65/month\*\*
## Monitoring Usage
### In Your Dashboard
Monitor your API usage in real-time:
1. Navigate to **Settings** β **API Usage**
2. View current billing period usage
3. See breakdown by endpoint
4. Track daily/weekly trends
5. Set usage alerts
### In API Responses
Track usage programmatically:
```javascript theme={null}
class UsageTracker {
constructor() {
this.totalRequests = 0;
this.requestsByEndpoint = {};
}
track(response, endpoint) {
const deducted = response.usage?.usageDeducted || 1;
this.totalRequests += deducted;
this.requestsByEndpoint[endpoint] =
(this.requestsByEndpoint[endpoint] || 0) + deducted;
console.log(`Total requests this session: ${this.totalRequests}`);
console.log(`Remaining quota: ${response.usage?.remainingRequests}`);
// Alert if approaching limit
if (response.usage?.remainingRequests < 1000) {
this.alertLowQuota(response.usage.remainingRequests);
}
}
alertLowQuota(remaining) {
console.warn(`β οΈ Low API quota: ${remaining} requests remaining`);
}
getSummary() {
return {
total: this.totalRequests,
byEndpoint: this.requestsByEndpoint,
estimatedCost: (this.totalRequests / 100000) * 10,
};
}
}
// Usage
const tracker = new UsageTracker();
const response = await api.get('/snippet', { params: { id: 'id' } });
tracker.track(response.data, '/snippet');
// Get summary
console.log(tracker.getSummary());
// {
// total: 125,
// byEndpoint: { '/snippet': 100, '/folder': 25 },
// estimatedCost: 0.0125
// }
```
## Billing Cycle
* **Billing Period**: Monthly (from the 1st to the last day of each month)
* **Usage Reset**: Quota resets on the 1st of each month
* **Payment**: Automatic charge on the 1st for previous month's usage
* **Minimum Charge**: No minimum - pay only for what you use
## Handling Insufficient Quota
When you run out of API requests, you'll receive a `403 Forbidden` error:
```json theme={null}
{
"success": false,
"message": "Insufficient API requests. This operation requires 5 requests but you have 0 remaining.",
"usage": {
"remainingRequests": 0,
"requiredRequests": 5
}
}
```
**Options:**
1. Wait until the next billing cycle (auto-refill on the 1st)
2. Purchase additional request packages
3. Upgrade to a higher plan with larger included quota
## Purchasing Additional Requests
Need more requests before your cycle resets?
Navigate to **Admin** β **API Access**
Click **Add**
Choose package size (100K, 500K, 1M requests)
Complete payment - requests added immediately
## Enterprise Pricing
For high-volume applications, we offer custom enterprise plans:
Higher rate limits and request quotas
24/7 support with SLA guarantees
Discuss enterprise pricing for your organization
## FAQs
Yes, all authenticated requests count toward your quota, including those that return errors. However, if a request fails due to rate limiting (429), it does not count as an additional request.
{' '}
Once you've used all your API requests for the billing period, you'll receive
`403 Forbidden` errors until you purchase additional requests or your quota
resets on the 1st of the next month.
{' '}
No, unused requests do not roll over to the next billing period. We recommend
monitoring your usage to right-size your plan.
{' '}
{' '}
Currently, all API usage is billed. However, new workspaces receive an initial credit to test the API. Contact sales for evaluation credits.
## Need Help?
Discuss custom pricing
# Delete Variation
Source: https://docs.getsnippets.ai/api-reference/variations/delete-variation
DELETE /snippet/variation
Deletes one or more variations. Can delete a single variation via query parameter or multiple via request body. API Cost: N requests (one per variation). Note: Snippets must have at least one variation.
# Get Variation History
Source: https://docs.getsnippets.ai/api-reference/variations/get-history
GET /snippet/variation/history
Retrieves the version history of a snippet variation. API Cost: N requests (one per history record returned).
# Get Variation
Source: https://docs.getsnippets.ai/api-reference/variations/get-variation
GET /snippet/variation
Retrieves a specific variation of a snippet. API Cost: 1 request.
# Update Variation
Source: https://docs.getsnippets.ai/api-reference/variations/update-variation
PUT /snippet/variation
Updates a specific variation. API Cost: 1 request.
# Audio Preview in Snippets
Source: https://docs.getsnippets.ai/guides/audio-preview
Preview and play audio attachments directly in snippet view
## Overview
Audio Preview lets you listen to voice recordings and audio attachments directly within snippets-no need to download or open external players. Whether you've recorded a voice note, attached an audio explanation, or saved a podcast clip, Audio Preview makes it instantly accessible with built-in playback controls.
This feature transforms snippets from text-only into rich, multimedia knowledge bases.
## Why Audio Preview Matters
Audio adds context that text alone can't capture:
* **Tone & Emphasis**: Hear how something should be delivered
* **Faster Creation**: Speak instead of type (much faster)
* **Accessibility**: Alternative format for different learning styles
* **Nuance**: Explain complex concepts verbally
* **Multilingual**: Pronunciation guides, language learning
## How It Works
### Viewing Audio Snippets
#### In Snippet List
Snippets with audio show indicators:
* **π΅ Icon**: Audio attachment present
* **Duration**: Audio length displayed (e.g., "2:34")
* **Waveform Thumbnail**: Visual preview of audio (if enabled)
## What's Next
Learn about full video and audio prompt features
Preview audio in Quick Access before inserting
Share snippets with audio via public links
# Copy Snippets Between Teams
Source: https://docs.getsnippets.ai/guides/copy-snippets-teams
Duplicate snippets to multiple teams within the same workspace
## Overview
Copy Snippets Between Teams duplicates snippets from one team to another within the same workspace, keeping the original intact. This is ideal when multiple teams need the same snippet, when creating variations for different contexts, or when sharing resources across departments.
Unlike moving, copying preserves the original-you end up with two independent copies.
## Why Copy Between Teams?
Common scenarios:
### Shared Resources
```
Engineering Team:
π "API Documentation Template"
β Copy to β
Product Team:
π "API Documentation Template" (same content)
Both teams use the same template independently.
```
### Adapted Variations
```
Frontend Team:
π "Component Testing Guide"
β Copy to β
Backend Team:
π "Component Testing Guide" (adapt for backend testing)
Similar process, customized per team.
```
### Cross-Functional Workflows
```
Sales Team:
π "Product Demo Script"
β Copy to β
Customer Success Team:
π "Product Demo Script" (for onboarding demos)
Same content, different use cases.
```
## How It Works
### Step-by-Step: Copy Single Snippet
#### 1. **Select Snippet**
Find snippet in its current team.
#### 2. **Right-Click (RMB)**
Right-click or Ctrl+Click (Mac) on snippet.
#### 3. **Select "Copy to Team"**
Context menu:
* Copy to Workspace
* **Copy to Team** β Select this
* Move to Team
* Delete
* ...other options
#### 4. **Choose Destination Team**
Dialog shows teams in current workspace.
Can include current team (to duplicate within same team).
#### 5. **Select Folder**
Choose destination folder:
* Root level
* Existing folder
* Create new folder
#### 6. **Confirm Copy**
Click "Copy" button.
**Result:**
* Original snippet unchanged in source team
* New copy appears in destination team
* Both snippets are independent
### Copy Multiple Snippets
Batch copy operations:
#### 1. **Select Multiple**
* `Cmd/Ctrl + Click` for individual snippets
* `Shift + Click` for range selection
#### 2. **Right-Click Selection**
Menu shows "Copy X snippets to team"
#### 3. **Choose Destination**
Select a team.
## What Gets Copied
### Included
β
**Content:**
* Full text content
* Syntax highlighting settings
* Description
β
**Metadata:**
* Snippet name
* Creation date (original)
* Creator (you become creator of copy)
β
**Attachments:**
* Audio files
* Video embeds
* File attachments
β
**Tags:**
* All tags copied
* Tags created in destination if not present
### Not Copied
β **Team-Specific:**
* Favorites status (must re-favorite)
* Shortcuts (must reassign)
* View count/analytics
* Edit history (starts fresh)
## After Copying
### Two Independent Snippets
```
Source Team:
π "Original Snippet"
Destination Team:
π "Original Snippet" (copy)
```
**Key Point:** Changes to one don't affect the other.
### Edit Separately
```
Source Team - Original:
π "API Template"
// General-purpose version
Destination Team - Adapted:
π "API Template"
// Customized for this team's needs
```
Both can evolve independently.
### No Sync
There's no automatic synchronization:
* Update source β destination unchanged
* Update destination β source unchanged
To sync manually, copy again (creates duplicate) or manually merge changes.
## Use Cases
### Standard Operating Procedures
**Scenario:** Every team needs the same process document.
```
Operations Team creates:
π "Incident Response Procedure"
Copy to:
- Engineering Team
- Product Team
- Customer Success Team
- Marketing Team
All teams have the procedure, can add team-specific notes.
```
### Template Distribution
**Scenario:** Create templates for multiple teams to customize.
```
Templates Team:
π "Meeting Notes Template"
π "Project Brief Template"
π "Bug Report Template"
Copy to:
- Engineering Team (customize for engineering)
- Design Team (customize for design)
- Product Team (customize for product)
```
### Knowledge Sharing
**Scenario:** One team develops expertise, shares with others.
```
Frontend Team perfected:
π "React Performance Optimization Guide"
Copy to:
- Mobile Team (applies to React Native)
- Backend Team (reference for understanding frontend)
Knowledge spreads, original remains for frontend.
```
### Onboarding
**Scenario:** New team formed, needs copies of established resources.
```
From Existing Teams, copy essentials to New Team:
- Company style guide
- Communication templates
- Common workflows
- Tool configurations
New team has foundation, can customize as needed.
```
## Copy vs. Move vs. Workspace Copy
| Feature | Copy (Team) | Move (Team) | Copy (Workspace) |
| -------- | ---------------- | -------------- | ------------------------- |
| Scope | Same workspace | Same workspace | Different workspaces |
| Source | Unchanged | Deleted | Unchanged |
| Result | Duplicate | Relocated | Cross-workspace duplicate |
| Use Case | Share within org | Reorganize | Share across orgs |
Choose based on your needs.
## Best Practices
**Copy Standard Resources**: Templates, guides, and SOPs should be copied to
all relevant teams.
**Customize After Copying**: Don't just copy blindly. Adapt copied snippets
for each team's specific needs.
**Mark as Copy**: Consider adding "(Copy)" or "(TeamName version)" to name so
it's clear it's derived.
**Periodic Sync**: If teams need to stay in sync, schedule quarterly reviews
to merge updates.
**Use Shared Team for Originals**: Create a "Shared Resources" team with
master copies. Other teams copy from there.
## Advanced Patterns
### Master Copy Pattern
```
Structure:
π Shared Resources Team (master copies)
π Template A
π Template B
π Template C
π Team 1 (copies, customized)
π Team 2 (copies, customized)
π Team 3 (copies, customized)
Workflow:
1. Update master in Shared Resources
2. Periodically re-copy to teams
3. Teams merge updates with their customizations
```
### Version Control
```
Naming Convention:
Source Team:
π "API Template v1.2"
Destination Team:
π "API Template v1.2 (Marketing version)"
When source updates to v1.3:
Copy again, teams know to update
```
### Copy with Attribution
Add note to copied snippets:
```markdown theme={null}
# Snippet Title
**Copied from:** Engineering Team, 2025-10-12
**Original Creator:** Sarah Johnson
**Adapted for:** Marketing Team
---
[Content here]
```
Maintains attribution and context.
## Permissions
### Required Permissions
**Source Team:**
* Must have read access (Viewer, Editor, or Admin)
**Destination Team:**
* Must be a member
* Must have Editor or Admin role (to create snippets)
**Snippet Ownership:**
* Anyone with read access can copy
* Don't need to be snippet creator
### Access Control
Copied snippet inherits destination team's permissions:
* If destination is private β copy is private
* If destination is public β copy is public
## Troubleshooting
### Can't See Destination Team
If team doesn't appear in copy dialog:
1. **Not a Member**: Join the team first
2. **No Create Permission**: You don't have editor/admin role in destination
3. **Archived Team**: Can't copy to archived teams
### Duplicates Created
If you accidentally copy same snippet multiple times:
* Each copy operation creates a new snippet
* No automatic duplicate detection
* Manually delete extras
**Prevention:** Check destination team before copying.
### Tags Not Appearing
If tags don't show up after copy:
1. Tags should be created automatically in destination
2. May take a moment to sync
3. Refresh page or restart app
## What's Next
Learn when to move instead of copy
Copy snippets across different workspaces
Set up multiple teams to organize your snippets
# Copy Snippets to Another Workspace
Source: https://docs.getsnippets.ai/guides/copy-snippets-workspace
Copy snippets between different workspaces with right-click menu
## Overview
Copy Snippets to Another Workspace lets you duplicate snippets from one workspace to another while keeping the original intact. Perfect for sharing personal snippets with work teams, migrating content between client workspaces, or maintaining separate versions across different organizations.
This guide explains how to copy snippets across workspaces efficiently using the right-click context menu.
## Why Copy Across Workspaces?
Common scenarios:
### Personal to Work
```
Personal Workspace:
π "Debugging Workflow" (perfected over time)
β Copy to β
Work Workspace:
π "Debugging Workflow" (now available to team)
```
Keep personal snippets pristine while sharing with work.
### Client to Client
```
Client A Workspace:
π "Project Template" (worked well)
β Copy to β
Client B Workspace:
π "Project Template" (adapt for new client)
```
Reuse successful patterns across clients.
### Staging to Production
```
Development Workspace:
π "New API Pattern" (tested and approved)
β Copy to β
Production Workspace:
π "New API Pattern" (ready for team use)
```
Promote tested snippets to production.
## How It Works
### Step-by-Step: Copy Single Snippet
#### 1. **Find the Snippet**
Navigate to the snippet you want to copy in the source workspace.
#### 2. **Right-Click Snippet**
Right-click (or Ctrl+Click on Mac) on the snippet in the list.
#### 3. **Select "Copy to Workspace"**
Context menu appears:
* Copy to Clipboard
* **Copy to Workspace** β Select this
* Move to Team
* Delete
* ...other options
#### 4. **Choose Destination**
Dialog appears showing:
* List of all workspaces you're a member of
* Exclude current workspace (source)
Select destination workspace.
#### 5. **Select Team & Folder**
After choosing workspace:
* Select destination team within that workspace
* Choose folder (or root)
* Preview destination path
#### 6. **Confirm Copy**
Click "Copy" button.
**Result:**
* Snippet copied to destination workspace
* Original remains in source workspace
* You now have two independent copies
## What Gets Copied
### Included in Copy
β
**Snippet Content:**
* Full text content
* Code/syntax format
* Description
β
**Metadata:**
* Snippet name
* Syntax highlighting setting
* Creation date (original)
β
**Attachments:**
* Audio files (if any)
* Video embeds (if any)
* File attachments
β
**Tags:**
* All tags (if they exist in destination)
* New tags created if not present
### Not Copied
β **Workspace-Specific:**
* Favorites status (must re-favorite in new workspace)
* Shortcuts (must reassign in new workspace)
* Edit history/versions (starts fresh)
* View count / analytics
β **Permissions:**
* Access permissions (determined by destination workspace/team)
## After Copying
### Two Independent Snippets
Once copied:
* **Source snippet**: Remains unchanged in original workspace
* **Destination snippet**: New, independent copy in destination workspace
* **No Sync**: Changes to one don't affect the other
### Edit Freely
Edit either copy:
```
Personal Workspace:
π "API Template" (your personal version)
Work Workspace:
π "API Template" (team version with company standards)
```
Both can evolve separately.
### Re-Copy If Needed
To update destination with source changes:
1. Copy again (creates duplicate)
2. Manually merge changes
3. Delete old version
**Note:** No automatic sync between workspace copies.
## Use Cases
### Personal β Work Migration
**Scenario:** Built great snippets personally, now want to share with team.
```
1. Open Personal Workspace
2. Select your best snippets
3. Right-click β Copy to Workspace
4. Choose Work Workspace β Engineering Team
5. Team now has access to your snippets
6. Your personal versions remain intact
```
### Client Project Templates
**Scenario:** Successful project template to reuse with new client.
```
1. In Client A Workspace
2. Find "Project Setup Template"
3. Right-click β Copy to Workspace
4. Choose Client B Workspace
5. Customize for Client B
6. Client A template unchanged
```
### Cross-Company Consulting
**Scenario:** Freelancer with multiple client workspaces.
```
Personal Workspace (Your Templates):
π Consulting Agreement
π Invoice Template
π Project Kickoff
For each new client:
1. Copy templates from Personal β Client Workspace
2. Customize for specific client
3. Maintain master templates in Personal
```
### Training & Onboarding
**Scenario:** Create training workspace, copy snippets from production.
```
1. Production Workspace has live snippets
2. Copy to Training Workspace
3. Trainees practice with real examples
4. No risk to production snippets
```
## Best Practices
**Copy, Don't Move**: Unless you need to fully migrate, copying is safer. Keep
originals as backup.
**Organize Before Copying**: Create destination folders/teams first. Makes
copying smoother.
**Document Adaptations**: If you customize copied snippets, add note about
what changed and why.
**Maintain Master Copy**: Keep a "master" version in one workspace. Copy from
master to others as needed.
## Comparing Copy Options
| Action | Source | Destination | Use Case |
| --------------------------------- | --------- | ----------- | --------------------------- |
| **Copy to Workspace** | Unchanged | New copy | Share across organizations |
| **Copy to Team** (same workspace) | Unchanged | New copy | Share within organization |
| **Move to Team** (same workspace) | Deleted | Moved | Reorganize within workspace |
Choose based on your needs.
## Permissions
### Required Permissions
To copy snippets:
**Source Workspace:**
* Must have read access to snippet
* View or Editor role sufficient
**Destination Workspace:**
* Must be a member
* Must have Editor or Admin role (to create snippets)
### Access Control
Copied snippet inherits destination's access rules:
* If destination team is private β snippet is private
* If destination team is public β snippet is public
* Source access rules don't carry over
## Troubleshooting
### Can't See Destination Workspace
If workspace doesn't appear in "Copy to Workspace" list:
1. **Not a Member**: You're not a member of that workspace (join first)
2. **No Create Permission**: You don't have permission to create snippets there
3. **Archived Workspace**: Workspace is archived (can't copy to archived workspaces)
### Copy Failed
If copy operation fails:
1. **Check Permissions**: Verify you can create snippets in destination
2. **Network Issue**: Check internet connection
3. **Large Attachments**: Audio/video files may be too large (check limits)
4. **Try Again**: Temporary error-retry the operation
### Duplicates Created
If you accidentally copy same snippet multiple times:
1. Duplicates will exist in destination (no automatic merge)
2. Manually review and delete duplicates
3. Use Workspace Search to find duplicates: `name:"Snippet Name"`
## What's Next
Learn how to move snippets between teams in the same workspace
Copy snippets to another team within same workspace
Manage multiple workspace accounts
# Creating Teams
Source: https://docs.getsnippets.ai/guides/create-team
Create and manage teams within your workspace
## Overview
Teams are the organizational layer within Snippets AI workspaces that allow you to segment snippets by department, project, or any logical grouping. Each workspace can contain multiple teams, and each team has its own collection of snippets, folders, and members.
Understanding the workspace β team β snippets hierarchy is key to scaling Snippets AI across your organization.
## The Hierarchy
Snippets AI uses a three-level hierarchy:
```
π’ Workspace (Company/Organization)
ββ π₯ Team (Department/Project)
ββ π Snippet (Individual snippets)
```
**Example:**
```
π’ Acme Corp Workspace
ββ π₯ Legal Team
β ββ π NDA Template, Contract Clauses...
ββ π₯ Frontend Team
β ββ π React Components, CSS Utils...
ββ π₯ Backend Team
β ββ π API Routes, DB Queries...
ββ π₯ Prompt Engineering Team
ββ π ChatGPT Prompts, Claude Prompts...
```
## Why Use Teams?
Teams provide critical benefits:
* **Isolation**: Keep team snippets separate and focused
* **Permissions**: Control who can access which snippets
* **Organization**: Scale to hundreds of team members without chaos
* **Context**: Switch between team contexts easily
* **Collaboration**: Team members only see relevant snippets
## How It Works
### Step-by-Step: Creating a Team
#### 1. **Open Workspace Settings**
In the Snippets AI app:
* Click on your workspace name at the top
* Select "Workspace Settings" from dropdown
* Navigate to the "Teams" section
#### 2. **Click "Create New Team"**
Look for the "+ New Team" button or "Create Team" option.
#### 3. **Name Your Team**
Choose a clear, descriptive name:
**Good Team Names:**
* β
Frontend Development
* β
Customer Support
* β
Sales Outreach
* β
AI Prompt Engineering
* β
Legal & Compliance
**Avoid:**
* β Team 1
* β Misc
* β Unnamed Team
#### 4. **Add Description (Optional)**
Provide context for team members:
```
Frontend Development Team
This team contains all React components, CSS utilities,
and frontend-related snippets. All frontend engineers
should have access.
```
#### 5. **Set Team Settings**
Configure team options:
* **Visibility**: Private (team members only) or Internal (all workspace members can view)
* **Default Permissions**: Can members create/edit snippets or only view?
#### 6. **Add Team Members**
Invite workspace members to the team:
1. Search for members by name or email
2. Select their role:
* **Admin**: Full control over team
* **Editor**: Can create/edit snippets
* **Viewer**: Can view snippets only
3. Click "Add"
#### 7. **Create the Team**
Click "Create Team" to finalize.
The team appears in the team switcher, and you can start adding snippets.
## Team Roles & Permissions
### Team Admin
* Create, edit, delete any snippet
* Manage team members
* Change team settings
* Delete the team
### Team Editor
* Create new snippets
* Edit own snippets
* View all team snippets
* Cannot manage team settings
### Team Viewer
* View all team snippets
* Use snippets via Quick Access
* Cannot create or edit snippets
* Read-only access
## Switching Between Teams
Once you have multiple teams, you can switch between them:
### In Main App
1. Click team name in sidebar
2. Dropdown shows all your teams
3. Select a team to switch
4. Snippet library updates to show that team's snippets
## Common Team Structures
### By Department
```
π’ Company Workspace
ββ π₯ Engineering
ββ π₯ Product
ββ π₯ Design
ββ π₯ Marketing
ββ π₯ Sales
ββ π₯ Customer Support
```
**Best for:** Traditional company structures, clear departmental boundaries.
### By Project
```
π’ Agency Workspace
ββ π₯ Client A - Website Redesign
ββ π₯ Client B - Mobile App
ββ π₯ Client C - Marketing Campaign
ββ π₯ Internal - Agency Operations
```
**Best for:** Agencies, consultancies, project-based organizations.
### By Function
```
π’ Engineering Workspace
ββ π₯ Frontend
ββ π₯ Backend
ββ π₯ DevOps
ββ π₯ Security
ββ π₯ Data Engineering
```
**Best for:** Large engineering orgs, specialized teams.
### By Use Case
```
π’ AI Development Workspace
ββ π₯ Prompt Engineering
ββ π₯ Code Generation
ββ π₯ API Integrations
ββ π₯ Testing & QA
```
**Best for:** Focused organizations, specific workflow needs.
### Hybrid Approach
```
π’ Startup Workspace
ββ π₯ Product Development
β (Everyone: engineers, designers, PMs)
ββ π₯ Go-to-Market
β (Sales, marketing, support)
ββ π₯ Operations
β (Finance, legal, HR)
ββ π₯ AI & Automation
(Cross-functional: prompts, tools, workflows)
```
**Best for:** Startups, cross-functional work, flexible structures.
## Best Practices
**Start with Few Teams**: Begin with 3-5 core teams. Add more as you grow. Too
many teams creates confusion.
**Clear Naming**: Use descriptive team names that clearly indicate purpose.
Avoid abbreviations or internal jargon.
**Document Team Purpose**: Add descriptions to teams explaining what snippets
belong there and who should join.
**Regular Audits**: Quarterly, review team membership and remove inactive
members. Archive unused teams.
**Cross-Team Snippets**: For snippets needed by multiple teams, create a
"Shared" or "Common" team that everyone joins.
## Managing Teams
### Renaming Teams
1. Click team name in sidebar
2. Select "Team Settings"
3. Change name
4. Save
All members see the updated name immediately.
### Archiving Teams
When a project ends or team is no longer needed:
1. Team Settings β "Archive Team"
2. Snippets are preserved but team is hidden
3. Can be restored later if needed
### Deleting Teams
**Caution:** This is permanent.
1. Team Settings β "Delete Team"
2. Confirm deletion
3. All team snippets are deleted
4. Cannot be undone
**Recommendation:** Archive first, delete later if certain.
### Transferring Team Ownership
If a team admin leaves:
1. Current admin goes to Team Settings
2. Select "Transfer Ownership"
3. Choose new admin
4. Confirm transfer
Or workspace admin can reassign ownership.
## Advanced Use Cases
### Client Projects
Create a team per client:
```
π’ Agency Workspace
ββ π₯ Client: TechCorp
β ββ Subfolders by deliverable
ββ π₯ Client: RetailCo
ββ Subfolders by campaign
```
When project ends, archive the team but keep snippets for reference.
### Onboarding Teams
Create temporary teams for onboarding cohorts:
```
π’ Company Workspace
ββ π₯ Onboarding - Q1 2025
β ββ New hire resources
ββ π₯ Onboarding - Q2 2025
ββ Updated onboarding snippets
```
### Testing & Staging
Separate production from development:
```
π’ Engineering Workspace
ββ π₯ Production Snippets
β ββ Tested, approved snippets only
ββ π₯ Development Snippets
ββ Experimental, WIP snippets
```
Promote snippets from Development to Production after review.
## What's Next
Learn how to quickly switch between teams
Organize snippets within teams using folders and tags
Transfer snippets from one team to another
# Drag & Drop Organization
Source: https://docs.getsnippets.ai/guides/drag-drop-snippets
Organize snippets by dragging and dropping them onto folders and tags
## Overview
Drag & drop is the fastest way to organize snippets in Snippets AI. Instead of using menus or dialogs, simply drag snippets to folders or tags to organize your library instantly. This visual, intuitive approach makes organization feel natural and effortless-even with hundreds of snippets.
This guide shows you every drag & drop interaction available in Snippets AI.
## Why Drag & Drop?
Traditional organization methods are slow:
**Old Way:**
1. Select snippet
2. Right-click β "Move to..."
3. Navigate folder tree in dialog
4. Click OK
5. Repeat for each snippet
**With Drag & Drop:**
1. Drag snippet to folder
2. Done
That's 80% faster, and it works with multi-select for batch operations.
## How It Works
## Dragging Snippets to Folders
### Single Snippet
1. **Click and hold** on a snippet in the main panel
2. **Drag** toward the folder sidebar on the left
3. **Hover** over the target folder
* Folder highlights when ready to receive
4. **Drop** the snippet
* Snippet moves to that folder
### Multiple Snippets
Organize multiple snippets at once:
1. **Select snippets**:
* `Cmd/Ctrl + Click` to select individual snippets
* `Shift + Click` to select a range
2. **Drag the selection** to target folder
3. **Drop** to move all selected snippets
**Visual Feedback:**
* Badge shows number of snippets being dragged (e.g., "5 snippets")
* All selected snippets move together
### Nested Folders
Drag into nested folder hierarchies:
```
π Engineering
π Frontend
π React Components β Drop here
π CSS Utilities
π Backend
```
**Tips:**
* Folders automatically expand when you hover during drag
* Wait \~1 second hovering over a folder to expand it
* Navigate deep hierarchies without releasing the drag
### Reordering Within Folder
Drag snippets up/down to reorder within the same folder:
1. Drag snippet within the snippet list
2. Blue line shows insertion point
3. Drop to reorder
Useful for priority ordering or logical grouping.
## Dragging Snippets to Tags
### Applying Tags
Drag snippets onto tags to apply tags instantly:
1. **Select one or more snippets**
2. **Drag to the Tags section** in sidebar
3. **Hover over target tag**
* Tag highlights
4. **Drop**
* Tag is applied to all dragged snippets
* Snippets remain in their current folder
**Key Point:** This **adds** the tag; it doesn't move the snippet.
### Multiple Tags
Apply multiple tags in sequence:
1. Select snippets
2. Drag to first tag β Drop
3. Snippets remain selected
4. Drag to second tag β Drop
5. Both tags now applied
Or use tag field to add multiple tags at once.
### Removing Tags
**Method 1: Drag to Remove**
* Drag tag pill from snippet β Drag outside β Drop to remove
**Method 2: Click X**
* Click X on tag pill in snippet
### Tag Organization
Drag tags themselves to reorder:
* Drag tags up/down in tag list
* Most-used tags at top for easy access
* Visual organization, doesn't affect functionality
## Advanced Drag & Drop
### Drag to Create Folders
Speed up folder creation:
1. Drag a snippet to the folder sidebar
2. Hover over "+ New Folder" area (if available)
3. Drop β Dialog appears
4. Name new folder β Enter
5. Snippet moves to new folder
Or:
1. Drag snippet between existing folders
2. Drop in empty space
3. "Create folder here" option appears
### Drag Folders to Reorganize
Move entire folder hierarchies:
**Nesting Folders:**
* Drag `Folder A` onto `Folder B`
* `Folder A` becomes a child of `Folder B`
**Unnesting Folders:**
* Drag nested folder to workspace root
* Folder becomes top-level
**Reordering Folders:**
* Drag folder up/down
* Changes position in sidebar
### Drag Files from Desktop
Import snippets by dragging files:
1. Open Finder/Explorer
2. Select `.txt`, `.md`, `.js`, or any text files
3. Drag files to Snippets AI window
4. Drop onto:
* Specific folder β Files imported there
* Main panel β Files imported to current folder
* Tags β Files imported and tagged
See [Import Snippets guide](/guides/import-snippets) for details.
### Drag to Trash
Quick deletion:
1. Drag snippet(s) toward bottom of window
2. Trash icon appears
3. Drop to delete
4. Snippets move to trash (recoverable for 30 days)
### Drag Between Teams/Workspaces
**Within Same Workspace:**
* Open source team in one window
* Open destination team in another (or use split view)
* Drag snippet from source β Drop in destination
* Snippet is **copied** (original remains)
**Note:** Direct cross-team drag may not be available; use "Copy to Team" or "Move to Team" options instead.
## Visual Feedback & Indicators
### During Drag
**Cursor Changes:**
* β Grab hand when dragging
* π« Not allowed when hovering invalid drop targets
* β
Valid drop when over valid targets
**Highlights:**
* Folders highlight when ready to receive
* Tags highlight when hovering
* Blue insertion lines show reorder position
**Ghost Image:**
* Semi-transparent preview of what you're dragging
* Shows snippet thumbnail or count
* Follows cursor
### After Drop
**Success Animation:**
* Brief highlight animation on target
* Snippet appears in new location
* Selection clears (by default)
**Undo Option:**
* Toast notification: "Moved snippet to Folder"
* Click "Undo" to revert
* Available for \~5 seconds
## Keyboard Modifiers
Enhance drag & drop with keyboard modifiers:
### Copy Instead of Move
**Mac:** Hold `Option` while dragging
**Windows/Linux:** Hold `Ctrl` while dragging
* Snippet is copied to destination instead of moved
* Original remains in source folder
* Cursor shows "+" icon
### Force Move
**Mac:** Hold `Cmd` while dragging
**Windows/Linux:** Hold `Alt` while dragging
* Ensures snippet is moved (not copied)
* Useful when default behavior is copy
### Multi-Select During Drag
Hold `Cmd/Ctrl` and click additional snippets while dragging:
* Add more snippets to current drag operation mid-drag
* Advanced technique for power users
## Best Practices
**Use Multi-Select**: Select multiple snippets first, then drag once. Way
faster than dragging one by one.
**Hover to Expand**: When dragging to nested folders, hover over parent
folders to expand them and see subfolders.
**Undo Liberally**: Made a mistake? Undo is available for recent operations.
Experiment freely.
**Tags Don't Move**: Remember that dragging to tags *applies* tags but doesn't
move snippets. Use folders to move.
**Visual Scanning**: Arrange your sidebar with most-used folders and tags at
top for faster drag & drop access.
## Common Workflows
### Bulk Organization
Organize a batch of new snippets:
1. Select all unorganized snippets
2. For each category:
* Select relevant snippets
* Drag to appropriate folder
* Repeat
3. Apply tags as needed:
* Select by topic
* Drag to tags
### Project Cleanup
At end of project, reorganize snippets:
1. Create "Project Archive" folder
2. Select all project snippets
3. Drag to archive folder
4. Remove project-specific tags
### Tag Application Sprint
Quickly tag existing snippets:
1. Sort snippets by type or topic
2. Select first batch
3. Drag to appropriate tag
4. Select next batch
5. Drag to next tag
6. Repeat until all tagged
### Folder Restructuring
Reorganizing folder hierarchy:
1. Drag subfolder out of parent (unnest)
2. Create new parent folder
3. Drag related folders into new parent
4. Reorder folders by dragging up/down
5. Review and adjust
## Troubleshooting
### Drag Not Working
If drag & drop doesn't respond:
1. **Selection Issue**: Ensure snippet is actually selected (click once)
2. **Permissions**: Check if you have edit permissions for the folder
3. **App State**: Try refreshing the app or restarting
4. **Conflicting Modifiers**: Release all keyboard keys and try again
### Drop in Wrong Location
If snippet dropped in wrong place:
1. **Immediately Undo**: `Cmd/Ctrl + Z` or click Undo toast
2. **Try Again**: Use more precise hovering before dropping
3. **Zoom In**: If sidebar is cramped, expand it for easier targeting
### Can't Drag to Certain Folders
If some folders don't accept drops:
1. **Permission Restricted**: You may not have edit access to that folder
2. **Read-Only Team**: Team may be configured as read-only
3. **Archived Folder**: Can't add snippets to archived folders
### Accidental Deletions
If you drag to trash by mistake:
1. Open Trash folder
2. Select deleted snippet(s)
3. Click "Restore"
4. Snippets return to original location
## Performance Tips
### Large Selections
Dragging 100+ snippets at once:
* May have slight delay before operation completes
* Progress indicator appears for large operations
* Don't interrupt-wait for completion
### Over Slow Network
If using Snippets AI with slow internet:
* Drag operations may take longer to sync
* Continue working-changes queue and sync when ready
* Check sync status icon
## What's Next
Learn more about creating and organizing folders and tags
Drag files from your desktop to import as snippets
Learn other methods for moving snippets across teams
# Folders & Tags Management
Source: https://docs.getsnippets.ai/guides/folders-tags-management
Organize snippets with folders and tags using drag & drop
## Overview
Snippets AI gives you powerful organization tools to keep your snippet library structured and searchable. With folders and tags, you can create a system that scales from dozens to thousands of snippets-and drag & drop makes organization effortless.
This guide shows you how to create, nest, and manage folders and tags to build the perfect organizational structure for your team.
## Why Organization Matters
As your snippet library grows, organization becomes critical:
* **Findability**: Locate snippets in seconds instead of minutes
* **Team Clarity**: Everyone knows where to find and save snippets
* **Scalability**: Structure works with 10 snippets or 10,000
* **Context**: Organize by project, type, team, or any taxonomy you need
* **Efficiency**: Less time organizing, more time using snippets
## How It Works
## Folders
Folders provide hierarchical organization for your snippets.
### Creating Folders
**Method 1: Right-Click Menu**
1. Right-click in the folder list sidebar
2. Select "New Folder"
3. Name your folder
4. Press Enter
**Method 2: Toolbar Button**
1. Click the "+" button in the folders section
2. Enter folder name
3. Press Enter
### Nested Folders
Create nested folder hierarchies for complex organization:
```
π Engineering
π Frontend
π React Components
π CSS Utilities
π TypeScript Types
π Backend
π API Routes
π Database Queries
π Authentication
π DevOps
π Docker
π CI/CD
π Deployment Scripts
```
**To Create Nested Folders:**
1. Click the parent folder to select it
2. Right-click β "New Subfolder"
3. Or drag an existing folder onto another folder to nest it
### Drag & Drop Folders
Reorganize your folder structure effortlessly:
**Moving Folders:**
* Drag a folder onto another folder to nest it
* Drag a folder to root level to unnest it
* Drag folders up/down to reorder at same level
**Visual Feedback:**
* Hover indicator shows where folder will be placed
* Drop zones highlight when dragging
* Can't drop folder into itself (prevented)
### Folder Properties
Each folder can have:
* **Name**: Descriptive folder name
* **Color**: Optional color coding for visual organization
* **Icon**: Custom icon (emoji or icon library)
* **Description**: Optional description for team context
## Tags
Tags provide flexible, non-hierarchical organization that complements folders.
### Creating Tags
**Method 1: In Snippet Editor**
1. Open any snippet
2. Click in the tags field
3. Type tag name and press Enter
4. Tag is created and applied
**Method 2: Tags Panel**
1. Navigate to Tags section in sidebar
2. Click "+" to create new tag
3. Name your tag
4. Apply to snippets as needed
### Tag Naming Conventions
Good tag practices:
**Use Prefixes for Categories:**
```
#type-prompt
#type-code
#type-query
#project-website
#project-mobile-app
#lang-javascript
#lang-python
#lang-sql
#ai-chatgpt
#ai-claude
#ai-cursor
```
**Keep Tags Focused:**
* β
`#authentication`
* β
`#api-design`
* β
`#error-handling`
* β `#this-is-a-very-long-tag-name-that-explains-everything`
### Multiple Tags Per Snippet
Snippets can have multiple tags:
```
Snippet: "React Auth Component"
Tags: #react #frontend #authentication #typescript #component
```
This enables finding the snippet through multiple paths.
### Nested Tags
Create tag hierarchies with prefixes or separators:
**Prefix Method:**
```
#ai
#ai-prompts
#ai-prompts-chatgpt
#ai-prompts-claude
```
**Slash Method:**
```
#code/react
#code/react/hooks
#code/react/components
```
Choose a convention and stick with it team-wide.
### Drag & Drop Tags
Organize tags visually:
**Reordering:**
* Drag tags up/down in the tags list to reorder
* Most-used tags at the top for quick access
**Tag Merging:**
* Drag one tag onto another to merge them
* All snippets with source tag get destination tag
* Useful for consolidating duplicate tags
**Tag Groups:**
* Drag tags into groups (if using prefix system)
* Visual grouping for related tags
## Drag & Drop Organization
The key to fast organization is drag & drop everywhere.
### Dragging Snippets to Folders
1. Select one or more snippets
2. Drag them to target folder in sidebar
3. Drop to move snippets to that folder
**Multi-Select:**
* `Cmd/Ctrl + Click` to select multiple snippets
* `Shift + Click` to select range
* Drag entire selection at once
### Dragging Snippets to Tags
1. Select snippets
2. Drag to tag in sidebar
3. Drop to apply that tag to all selected snippets
### Dragging Files to Import
Import external files by dragging them:
1. Drag `.txt`, `.md`, `.js`, or other text files from Finder/Explorer
2. Drop onto Snippets AI window
3. Files are imported as new snippets (see [Import Snippets guide](/guides/import-snippets))
## Folder vs. Tag Strategy
When to use folders vs. tags:
### Use Folders For:
* **Primary organization structure** (projects, teams, categories)
* **Hierarchical relationships** (parent-child relationships)
* **Team structure** (mirrors your org chart)
* **Sequential workflows** (step 1, step 2, step 3)
### Use Tags For:
* **Cross-cutting concerns** (language, tool, topic)
* **Multiple categorizations** (snippet belongs to multiple contexts)
* **Dynamic grouping** (quick filters)
* **Searchability** (keywords for finding snippets)
### Combined Example:
```
π Folder Structure (Hierarchy):
π Frontend Team
π Components
π Utilities
π Backend Team
π APIs
π Database
π·οΈ Tag Strategy (Cross-cutting):
#javascript #typescript #python
#api #database #auth
#chatgpt #cursor #claude
#production #development #testing
```
A snippet can live in **one folder** but have **multiple tags**.
## Best Practices
**Start Simple**: Begin with a few top-level folders. Add complexity as your
library grows.
**Consistent Naming**: Agree on folder and tag naming conventions with your
team. Document them.
**Don't Over-Organize**: Perfect is the enemy of good. If you spend more time
organizing than using snippets, simplify.
**Use Search**: Even with great organization, search is often faster. Organize
enough to make search effective, not to eliminate search.
**Periodic Cleanup**: Schedule monthly reviews to consolidate tags, remove
duplicates, and refine structure.
## Advanced Organization
### Color Coding Folders
Assign colors to folders for visual scanning:
* π΄ Red: Urgent/Critical snippets
* π’ Green: Approved/Production-ready
* π΅ Blue: In Development
* π‘ Yellow: Needs Review
### Folder Templates
Create folder structure templates for new projects:
```
Project Template:
π New Project
π Planning
π Design
π Development
π Frontend
π Backend
π Database
π Testing
π Documentation
π Deployment
```
Duplicate this structure when starting new projects.
### Tag Taxonomy
Build a comprehensive tag system:
**Purpose Tags:**
* `#template` - Reusable templates
* `#example` - Example code/prompts
* `#reference` - Reference materials
* `#wip` - Work in progress
**Quality Tags:**
* `#tested` - Tested and verified
* `#approved` - Team-approved
* `#draft` - Not finalized
**Context Tags:**
* `#meeting` - For meetings
* `#client` - Client-facing
* `#internal` - Internal use only
## What's Next
Learn more about organizing snippets with drag & drop
Organize snippets within team structures
Import external files to kickstart your organized library
# Import Snippets
Source: https://docs.getsnippets.ai/guides/import-snippets
Import text files to Snippets AI by dragging and dropping them
## Overview
Snippets AI makes it effortless to import your existing snippet collections, code files, notes, or any text-based content. Simply drag and drop files from your computer directly into Snippets AI, and they're instantly converted into organized, searchable snippets.
This guide shows you how to import single files, bulk import entire directories, and migrate from other tools.
## Why Import Matters
You likely already have valuable content scattered across:
* Text files and Markdown notes
* Code snippet files (`.js`, `.py`, `.sql`, etc.)
* Documentation files
* Export files from other snippet managers
* Note-taking apps exports
* Gists and code samples
Import lets you consolidate everything into Snippets AI in minutes, not hours.
## How It Works
## Drag & Drop Import
### Single File Import
1. **Open Finder/Explorer**
* Navigate to the file you want to import
2. **Select the File**
* Click once to select
3. **Drag to Snippets AI**
* Click and hold on the file
* Drag it over to the Snippets AI window
4. **Drop Into Target Location**
Drop onto:
* **Specific Folder**: File imports into that folder
* **Main Panel**: File imports into currently selected folder
* **Empty Space**: File imports into root/current team
5. **Snippet Created**
* New snippet appears with filename as title
* File content becomes snippet content
* Syntax automatically detected based on file extension
### Multiple Files Import
Import many files at once:
1. **Select Multiple Files**
* In Finder/Explorer:
* `Cmd/Ctrl + Click` for individual files
* `Shift + Click` for range
2. **Drag Selection to Snippets AI**
* All files drag together
* Badge shows count (e.g., "12 files")
3. **Drop Into Target**
* All files import into same destination folder
4. **Batch Processing**
* Snippets AI processes files one by one
* Progress indicator shows import status
* All snippets appear when complete
### Folder Import
Import an entire directory:
1. **Drag a Folder** from Finder/Explorer
2. **Drop onto Snippets AI**
3. **Folder Structure Options:**
**Option A: Flatten**
* All files in folder import as snippets
* No subfolder structure preserved
* All snippets in target folder
**Option B: Preserve Structure**
* Each subfolder becomes a folder in Snippets AI
* Nested structure maintained
* Files become snippets in corresponding folders
Choose option in import dialog that appears.
## Supported File Types
### Code Files
All programming languages:
* `.js`, `.jsx` - JavaScript, React
* `.ts`, `.tsx` - TypeScript
* `.py` - Python
* `.rb` - Ruby
* `.go` - Go
* `.rs` - Rust
* `.java` - Java
* `.cpp`, `.c`, `.h` - C/C++
* `.cs` - C#
* `.swift` - Swift
* `.php` - PHP
* `.sql` - SQL
* `.sh`, `.bash`, `.zsh` - Shell scripts
**Syntax Auto-Detection:** Snippets AI automatically detects syntax from file extension.
### Markup & Documentation
* `.md` - Markdown
* `.mdx` - MDX
* `.txt` - Plain text
* `.html` - HTML
* `.css`, `.scss`, `.sass` - Stylesheets
* `.json` - JSON
* `.yaml`, `.yml` - YAML
* `.xml` - XML
* `.tex` - LaTeX
### Configuration Files
* `.env` - Environment variables
* `.config` - Config files
* `.toml` - TOML config
* `.ini` - INI files
* `Dockerfile` - Docker configs
* `.gitignore`, `.dockerignore` - Ignore files
### Other Formats
* `.log` - Log files (imported as text)
* `.csv` - CSV files (imported as text)
* No extension - Imported as plain text
### Unsupported File Types
Binary files are not supported:
* Images (`.png`, `.jpg`, `.gif`)
* Videos (`.mp4`, `.mov`)
* Archives (`.zip`, `.tar`)
* Executables (`.exe`, `.app`)
For media, use the [video/audio attachment features](/guides/video-audio-prompts) instead.
## Import Settings
### Snippet Naming
When importing, Snippets AI uses:
**Default:** Filename becomes snippet name
```
database-query.sql β Snippet name: "database-query"
```
**Custom:** You can rename during import
* Import dialog shows filename
* Edit name before confirming
* Applies to single file imports
**Batch Rename:** For multiple files
* Import with default names
* Bulk rename afterwards using folder actions
### Syntax Detection
Snippets AI auto-detects syntax:
| File Extension | Detected Syntax |
| -------------- | --------------- |
| `.js`, `.jsx` | JavaScript |
| `.ts`, `.tsx` | TypeScript |
| `.py` | Python |
| `.sql` | SQL |
| `.md` | Markdown |
| `.txt` | Plain Text |
**Manual Override:**
* After import, open snippet
* Change syntax via syntax selector
* See [Syntax Highlighting guide](/guides/syntax-highlighting)
### Tag Application
Apply tags during import:
**Method 1: Drop on Tag**
* Drag files to tag in sidebar
* Files import with that tag applied
**Method 2: Import Dialog**
* Some import dialogs allow tag selection
* Choose tags before confirming import
**Method 3: After Import**
* Import files first
* Select all imported snippets
* Drag to tags to apply
## Migration From Other Tools
### From TextExpander
1. **Export from TextExpander**
* File β Export β Text File Format
* Exports as `.txt` files
2. **Import to Snippets AI**
* Drag exported files
* Drop into Snippets AI
* Snippets created from each file
3. **Reorganize**
* Use folders/tags to organize
* Set up shortcuts for text expansion
### From Raycast
1. **Locate Raycast Snippets**
* Raycast stores snippets as JSON
* Export via Raycast settings
2. **Convert to Text Files** (if needed)
* Use script to extract snippets
* Save each as `.txt` or `.md`
3. **Import to Snippets AI**
* Drag files to Snippets AI
* Apply tags for categorization
### From Notion
1. **Export Notion Pages**
* Export as Markdown & CSV
* Downloads `.md` files
2. **Import Markdown Files**
* Drag `.md` files to Snippets AI
* Preserves Markdown formatting
3. **Clean Up Imports**
* Remove Notion metadata if present
* Organize into folders
### From Alfred Snippets
1. **Export Alfred Snippets**
* Alfred Preferences β Snippets β Export
2. **Import JSON or Text Files**
* If plain text, drag to Snippets AI
* If JSON, may need conversion script
3. **Set Up Shortcuts**
* Configure keyboard shortcuts in Snippets AI
### From Gists
1. **Download Gists**
* Clone gist repos or download files from GitHub
2. **Import to Snippets AI**
* Drag gist files
* Syntax auto-detected
3. **Tag by Language or Purpose**
* Apply relevant tags
* Organize by project
## Bulk Import Best Practices
**Organize First**: Create folders in Snippets AI before importing. Drop files
into appropriate folders during import.
**Clean Filenames**: Rename files before importing if they have unclear names.
Filename becomes snippet name.
**Tag During Import**: Drop files on tags or apply tags immediately after
import while they're fresh in mind.
**Import in Batches**: Import related files together (e.g., all SQL queries),
then organize, then import next batch.
**Review After Import**: Quickly scan imported snippets to verify content
imported correctly and syntax detected properly.
## Advanced Import
### CSV Import
Import structured data from CSV:
1. **Prepare CSV**
```csv theme={null}
name,content,tags,folder
Auth Function,const auth = () => {...},javascript auth,Functions
API Call,fetch('/api/data'),javascript api,Utils
```
2. **Import CSV**
* Snippets AI can parse CSV with headers
* Creates snippets with specified tags/folders
3. **Map Columns**
* Import dialog maps CSV columns to snippet fields
* Flexible column mapping
### JSON Import
Import from JSON exports:
```json theme={null}
[
{
"name": "React Component",
"content": "const Component = () => {...}",
"tags": ["react", "component"],
"syntax": "javascript"
}
]
```
Snippets AI can parse this format directly.
### API Import
For programmatic import, use the Snippets AI API:
```javascript theme={null}
const files = await fs.readdir('./snippets');
for (const file of files) {
const content = await fs.readFile(`./snippets/${file}`, 'utf-8');
await fetch('https://api.getsnippets.ai/v1/snippets', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: file.replace(/\.[^/.]+$/, ''), // Remove extension
content: content,
syntax: detectSyntax(file),
folder_id: 'your-folder-id',
}),
});
}
```
See [API Reference](/api-reference/snippets/create-snippet) for details.
## Troubleshooting
### Import Failed
If files don't import:
1. **Check File Type**: Ensure file is text-based, not binary
2. **File Size**: Very large files (>10MB) may fail; split them up
3. **Permissions**: Ensure Snippets AI has file system access
4. **Encoding**: Files should be UTF-8 encoded
### Wrong Syntax Detected
If syntax highlighting is incorrect:
1. Open imported snippet
2. Click syntax selector
3. Choose correct syntax manually
4. Syntax is saved with snippet
### Duplicate Imports
If you accidentally import same files twice:
1. Use search to find duplicates
2. Select duplicate snippets
3. Delete them
4. Or use "Merge Duplicates" feature if available
## What's Next
Learn how to organize imported snippets with drag & drop
Adjust syntax highlighting for imported code snippets
Use the API for programmatic bulk import
# Move Snippets Between Teams
Source: https://docs.getsnippets.ai/guides/move-snippets-teams
Move snippets from one team to another within the same workspace
## Overview
Move Snippets Between Teams transfers snippets from one team to another within the same workspace, removing them from the source team. This is perfect for reorganizing your workspace, correcting misplaced snippets, or transferring ownership as team responsibilities change.
Unlike copying, moving is a one-way transfer-the snippet is removed from its original location.
## Why Move Between Teams?
Common scenarios:
### Reorganization
```
Before:
Frontend Team:
π "API Helper Function" (belongs in backend)
After:
Backend Team:
π "API Helper Function" β (moved)
```
Correct team placement for better organization.
### Team Transitions
```
Development Team:
π "Feature X Snippets" (feature complete)
β Move to β
Production Team:
π "Feature X Snippets" (production-ready)
```
Promote snippets as they move through workflow stages.
### Responsibility Transfer
```
Consultant Team:
π "Client Onboarding Process" (project ending)
β Move to β
Internal Team:
π "Client Onboarding Process" (permanent home)
```
Transfer ownership when roles change.
## How It Works
### Step-by-Step: Move Single Snippet
#### 1. **Select Snippet**
Find the snippet in its current team.
#### 2. **Right-Click (RMB)**
Right-click or Ctrl+Click (Mac) on the snippet.
#### 3. **Select "Move to Team"**
Context menu appears:
* Copy to Workspace
* Copy to Team
* **Move to Team** β Select this
* Delete
* ...other options
#### 4. **Choose Destination Team**
Dialog shows:
* List of all teams in current workspace
* Excludes current team (can't move to itself)
Select destination team.
#### 5. **Select Folder**
Choose where in destination team:
* Root (no folder)
* Existing folder
* Create new folder
#### 6. **Confirm Move**
Click "Move" button.
**Result:**
* Snippet disappears from source team
* Snippet appears in destination team
* All metadata preserved
### Move Multiple Snippets
Batch moves:
#### 1. **Select Multiple**
* `Cmd/Ctrl + Click` for individual selection
* `Shift + Click` for range
#### 2. **Right-Click Selection**
Context menu shows "Move X snippets to team"
#### 3. **Choose Destination**
Select team and folder as above.
#### 4. **Bulk Move**
All selected snippets moved together.
Progress indicator for large batches.
## What Happens During Move
### Preserved
β
**Snippet Content:**
* Full text content
* Syntax highlighting
* Description
β
**Metadata:**
* Snippet name
* Creation date
* Last modified date
* Creator attribution
β
**Attachments:**
* Audio files
* Video embeds
* File attachments
β
**Tags:**
* All existing tags
* New tags created in destination if needed
β
**History:**
* Edit history/versions preserved
* Full version control intact
### Changed
π **Team Association:**
* Was: Source Team
* Now: Destination Team
π **Folder Location:**
* Placed in selected destination folder
* Folder structure doesn't transfer (choose new location)
### Not Preserved
β **Team-Specific:**
* Favorites status (removed if favorited)
* Shortcuts (cleared-must reassign)
* Team-specific permissions
## Move vs. Copy
| Feature | Move | Copy |
| ----------- | -------------------- | ------------------ |
| Original | Deleted | Remains |
| Destination | New location | New copy |
| Use Case | Reorganize | Share/duplicate |
| Reversible | Manual undo | Original intact |
| Best For | One correct location | Multiple locations |
**Use Move when:**
* Snippet belongs in different team
* Cleaning up organization
* Transferring ownership
**Use Copy when:**
* Need snippet in multiple teams
* Want to adapt for different contexts
* Keeping original as backup
## Use Cases
### Misplaced Snippets
**Scenario:** Snippet created in wrong team.
```
1. Created in "Marketing Team" by mistake
2. Should be in "Engineering Team"
3. Right-click β Move to Team β Engineering
4. Problem solved
```
### Project Lifecycle
**Scenario:** Snippets progress through stages.
```
Development β Testing β Production
As features are completed:
1. Move snippets from Development to Testing
2. After testing, move to Production
3. Clear progression, organized workspace
```
### Team Restructuring
**Scenario:** Company reorganizes teams.
```
Old Structure:
Web Team: Frontend + Backend snippets
New Structure:
Frontend Team
Backend Team
Action:
1. Move backend snippets from Web β Backend Team
2. Move frontend snippets from Web β Frontend Team
3. Archive or delete Web Team
```
### Ownership Transfer
**Scenario:** Team member leaving, snippets need new home.
```
Sarah's Personal Team:
π Customer Support Scripts
Sarah leaving company:
1. Move scripts to Customer Support Team
2. Team continues using them
3. Knowledge retained
```
## Best Practices
**Think Before Moving**: Moving is destructive to source. Consider copying if
you're unsure.
**Communicate with Team**: If moving shared snippets, notify team members who
might be using them.
**Batch Similar Moves**: Move related snippets together. Easier to track and
undo if needed.
**Update Documentation**: If team wikis reference moved snippets, update
links.
**Favorite Before Moving**: If snippet was favorited, re-favorite after moving
(favorites don't transfer).
## Permissions Required
### To Move Snippets
**Source Team:**
* Must have Edit or Admin permissions
* View-only members can't move snippets
**Destination Team:**
* Must be a member
* Must have Edit or Admin permissions
**Your Permission:**
* Must own the snippet OR
* Be team admin
Can't move someone else's snippet unless you're admin.
## Undo a Move
Moving is not automatically reversible, but you can undo manually:
### Immediate Undo
If you just moved and realize it was a mistake:
1. **Don't close dialog** (if still open)
2. Some versions have "Undo" button
3. Click to reverse move
### Manual Undo
If dialog is closed:
1. Go to destination team
2. Find the moved snippet
3. Right-click β Move to Team
4. Move back to original team
5. Place in original folder
**Note:** Shortcuts and favorites will need to be reconfigured.
## Bulk Operations
### Moving Entire Folders
While you can't move folders directly, you can move all snippets in a folder:
1. Open folder in source team
2. Select all snippets
3. Right-click β Move to Team
4. All snippets moved together
5. Manually recreate folder structure in destination if needed
### Moving by Tag
Move all snippets with a specific tag:
1. Filter by tag in source team
2. Select all visible snippets
3. Move together to destination team
## Troubleshooting
### Can't Move Snippet
If "Move to Team" is grayed out or fails:
1. **Permission Issue**: You may not have edit rights in source or destination
2. **Read-Only Team**: Source or destination team may be read-only
3. **Archived Team**: Can't move to/from archived teams
4. **Not a Member**: You must be a member of destination team
### Snippet Disappeared
If snippet is missing after move:
1. **Switch to Destination Team**: It moved successfully, you're viewing source team
2. **Use Workspace Search**: Search for snippet name across all teams
### Shortcuts Stopped Working
After moving snippet, shortcuts don't work:
* **Expected**: Shortcuts are team-specific and don't transfer
* **Solution**: Reassign shortcut in destination team
## What's Next
Learn when to copy instead of move
Copy snippets across different workspaces
Navigate between teams after moving snippets
# Public Workspaces & AI Libraries
Source: https://docs.getsnippets.ai/guides/public-workspaces
Join public workspaces from OpenAI, Anthropic, and more to access curated AI prompts
## Overview
Public Workspaces are community-driven snippet libraries that anyone can join. Snippets AI hosts curated collections of AI prompts, code snippets, and workflows from leading AI companies like OpenAI, Anthropic, Google (Gemini), and tool builders like Lovable. Join these workspaces to instantly access thousands of battle-tested prompts and snippets.
Think of Public Workspaces as the "App Store" for prompts-discover, explore, and use the best snippets from the community.
## Why Public Workspaces Matter
Instead of building prompts from scratch:
* **Instant Access**: Use proven prompts immediately
* **Best Practices**: Learn from AI companies and experts
* **Stay Updated**: Libraries update as best practices evolve
* **Community Knowledge**: Benefit from collective expertise
* **Free Resources**: Most public workspaces are completely free
## How It Works
### Finding Public Workspaces
#### In-App Discovery
1. **Open Snippets AI** desktop app
2. **Navigate to "Discover"** or "Public Workspaces" section
3. **Browse featured workspaces:**
* AI Companies (OpenAI, Anthropic, Google)
* Tool-Specific (Cursor, Lovable, Claude)
* Language-Specific (JavaScript, Python, SQL)
* Industry-Specific (Marketing, Sales, Support)
#### Search for Workspaces
Use search to find specific libraries:
```
Search: "OpenAI" β OpenAI Prompt Library
Search: "React" β React Code Snippets
Search: "Sales" β Sales Outreach Templates
```
#### Browse by Category
Filter workspaces by category:
* **AI & Prompts** - ChatGPT, Claude, Gemini prompts
* **Code Snippets** - Language-specific code libraries
* **Productivity** - Templates, workflows, automations
* **Industry** - Sales, marketing, support, legal
### Joining a Public Workspace
#### Simple Join Flow
1. **Find workspace** you want to join
2. **Click "Join Workspace"** button
3. **Instant access** - No approval needed
4. **Workspace appears** in your workspace switcher
That's it! Browse and use snippets immediately.
#### What You Get
When you join a public workspace:
* **Read Access**: View and use all snippets
* **Quick Access**: Snippets appear in Quick Access search
* **Favorites**: Star snippets to add to your Global Favorites
* **Copy to Your Workspace**: Copy snippets to your private workspace for editing
#### What You Can't Do
Public workspaces are read-only:
* β Can't edit existing snippets
* β Can't create new snippets in public workspace
* β Can't delete snippets
**Solution:** Copy snippets to your private workspace to customize.
## Featured Public Workspaces
### OpenAI Prompt Library
**Official prompts from OpenAI:**
* GPT-5 AI prompts
* Best practices for ChatGPT
* Function calling examples
* Prompt engineering techniques
**Why Join:**
Learn directly from the company that built GPT.
### Anthropic Claude Library
**Official Claude prompts:**
* Constitutional AI principles
* Claude-specific prompt formats
* Long-context strategies
* XML-structured prompts
**Why Join:**
Master Claude's unique prompt format.
### Google Gemini Prompts
**Official Gemini resources:**
* Multimodal prompts (text + image)
* Gemini Pro examples
* Google AI best practices
**Why Join:**
Get the most out of Gemini's capabilities.
### Lovable Prompts
**Build websites with AI:**
* Landing page prompts
* Dashboard templates
* Component generation prompts
* UI/UX patterns
**Why Join:**
Speed up Lovable development.
### Cursor Code Library
**AI-first coding:**
* Code generation prompts
* Refactoring templates
* Debugging workflows
* Cursor-specific tips
**Why Join:**
Supercharge your Cursor productivity.
### V0 by Vercel
**UI generation prompts:**
* Component prompts
* shadcn/ui patterns
* Next.js snippets
**Why Join:**
Generate beautiful UIs faster.
### Language-Specific Libraries
**JavaScript/TypeScript:**
* Common utilities
* React patterns
* Node.js snippets
**Python:**
* Data science snippets
* FastAPI templates
* Python utilities
**SQL:**
* Query patterns
* Database schemas
* Optimization techniques
## Using Public Workspace Snippets
### Via Quick Access
1. Open Quick Access (`Option/Ctrl + Space`)
2. Search for snippet name
3. Snippets from public workspaces appear in results
4. Workspace name shown in results
5. Press Enter to insert
**Example:**
```
Search: "chatgpt ai prompt"
Results:
π ChatGPT AI Prompt Template
π OpenAI Prompt Library
Press Enter β Snippet inserted
```
### Via Main App
1. Switch to public workspace using workspace switcher
2. Browse snippets by folder/tag
3. Open snippet
4. Copy content or use Quick Access
### Copy to Your Workspace
Customize public snippets:
1. Open snippet from public workspace
2. Click "Copy to My Workspace"
3. Choose destination:
* Select workspace
* Select team
* Select folder
4. Snippet copied - Edit freely
Your copy is independent of the original.
### Favorite Public Snippets
Build your personal collection:
1. Open snippet from public workspace
2. Click β Star icon
3. Snippet added to Global Favorites
4. Access from Quick Access β Global Favorites tab
Favorites sync across devices.
## Managing Public Workspaces
### Workspace List
View all joined workspaces:
**Settings β Workspaces β Public**
See list of public workspaces you've joined.
### Leave a Workspace
If you no longer need a public workspace:
1. Go to workspace list
2. Find public workspace
3. Click "Leave Workspace"
4. Confirm
Snippets removed from your Quick Access and searches.
**Note:** Favorited snippets remain accessible via Global Favorites.
### Updates & Notifications
Public workspace maintainers add/update snippets:
**Notifications:**
* Get notified when public workspace adds new snippets (if enabled)
* See updates in notification center
* Explore new content
**Automatic Sync:**
* Changes to public workspaces sync automatically
* Always see latest version of snippets
* No manual updates needed
### Best Practices for Public Workspaces
**High Quality Only**: Only publish your best, tested snippets. Quality over
quantity.
**Clear Organization**: Use intuitive folder names and tag consistently.
**Good Descriptions**: Write clear descriptions for each snippet explaining
what it does and when to use it.
**Regular Updates**: Keep your public workspace updated with new snippets and
best practices.
**Community Engagement**: Respond to feedback and questions about your
snippets.
## Discovering Hidden Gems
### Explore Beyond Featured
Don't just join featured workspaces:
1. Search for niche topics
2. Browse by category
3. Check "Trending" workspaces
4. Look at "Recently Added"
### Follow Creators
Some public workspaces are from notable creators:
* AI researchers
* Developer advocates
* Content creators
* Industry experts
Follow creators to see their new public workspaces.
### Community Recommendations
Ask in Snippets AI Discord/Community:
* "Best public workspaces for X?"
* Check community-curated lists
* See most-joined workspaces
## Use Cases
### Learning AI Prompting
Join OpenAI, Anthropic, Google workspaces:
1. Browse their official prompts
2. Copy and experiment
3. Learn prompt engineering techniques
4. Adapt to your use cases
### Building with AI Tools
Join Cursor, Lovable, V0 workspaces:
1. See how experts use these tools
2. Copy proven prompts
3. Speed up your development
4. Learn hidden features
### Language-Specific Development
Join language-specific libraries:
1. Access common code patterns
2. Learn best practices
3. Copy battle-tested snippets
4. Contribute your own (if you publish workspace)
### Industry Templates
Join sales, marketing, legal workspaces:
1. Access professional templates
2. Customize for your company
3. Ensure compliance (legal templates)
4. Speed up workflows
## What's Next
Use Quick Access to search across all your joined public workspaces
Favorite snippets from public workspaces for quick access
Create your own private workspace to organize your snippets
# Quick Access with AI Tools
Source: https://docs.getsnippets.ai/guides/quick-access-ai-tools
Use Quick Access to insert prompts and code in Cursor, Lovable, and other AI tools
## Overview
Quick Access shines brightest when paired with AI development tools. Whether you're building with Cursor, designing in Lovable, or prompting Claude, Quick Access gives you instant access to your best prompts and code snippets-right when you need them.
This guide shows you how to supercharge your AI workflow by combining Quick Access with popular AI tools.
## Why This Matters
AI tools are powerful, but they require good prompts. Quick Access ensures:
* **Consistency**: Use your best prompts every time, not recreate them from memory
* **Speed**: Insert complex prompts in seconds instead of minutes
* **Iteration**: Build a library of refined prompts that improve over time
* **Team Alignment**: Share proven prompts with your team through workspaces
## Quick Access + Lovable
Lovable is an AI website builder that turns prompts into production-ready websites. Quick Access makes it effortless to use your best prompts.
### How to Use with Lovable
#### 1. **Open Lovable's Prompt Box**
Navigate to Lovable and click into the prompt input field where you describe what you want to build.
#### 2. **Trigger Quick Access**
Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux) while your cursor is in the prompt box.
#### 3. **Find Your Prompt**
Search for your saved Lovable prompts:
* Type "lovable landing page"
* Or search by tag: "web-design"
* Or browse your Lovable folder
#### 4. **Insert and Build**
Press `Enter` to insert the prompt. Your detailed, tested prompt is now in Lovable's input, ready to generate your website.
### Example Lovable Prompts to Save
**Landing Page Template**
```markdown theme={null}
Create a modern SaaS landing page with:
- Hero section with gradient background
- Features section (3 columns)
- Pricing table (3 tiers)
- FAQ accordion
- CTA buttons with hover effects
- Mobile responsive
- Dark mode support
Use Tailwind CSS and clean, professional design.
```
**Dashboard UI**
```markdown theme={null}
Build an analytics dashboard with:
- Sidebar navigation
- Top metrics cards showing KPIs
- Line charts for trends
- Data table with sorting/filtering
- Export functionality
- Real-time data updates
Modern, glassmorphism design style.
```
Save these in Quick Access, and you'll never write them from scratch again.
## Quick Access + Cursor
Cursor is the AI-first code editor. Quick Access integrates seamlessly to give you instant access to code snippets and prompting templates.
### How to Use with Cursor
#### 1. **Open Cursor AI Chat**
Open Cursor's AI chat panel (`Cmd/Ctrl + L`) or inline prompt (`Cmd/Ctrl + P`).
#### 2. **Trigger Quick Access**
With your cursor in the prompt field, press `Option/Ctrl + Space`.
#### 3. **Insert Your Prompt**
Search for code generation prompts, debugging templates, or refactoring instructions.
#### 4. **Let Cursor Generate**
Your prompt is inserted, and Cursor's AI generates code based on your saved, tested instructions.
### Example Cursor Prompts to Save
**Code Review Prompt**
```markdown theme={null}
Review this code for:
1. Security vulnerabilities (SQL injection, XSS, etc.)
2. Performance bottlenecks
3. Code smells and anti-patterns
4. Missing error handling
5. Unclear variable names
Provide specific suggestions with code examples.
```
**Refactoring Prompt**
```typescript theme={null}
// Refactor this to:
// - Extract reusable functions
// - Add proper TypeScript types
// - Implement error handling
// - Add JSDoc comments
// - Follow clean code principles
```
**Test Generation**
```javascript theme={null}
Generate unit tests for this function:
- Test happy path scenarios
- Test edge cases and boundaries
- Test error conditions
- Use Jest and TypeScript
- Aim for 100% coverage
```
## Quick Access + ChatGPT / Claude
Use Quick Access with web-based AI tools like ChatGPT and Claude.
### How to Use
1. Open ChatGPT or Claude in your browser
2. Click into the message input field
3. Press `Option/Ctrl + Space` to open Quick Access
4. Search and insert your prompt
### Workflow Example
**Multi-Step Prompt Engineering**
Save each step as a separate snippet:
1. **Context Setup**
```markdown theme={null}
You are an expert backend engineer specializing in Node.js and PostgreSQL.
I'm building a REST API for an e-commerce platform.
```
2. **Task Definition**
```markdown theme={null}
Design a database schema for:
- Users and authentication
- Products and inventory
- Orders and payments
- Reviews and ratings
Include relationships, indexes, and constraints.
```
3. **Output Format**
```markdown theme={null}
Provide:
1. SQL CREATE TABLE statements
2. ER diagram description
3. Index recommendations
4. Sample queries for common operations
```
Insert each snippet in sequence to build complex, structured prompts.
## Quick Access + VS Code
While Cursor is AI-native, VS Code with GitHub Copilot or other extensions also benefits from Quick Access.
### Use Cases
**Copilot Comments**
```javascript theme={null}
// Create a React component that:
// - Accepts a list of items as props
// - Implements virtual scrolling for performance
// - Includes search and filter functionality
// - Has keyboard navigation support
```
**Code Templates**
```typescript theme={null}
// Express.js API route template
import { Router, Request, Response } from 'express';
const router = Router();
router.get('/endpoint', async (req: Request, res: Response) => {
try {
// Implementation
res.json({ success: true });
} catch (error) {
res.status(500).json({ error: error.message });
}
});
export default router;
```
## Quick Access + Other AI Tools
Quick Access works with any application:
### Notion AI
* Open Notion β Quick Access β Insert writing prompts
* Use for documentation templates, meeting notes, project briefs
### Slack
* Quick Access your common responses
* Insert formatted messages and announcements
* Use emoji reactions and formatting
### Email Clients
* Gmail, Outlook, Superhuman
* Insert email templates, follow-ups, cold outreach
### Terminal
* Quick Access bash scripts and commands
* Insert Docker commands, Git workflows, deployment scripts
## Building Your AI Toolkit
Here's how to organize your Quick Access library for AI tools:
### Folder Structure
```
π AI Prompts
π Cursor
- Code Review Template
- Refactoring Prompt
- Test Generation
π Lovable
- Landing Page
- Dashboard
- Form Components
π ChatGPT
- System Prompts
- Chain-of-Thought
- Task Templates
π Claude
- Analysis Prompts
- Writing Assistance
- Code Explanation
```
### Tagging Strategy
Use tags for cross-tool discovery:
* `#prompt-engineering`
* `#code-generation`
* `#frontend` / `#backend`
* `#debugging`
* `#documentation`
## Best Practices
**Test and Refine**: When a prompt works well, save it immediately to Quick
Access. Refine it over time as you learn what works.
**Version Your Prompts**: Use Snippets AI's version control to track prompt
iterations. See what changes improved results.
**Share with Team**: Export your best prompts to your team workspace so
everyone benefits from proven templates.
**Tool-Specific Snippets**: Tag snippets by tool (e.g., #cursor, #lovable) so
you can filter quickly when searching.
## Advanced Workflow
### Prompt Chains
Build multi-step AI workflows:
1. **Step 1**: Context setup snippet
2. **Step 2**: Task definition snippet
3. **Step 3**: Output format snippet
4. **Step 4**: Refinement instructions snippet
Insert each via Quick Access in sequence for complex tasks.
### Dynamic Placeholders
Save snippets with placeholders:
```markdown theme={null}
Create a {COMPONENT_TYPE} component for {PROJECT_NAME} that handles {FUNCTIONALITY}.
Requirements:
- {REQUIREMENT_1}
- {REQUIREMENT_2}
```
Insert via Quick Access, then fill in placeholders manually.
## What's Next
Learn the basics of Quick Access if you haven't already
Learn about text expansion shortcuts as an alternative to Quick Access
Explore public prompt libraries from OpenAI, Anthropic, and more
# Global Favorites in Quick Access
Source: https://docs.getsnippets.ai/guides/quick-access-favorites
Access favorited snippets across all your joined workspaces instantly
## Overview
Global Favorites is a powerful Quick Access feature that shows you favorited snippets from **all** your joined workspaces-not just your current one. This means you can instantly access your most important snippets regardless of which workspace or team you're currently working in.
Think of it as your personal "best of" collection that follows you everywhere.
## Why Global Favorites Matter
When you work across multiple workspaces and teams:
* **Unified Access**: See favorites from all workspaces in one place
* **Cross-Team Efficiency**: Access snippets without switching workspaces
* **Personal Library**: Build a collection of your most-used snippets
* **Context-Free Work**: Don't worry about which workspace a snippet lives in
* **Time Savings**: No more "Where did I save that snippet?" moments
## How It Works
### Step-by-Step Guide
#### 1. **Favorite Snippets Across Workspaces**
First, mark snippets as favorites:
* In the main Snippets AI app, open any snippet
* Click the β star icon to favorite it
* Do this across multiple workspaces
You can favorite snippets from:
* Your personal workspace
* Team workspaces (work, projects, etc.)
* Public workspaces you've joined
#### 2. **Open Quick Access**
Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux).
#### 3. **Navigate to Global Favorites Tab**
In Quick Access, you'll see several tabs at the top:
* **All**: All snippets from current workspace
* **Favorites**: Favorites from current workspace only
* **Global Favorites** β: Favorites from **all** workspaces
Click on the **Global Favorites** tab.
#### 4. **Browse Your Cross-Workspace Favorites**
You'll see all favorited snippets from every workspace you've joined:
* Personal workspace favorites
* Team workspace favorites
* Public workspace favorites
Each snippet shows which workspace it belongs to.
#### 5. **Insert Any Favorite**
Search or scroll to find the snippet you need:
* Press `Enter` to insert it
* Works regardless of your current workspace context
## Understanding the Favorites Hierarchy
### Local Favorites (Favorites Tab)
* Shows favorites from your **current** workspace only
* Fast and focused when you know the snippet is in current workspace
* Best for workspace-specific workflows
### Global Favorites (Global Favorites Tab)
* Shows favorites from **all** joined workspaces
* Comprehensive view of everything you've starred
* Best when you don't remember which workspace has the snippet
### All Tab
* Shows all snippets from current workspace (not just favorites)
* Includes favorited and non-favorited snippets
* Best for exploratory browsing
## Practical Use Cases
### Cross-Company Work
If you're a consultant or freelancer working with multiple clients:
```
Workspace A (Client 1):
β NDA Template
β Invoice Format
Workspace B (Client 2):
β Project Proposal Template
β Status Update Email
Workspace C (Personal):
β Time Tracking Template
β Contract Clauses
```
**Global Favorites shows all 6 at once**, regardless of which client workspace you're in.
### Multi-Team Developer
Working across frontend, backend, and DevOps teams:
```
Frontend Team:
β React Component Template
β CSS Reset
Backend Team:
β API Error Handling
β Database Query Pattern
DevOps Team:
β Docker Compose Template
β CI/CD Pipeline
```
Quick Access Global Favorites shows all your essential snippets across teams.
### Personal + Work Workspaces
Keep work and personal separate but access both:
```
Work Workspace:
β Meeting Notes Template
β Code Review Checklist
Personal Workspace:
β Blog Post Template
β Side Project Ideas
```
Even while in Work workspace, Global Favorites lets you access Personal snippets.
### Public Workspace Integration
Join public workspaces from OpenAI, Anthropic, etc., and favorite key prompts:
```
OpenAI Public Workspace:
β GPT-4 Best Practices
β System Prompt Template
Anthropic Public Workspace:
β Claude Prompt Guide
Your Private Workspace:
β Custom Prompts
```
All accessible via Global Favorites without switching contexts.
## Advanced Features
### Workspace Indicators
Each snippet in Global Favorites shows:
* **Workspace name** or icon
* **Team name** (if applicable)
* **Folder location**
This helps you understand the context of each favorited snippet.
### Search Within Global Favorites
You can search Global Favorites just like regular Quick Access:
* Type to filter favorites by name
* Search by tag across all workspaces
* Use fuzzy search to find snippets quickly
### Favorite Management
**Adding Favorites:**
* Star any snippet in the main app
* Automatically appears in Global Favorites
**Removing Favorites:**
* Unstar a snippet in the main app
* Disappears from Global Favorites immediately
**Syncing:**
* Changes sync in real-time across devices
* Global Favorites updates instantly
## Keyboard Navigation
Navigate Global Favorites efficiently:
* `β` `β` - Navigate through favorite snippets
* `Enter` - Insert selected favorite
## Best Practices
**Star Strategically**: Only favorite snippets you use frequently. Too many
favorites defeats the purpose.
**Use Across Contexts**: Favorite snippets that you need regardless of which
workspace you're in (templates, common responses, etc.).
**Regular Cleanup**: Periodically review and unstar snippets you no longer use
often.
**Combine with Search**: Use Global Favorites tab and then search within it
for fastest access.
## Comparison: Favorites vs Global Favorites
| Feature | Favorites | Global Favorites |
| -------- | ------------------ | ------------------ |
| Scope | Current workspace | All workspaces |
| Use Case | Workspace-specific | Cross-workspace |
| Speed | Very fast | Fast |
| Count | Usually fewer | Can be many |
| Best For | Focused work | Multi-context work |
## Common Workflows
### The "Universal Toolkit" Workflow
1. Identify your 10-20 most-used snippets across all work
2. Favorite all of them (regardless of workspace)
3. Use Global Favorites as your primary Quick Access tab
4. Never worry about workspace context again
### The "Contextual" Workflow
1. Use Favorites tab when working within one workspace
2. Switch to Global Favorites when you need something from another workspace
3. Combines speed (Favorites) with breadth (Global Favorites)
### The "Power User" Workflow
1. Favorite heavily across all workspaces (50+ snippets)
2. Use Global Favorites with search (type immediately after opening)
3. Muscle memory for favorite snippet names
4. Fastest possible access to any snippet
## Troubleshooting
### Snippet Not Appearing in Global Favorites
If a favorited snippet doesn't show:
1. Verify it's actually starred (check in main app)
2. Ensure you've joined the workspace where it lives
3. Refresh Quick Access (close and reopen)
### Too Many Favorites
If Global Favorites feels overwhelming:
1. Review and unstar less-used snippets
2. Use search within Global Favorites instead of browsing
3. Create a more selective favoriting strategy
### Workspace Access Issues
If you can't see favorites from a workspace:
1. Verify you're still a member of that workspace
2. Check if workspace admin removed your access
3. Ensure workspace wasn't deleted
## What's Next
Learn all the basics of Quick Access
Learn about Workspace Search for finding snippets across teams
Learn how to switch between different workspaces and teams
# Snippet Insertion with Quick Access
Source: https://docs.getsnippets.ai/guides/quick-access-insertion
Insert snippets anywhere on your computer using Quick Access
## Overview
Snippet insertion is the core purpose of Quick Access-instantly inserting your saved snippets into any application on your computer. Whether you're writing code, composing emails, chatting in Slack, or prompting AI tools, Quick Access inserts your snippets exactly where you need them.
This guide covers everything about the insertion workflow, from basic usage to advanced techniques.
## Why Quick Access Insertion Matters
Traditional copy-paste workflows are slow and error-prone:
**Old Way:**
1. Open note-taking app
2. Search for snippet
3. Copy to clipboard
4. Switch back to original app
5. Find where you were
6. Paste
**With Quick Access:**
1. Press `Option/Ctrl + Space`
2. Type snippet name
3. Press `Enter`
4. Done in 2 seconds
This 10x speed boost compounds over hundreds of daily insertions.
## How It Works
### Basic Insertion Flow
#### 1. **Position Your Cursor**
Click or tab to position your cursor exactly where you want to insert the snippet:
* Text editor
* Email compose box
* Chat input field
* Terminal
* Any text input anywhere
#### 2. **Open Quick Access**
Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux).
Quick Access opens as a floating window on top of your current application.
#### 3. **Find Your Snippet**
Use any of these methods:
* **Type to search**: Start typing snippet name
* **Browse**: Scroll through your library
* **Filter by tag**: Search for `tagname`
* **Favorites**: Switch to Favorites tab
* **Recent**: Check Recently Used tab
#### 4. **Select the Snippet**
Navigate to your desired snippet:
* Use arrow keys (`β` `β`)
* Or click with mouse
* Preview appears showing full content
#### 5. **Insert**
Press `Enter` or click the snippet.
The snippet text is instantly inserted at your cursor position, and Quick Access closes automatically.
## Where Quick Access Works
Quick Access insertion works in **any application** that accepts text input:
### Code Editors & IDEs
* VS Code, Cursor, Neovim, Sublime Text
* JetBrains IDEs (IntelliJ, PyCharm, WebStorm)
* Xcode, Android Studio
* Online editors (CodeSandbox, StackBlitz)
### AI Tools
* ChatGPT, Claude, Perplexity
* Cursor AI, GitHub Copilot Chat
* Lovable, V0, Bolt
* Any AI tool with text input
### Communication
* Slack, Discord, Microsoft Teams
* Email (Gmail, Outlook, Superhuman)
* Zoom chat, Google Meet
* Any messaging platform
### Productivity Tools
* Notion, Obsidian, Roam
* Linear, Jira, Asana
* Google Docs, Microsoft Word
* Todoist, ClickUp
### Browsers
* Search bars
* Form fields
* Web apps
* Browser DevTools console
### Terminal
* Terminal.app, iTerm2, Hyper
* Windows Terminal, PowerShell
* Any command-line interface
### Anywhere Else
* Native macOS/Windows text inputs
* PDF annotation tools
* Design tools with text fields
* Literally any app with text input
## Advanced Insertion Techniques
### Multi-Line Snippets
Quick Access handles complex, multi-line content:
```python theme={null}
def calculate_total(items, tax_rate=0.08):
"""Calculate total with tax."""
subtotal = sum(item['price'] for item in items)
tax = subtotal * tax_rate
return subtotal + tax
```
Inserts perfectly formatted with proper indentation.
### Code Blocks with Syntax
Insert code with proper formatting:
```javascript theme={null}
const apiRequest = async (endpoint) => {
try {
const response = await fetch(`https://api.example.com/${endpoint}`);
return response.json();
} catch (error) {
console.error('API Error:', error);
throw error;
}
};
```
### Templates with Structure
Insert structured templates:
```markdown theme={null}
## Meeting Notes - {DATE}
**Attendees:**
- **Agenda:**
1.
2.
3.
**Action Items:**
- [ ]
- [ ]
**Next Meeting:**
```
Cursor positions naturally for you to fill in placeholders.
### Large Documents
Even large snippets insert instantly:
* Documentation templates (1000+ lines)
* Configuration files
* SQL schemas
* API response examples
## Insertion Options
### Standard Insertion (Default)
Press `Enter` - Inserts snippet and closes Quick Access.
**Best for:** Most use cases, quick insertion workflow.
### Copy Instead of Insert
Sometimes you want to copy to clipboard instead of direct insertion:
* For apps where insertion doesn't work
* To manually position the content
* To paste multiple times
**How to:** Right-click snippet β "Copy to Clipboard" (or use `Cmd/Ctrl + C` when snippet is selected).
## Insertion in Different Contexts
### Terminal Insertion
Inserting commands in terminal requires care:
```bash theme={null}
# Snippet doesn't auto-execute - you review first
docker-compose up -d && docker-compose logs -f
```
The command is inserted but **not executed** until you press Enter. This safety feature prevents accidental command execution.
### Form Fields
When inserting into web forms:
* Quick Access works in any text input or textarea
* May trigger form validation
* Works with auto-save features
## Keyboard-Only Workflow
Master Quick Access without touching the mouse:
```
1. Option/Ctrl + Space
β Open Quick Access
2. Type search query
β Filter snippets
3. β/β arrow keys
β Navigate results
4. Enter
β Insert and close
5. Continue typing
β Keep working seamlessly
```
## Best Practices
**Cursor First, Quick Access Second**: Always position your cursor before
opening Quick Access. This ensures insertion happens exactly where you want.
**Learn Fuzzy Search**: You don't need to type full snippet names. "dbquery"
will find "Database Query Template".
**Use Favorites for Speed**: Star your most-used snippets so they're one Tab
press away in Quick Access.
**Preview Before Inserting**: Hover or arrow-key to preview snippet content
before inserting-prevents mistakes.
## Common Issues & Solutions
### Insertion Not Working
If Quick Access opens but insertion fails:
1. **Permission Issue**: Snippets AI needs Accessibility permissions
* Mac: System Settings β Privacy & Security β Accessibility β Enable Snippets AI
* Windows: Should work by default, check antivirus settings
2. **App Conflict**: Some apps block external input
* Try copying to clipboard instead (`Cmd/Ctrl + C`)
* Paste manually (`Cmd/Ctrl + V`)
3. **Focus Issue**: Cursor lost focus when Quick Access opened
* Close Quick Access and reposition cursor
* Try again
### Formatting Lost
If inserted snippet loses formatting:
1. **Plain Text Fields**: Some inputs only accept plain text
* Expected behavior in terminals, search bars
2. **Rich Text Conversion**: App converts to its own format
* May need to adjust snippet formatting
3. **Character Encoding**: Special characters not supported
* Check snippet for unsupported characters
### Wrong Location
If snippet inserts in wrong place:
1. **Cursor Position**: Ensure cursor is visible and blinking before opening Quick Access
2. **Multiple Inputs**: If multiple text fields are visible, click the correct one first
3. **Modal Dialogs**: Some overlay dialogs may not accept Quick Access insertion
## Performance Tips
### Instant Insertion
For maximum speed:
1. Memorize your top 10 snippet names
2. Train muscle memory for the full flow: `Shortcut β Type β Enter`
3. Use single-word snippet names for frequently-used items
### Bulk Insertion
When building documents from multiple snippets:
1. Insert first snippet
2. Position cursor for next snippet
3. Quick Access β Insert next
4. Repeat
With practice, you can assemble complex documents in seconds.
## What's Next
Learn all features of Quick Access
Learn about automatic text expansion as an alternative to Quick Access
See specific examples of using Quick Access with Cursor, Lovable, and more
# Quick Access Overview
Source: https://docs.getsnippets.ai/guides/quick-access-intro
Access any snippet from anywhere on your computer with a keyboard shortcut
## Overview
Quick Access is Snippets AI's most powerful feature-a floating window that appears on top of any application, giving you instant access to your entire snippet library. Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux), and your snippets are ready to insert anywhere: ChatGPT, Cursor, VS Code, Slack, email, or any other app.
Think of Quick Access as your personal snippet launcher that follows you everywhere you work.
## Why Quick Access Matters
Quick Access transforms how you work with snippets:
* **Universal Access**: Works in any application on your computer
* **Lightning Fast**: Find and insert snippets in under 2 seconds
* **Context Switching**: Seamlessly move between AI tools, code editors, and communication apps
* **Keyboard-Driven**: Navigate your entire library without touching the mouse
* **Multi-Workspace**: Access snippets from all your joined workspaces instantly
## How It Works
### Step-by-Step Guide
#### 1. **Open Quick Access**
Press the keyboard shortcut:
* **Mac**: `Option + Space`
* **Windows/Linux**: `Ctrl + Space`
A floating window appears on top of your current application, showing your snippet library.
#### 2. **Search for Your Snippet**
Start typing to search:
* Search by snippet name
* Search by tags
* Search by folder name
* Search by content
The search is instant and fuzzy-you don't need to type exact matches.
#### 3. **Preview Before Inserting**
Hover over any snippet to see:
* Full content preview
* Audio/video attachments (if any)
* Tags and folder location
* Last modified date
This ensures you're inserting the right snippet every time.
#### 4. **Insert the Snippet**
Once you find your snippet:
* Press `Enter` to insert it at your cursor position
* Or click on the snippet
* The text is automatically pasted where you were typing
Quick Access closes automatically, and you're back to work.
#### 5. **Navigate with Keyboard**
Quick Access is fully keyboard-driven:
* `β` / `β` arrows to navigate snippets
* `Tab` to switch between tabs (All, Favorites, Recent)
* `Esc` to close Quick Access
* `Enter` to insert selected snippet
## Key Features
### Search Across Everything
Quick Access searches through:
* Snippet names and content
* Tags and folders
* Audio/video descriptions
* All workspaces and teams you've joined
### Tabs for Organization
Quick Access includes several tabs:
**All Snippets**: Your complete library across all teams
**Favorites**: Snippets you've starred for quick access
**Recent**: Recently used snippets
**Global Favorites**: Favorites from all your joined workspaces (not just current one)
### Visual Indicators
Snippets display helpful icons:
* π΅ Audio attachments
* π₯ Video attachments
* β Favorited snippets
* π·οΈ Tags
## Practical Use Cases
### For Developers
**Debugging in VS Code**
```javascript theme={null}
// Quick Access your debugging snippet
console.log('Debug checkpoint:', {
variable,
timestamp: Date.now(),
stack: new Error().stack,
});
```
Press Quick Access β Type "debug" β Insert instantly
**SQL Queries in DataGrip**
```sql theme={null}
-- Access your common queries
SELECT u.*, COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
GROUP BY u.id;
```
### For AI Engineers
**Prompt Engineering**
* Open ChatGPT β Press Quick Access
* Search for "system prompt"
* Insert your battle-tested prompts instantly
**Multi-Tool Workflow**
* Writing code in Cursor β Quick Access your code template
* Testing in Lovable β Quick Access your prompt
* Documenting in Notion β Quick Access your documentation template
### For Teams
**Standardized Responses**
* Customer support in Intercom β Quick Access canned responses
* Sales outreach in email β Quick Access your pitch templates
* Code reviews in GitHub β Quick Access your review checklist
### For Productivity
**Cross-App Workflow**
1. Researching in browser β Quick Access note template
2. Writing in Slack β Quick Access meeting notes
3. Documenting in Jira β Quick Access bug report template
All without leaving your keyboard or switching apps.
## Best Practices
**Master the Shortcut**: Practice opening Quick Access until it becomes muscle
memory. It's the fastest way to boost productivity.
**Organize for Search**: Name your snippets clearly so they're easy to find
via search. Use descriptive tags.
**Use Favorites**: Star your most-used snippets so they appear in the
Favorites tab for instant access.
**Keyboard Navigation**: Learn the arrow keys and Tab navigation-it's faster
than using the mouse.
## Advanced Tips
### Customize the Shortcut
You can change the Quick Access keyboard shortcut in Settings if `Option/Ctrl + Space` conflicts with other apps.
### Resize the Window
Quick Access window is resizable-drag the edges to make it larger or smaller based on your preference.
### Multi-Monitor Support
Quick Access appears on the monitor where your cursor is currently active, making it perfect for multi-screen setups.
## What's Next
Now that you understand Quick Access basics, explore these related guides:
Learn how to use Quick Access with Cursor, Lovable, and other AI tools
Preview audio and video snippets before inserting them
Access favorited snippets across all your workspaces
# Audio & Video Preview in Quick Access
Source: https://docs.getsnippets.ai/guides/quick-access-media-preview
Preview and play audio and video snippets before inserting them
## Overview
Quick Access isn't limited to text snippets-it fully supports audio and video content. Preview and play media snippets directly in the Quick Access window before inserting them, ensuring you select the right content every time.
This feature is perfect for teams that use voice notes, video tutorials, or multimedia instructions alongside text snippets.
## Why Media Preview Matters
Media preview in Quick Access provides:
* **Visual Confirmation**: See video thumbnails before inserting
* **Audio Playback**: Listen to voice notes to confirm the right snippet
* **Faster Selection**: Identify multimedia snippets at a glance
* **Rich Context**: Combine text, audio, and video in your workflow
* **No Context Switching**: Stay in Quick Access without opening the full app
## How It Works
### Step-by-Step Guide
#### 1. **Open Quick Access**
Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux) to open Quick Access.
#### 2. **Search for Media Snippets**
Type to search your library:
* Search by snippet name
* Browse by folder (e.g., "Tutorial Videos")
#### 3. **Identify Media Snippets**
Snippets with audio or video show visual indicators:
* **π΅ Icon**: Audio attachment
* **π₯ Icon**: Video attachment
* **Thumbnail**: Video snippets display a preview thumbnail
#### 4. **Preview the Media**
Hover over or select a media snippet to see the preview panel:
**For Audio Snippets:**
* Audio player with play/pause controls
* Duration display
* Waveform visualization (if available)
* Click play to listen before inserting
**For Video Snippets:**
* Video thumbnail preview
* Play button overlay
* Duration display
* Click to play inline
#### 5. **Insert or Cancel**
Once you've previewed:
* Press `Enter` to insert the snippet (or just the text portion if it's multimedia)
* Press `Esc` to go back to searching
* Click elsewhere to close Quick Access
## Media Types Supported
### Audio Snippets
**Voice Notes**
* Recorded directly in Snippets AI using Whisper
* Imported audio files (MP3, WAV, M4A)
* Transcribed text appears alongside audio
**Use Cases:**
* Voice memos for team instructions
* Audio prompts for AI tools
* Recorded explanations of complex concepts
* Meeting summaries in audio format
### Video Snippets
**Screen Recordings**
* Tutorial walkthroughs
* Bug reproduction videos
* Code review recordings
* Feature demonstrations
**Embedded Videos**
* Vimeo embeds
* YouTube links
* Loom recordings
* Custom video URLs
### Mixed Content
Snippets can contain both text and media:
```markdown theme={null}
# Database Migration Steps
[Video: migration-walkthrough.mp4]
1. Backup current database
2. Run migration script (see video at 2:30)
3. Verify data integrity
4. Update application config
[Audio note: additional-context.mp3]
```
Quick Access shows all components, and you can preview each before inserting.
## Practical Use Cases
### For Developers
**Code Walkthrough Videos**
Save screen recordings explaining complex code:
* Quick Access β Search "auth flow video"
* Preview the video to confirm it's the right one
* Insert the snippet with video link into your documentation
**Debugging Audio Notes**
Record voice notes explaining bugs:
* Quick Access β Find "bug-123 audio"
* Play the audio to hear your past explanation
* Insert into GitHub issue or Jira ticket
### For Product Teams
**Feature Demo Videos**
Share feature demos with stakeholders:
* Quick Access β Search "feature demo"
* Preview video to ensure it's the latest version
* Insert link into Slack or email
**User Interview Recordings**
Save audio from user interviews:
* Quick Access β Search "user feedback"
* Play audio to find specific quotes
* Insert transcription into product brief
### For Training & Onboarding
**Tutorial Videos**
Create onboarding video library:
* Quick Access β Browse "onboarding" folder
* Preview video thumbnails
* Insert relevant tutorial links for new team members
**Process Explanations**
Record audio explaining workflows:
* Quick Access β Search "deployment process"
* Listen to audio refresher
* Insert into team wiki or documentation
### For Content Creators
**Script Recordings**
Save voiceover scripts as audio:
* Quick Access β Find "script v2"
* Play to check which version is final
* Insert into video editing software
**Video Clips**
Store reusable video segments:
* Quick Access β Browse video library
* Preview clips
* Insert into final compilation
## Advanced Features
### Inline Playback Controls
When previewing media in Quick Access:
**Audio Controls:**
* βΆοΈ Play / βΈοΈ Pause
**Video Controls:**
* βΆοΈ Play / βΈοΈ Pause
* π Volume control
### Keyboard Shortcuts
Navigate media snippets with keyboard:
* `β` `β` - Navigate between snippets
* `Enter` - Insert selected snippet
## Best Practices
**Add Text Descriptions**: Always include text descriptions with your media
snippets so they're searchable in Quick Access.
**Use Thumbnails**: For videos, ensure thumbnails are clear so you can
identify content at a glance.
**Tag Your Media**: Use tags like #tutorial, #demo, #voice-note to organize
and filter media snippets.
**Keep It Short**: Best media snippets are under 5 minutes-easier to preview
and more reusable.
## Troubleshooting
### Video Won't Play
If a video doesn't preview:
* Check internet connection (for embedded videos)
* Verify video URL is still valid
* Try opening the full app to play the video
### Audio Not Playing
If audio doesn't work:
* Check system volume settings
* Verify audio file wasn't corrupted during upload
* Try restarting Quick Access
### Slow Loading
If media previews load slowly:
* Large video files may take time to buffer
* Consider compressing videos before uploading
* Use video links instead of embedded files for faster previews
## What's Next
Learn how to create and store video and audio snippets in the main app
Master the basics of Quick Access if you haven't already
Learn about audio preview features in the main Snippets AI app
# Resizing Quick Access Window
Source: https://docs.getsnippets.ai/guides/quick-access-resize
Customize the Quick Access window size to fit your workflow
## Overview
Quick Access is fully customizable-you can resize the floating window to match your workflow preferences. Whether you prefer a compact view that stays out of the way or a large preview window to see more snippets at once, Quick Access adapts to your needs.
This guide shows you how to resize and position Quick Access for optimal productivity.
## Why Resizing Matters
Different workflows need different window sizes:
* **Compact Mode**: Small window for quick snippet insertion without blocking your view
* **Preview Mode**: Larger window to browse snippets with full content previews
* **Multi-Monitor**: Different sizes for different screen configurations
* **Media Heavy**: Larger window to preview video and audio content comfortably
## How to Resize
### Step-by-Step Guide
#### 1. **Open Quick Access**
Press `Option + Space` (Mac) or `Ctrl + Space` (Windows/Linux) to open the Quick Access window.
#### 2. **Locate the Resize Handle**
Move your cursor to any edge or corner of the Quick Access window. The cursor will change to a resize icon (βοΈ or βοΈ).
#### 3. **Drag to Resize**
Click and drag the edge or corner:
* **Edges**: Resize width or height independently
* **Corners**: Resize both width and height simultaneously
* **Smooth Resizing**: The window resizes in real-time as you drag
#### 4. **Release to Set**
Release the mouse button when you reach your desired size. Quick Access remembers this preference.
#### 5. **Automatic Persistence**
Your custom size is saved automatically. Next time you open Quick Access, it will appear at the same size.
## Optimal Sizes for Different Use Cases
### Compact Mode (Small)
**Size**: \~400px Γ 300px
**Best For:**
* Quick snippet insertion
* Minimal screen obstruction
* Laptop screens (13" or smaller)
* When you know exactly what snippet you need
**Workflow:**
```
1. Open Quick Access (small window)
2. Type exact snippet name
3. Press Enter immediately
4. Back to work in <2 seconds
```
### Standard Mode (Medium)
**Size**: \~600px Γ 500px (default)
**Best For:**
* General use
* Balancing preview and screen space
* Single monitor setups
* Browsing snippets while seeing current work
**Workflow:**
```
1. Open Quick Access
2. Search and see 5-7 snippets at once
3. Preview content before inserting
4. Select and insert
```
### Preview Mode (Large)
**Size**: \~900px Γ 700px or larger
**Best For:**
* Media-rich snippets (audio/video)
* Complex snippets with lots of code
* Large monitors (27" or bigger)
* When you want to read full snippet content
* Multi-line code snippets
**Workflow:**
```
1. Open Quick Access (large window)
2. Browse visually through thumbnails
3. Preview full video/audio content
4. Read entire code blocks before inserting
```
### Ultrawide Mode (Extra Large)
**Size**: Full width of monitor, medium height
**Best For:**
* Ultrawide monitors
* Side-by-side snippet comparison
* When working with multiple snippet types simultaneously
* Power users who need maximum visibility
## Positioning on Screen
Quick Access appears where you last positioned it:
### Center Screen (Default)
* Appears in the center of your active monitor
* Best for focused work
* Easy to reach from any application
### Top of Screen
* Move Quick Access to top of screen
* Mimics macOS Spotlight behavior
* Stays out of the way of main content
### Custom Position
* Drag Quick Access anywhere on screen
* Position persists across sessions
* Great for multi-monitor workflows
## Multi-Monitor Support
Quick Access is smart about multiple monitors:
### Active Monitor Detection
* Opens on the monitor where your cursor is currently active
* Automatically detects which screen you're working on
* No need to manually move between monitors
### Per-Monitor Sizing
While Quick Access uses one global size setting, you can:
1. Resize once on your main monitor
2. The size applies to all monitors
3. Or adjust each time you switch if you prefer different sizes per monitor
### Monitor Switching
Quick Access follows your cursor:
```
Working on Monitor 1 β Press shortcut β Opens on Monitor 1
Move to Monitor 2 β Press shortcut β Opens on Monitor 2
```
## Keyboard Shortcuts for Window Management
While there are no built-in keyboard shortcuts for resizing, you can use OS-level window management:
### macOS (with Rectangle or Magnet)
* Assign custom shortcuts to resize Quick Access
* Snap to predefined sizes
* Move between monitors with keyboard
### Windows (with PowerToys FancyZones)
* Create custom zones for Quick Access
* Snap to zones with keyboard shortcuts
* Consistent sizing across applications
### Linux (with i3 or similar)
* Configure window rules for Quick Access
* Set default sizes and positions
* Keyboard-driven window management
## Best Practices
**Start with Default**: Use the standard size first, then adjust based on your
actual usage patterns.
**Match Your Monitor**: On smaller laptops, go compact. On large monitors,
make it bigger to take advantage of screen real estate.
**Consider Content Type**: If you work mostly with media snippets, keep it
large. For text-only, smaller works fine.
**Test Different Sizes**: Try different sizes for a day each and see what
feels most natural for your workflow.
## Advanced Tips
### Maximize Preview Space
For maximum content visibility:
1. Resize Quick Access to full screen height
2. Keep width at \~60% of monitor
3. Position on left or right side
4. Use as a persistent snippet browser
### Minimal Footprint
For fastest insertion workflow:
1. Make Quick Access as small as readable
2. Position at top-center of screen
3. Use fuzzy search (type fast, don't browse)
4. Muscle memory for common snippets
### Adaptive Sizing
Switch sizes based on task:
* **Writing**: Medium size for browsing content
* **Coding**: Large size to preview full code blocks
* **Quick tasks**: Small size for rapid insertion
## Troubleshooting
### Window Too Small to Resize
If Quick Access becomes too small to grab edges:
1. Close Quick Access
2. Reset settings in main Snippets AI app
3. Reopen-should return to default size
### Size Not Persisting
If your custom size doesn't save:
1. Check app permissions (may need file system access)
2. Update to latest version of Snippets AI
3. Report bug if issue persists
### Performance Issues When Large
If Quick Access lags when resized very large:
* Reduce window size slightly
* Close other applications to free memory
* Update graphics drivers
## What's Next
Learn all the features of Quick Access
Make Quick Access larger to better preview media content
Learn all keyboard shortcuts to navigate Quick Access efficiently
# Real-time Notifications
Source: https://docs.getsnippets.ai/guides/realtime-notifications
Get notified instantly when snippets are added, updated, or shared
## Overview
Snippets AI includes Slack-style real-time notifications that keep your team in sync. When a team member adds, updates, or shares a snippet, you're notified instantly-right within the app. This ensures everyone stays up-to-date without having to manually check for changes.
Real-time notifications transform Snippets AI from a static repository into a living, collaborative workspace.
## Why Notifications Matter
In collaborative environments, staying informed is critical:
* **Team Awareness**: Know when teammates add new snippets you might need
* **Update Alerts**: See when important snippets are modified
* **Version Control**: Track changes to snippets you use frequently
* **Collaboration**: Get notified when someone shares a snippet with you
* **Productivity**: No need to manually check for updates
## How It Works
### Notification Types
#### Snippet Created
```
π€ Sarah added "API Authentication Flow"
π Backend Team > APIs
π 2 minutes ago
```
When someone creates a new snippet in your team.
#### Snippet Updated
```
π€ Mike updated "Database Query Template"
π Changed syntax to PostgreSQL
π 5 minutes ago
```
When someone modifies an existing snippet.
## Notification UI
### Notification Center
Access all notifications:
**Location:** Bell icon (π) in top-right corner
**Badge:** Shows unread notification count
**Click to Open:** Panel slides out showing recent notifications
### Notification Panel
Similar to Slack's notification center:
* **Recent Activity**: Last 50 notifications
* **Grouped by Time**: Today, Yesterday, This Week
* **Actionable**: Click notification to jump to snippet
* **Mark as Read**: Click to dismiss individual notifications
* **Mark All Read**: Clear all notifications at once
### In-App Toasts
Real-time toasts appear for immediate activity:
**Appearance:** Bottom-right corner (customizable)
**Duration:** 5 seconds (or until dismissed)
**Actions:**
* Click toast β Go to snippet
* Dismiss β Swipe or click X
* Snooze β Remind me later
### Desktop Notifications
System-level notifications even when app is in background:
**Mac:** Notification Center notifications
**Windows:** Toast notifications
**Linux:** Desktop notifications (via libnotify)
**Click Notification:**
* Snippets AI opens (if closed)
* Jumps to relevant snippet
## What's Next
Learn how to share snippets with others via shareable links
Join public workspaces to collaborate with communities
Set up teams to organize notifications by group
# Share Snippet Links
Source: https://docs.getsnippets.ai/guides/share-snippet-links
Share snippets publicly via links with audio, video, and syntax highlighting
## Overview
Share Snippet Links that lets you share snippets publicly via a simple URL. Snippets AI supports rich content: code with syntax highlighting, embedded audio and video, and beautiful formatting-all accessible via a single shareable link.
Perfect for sharing code snippets, prompts, tutorials, or multimedia content with anyone, whether they use Snippets AI or not.
## Why Share Links Matter
Traditional snippet sharing is clunky:
* **Copy-Paste**: Formatting breaks, long snippets get messy
* **Screenshots**: Not copyable, no syntax highlighting
* **Email Attachments**: Hard to find later, version control issues
* **Generic Pastebins**: No media support, no syntax options
Share Links solve all of this with one URL.
## How It Works
### Creating a Share Link
#### Method 1: From Snippet Menu
1. **Open any snippet** in Snippets AI
2. **Click Share button** (or right-click β Share)
### Sharing the Link
Once created, share the link anywhere:
* **Email**: Open in email client
* **Slack/Discord**: Paste into message
* **Social Media**: Share on Twitter, LinkedIn
* **QR Code**: Generate QR code for easy mobile access (if available)
### What Recipients See
When someone opens your share link:
**Beautiful Web View:**
* Clean, readable interface
* Proper syntax highlighting
* Copy button for easy copying
* Download option
* View on dark or light theme
**No Account Required:**
* Recipients don't need Snippets AI account
* No login, no signup
* Just open and view
## Share Links with Media
### Audio Attachments
Share snippets with audio:
1. Create snippet with audio recording
2. Recipients can play audio inline
3. Perfect for voice prompts, instructions, explanations
**Example Use Case:**
```
Share: "Sales Pitch Template"
- Text: Written script
- Audio: You reading the pitch for tone/emphasis
- Recipients hear exactly how to deliver
```
### Video Attachments
Share snippets with video:
1. Attach video to snippet (embed or upload)
2. Generate share link
3. Video plays inline on share page
4. Great for tutorials, demos, walkthroughs
**Example Use Case:**
```
Share: "React Component Tutorial"
- Text: Component code
- Video: Screen recording showing implementation
- Recipients see code + video explanation
```
### Mixed Content
Combine text, audio, and video:
```
Share: "Complete Feature Walkthrough"
- Text: Feature description and code
- Audio: Voice notes explaining tricky parts
- Video: Demo of feature in action
```
All viewable in one shareable page.
## Syntax Highlighting Options
When sharing code, choose syntax highlighting:
### Automatic Detection
Snippets AI auto-detects syntax from your snippet's format:
```javascript theme={null}
// Shared with JavaScript syntax
const fetchData = async () => {
const response = await fetch('/api/data');
return response.json();
};
```
### Manual Override
Change syntax before sharing:
1. Click "Share" β Advanced Options
2. Select "Syntax" dropdown
3. Choose from 50+ languages
4. Generate link with chosen syntax
**Supported Syntaxes:**
* JavaScript, TypeScript, Python, Java, Go, Rust
* SQL, PostgreSQL, MySQL, MongoDB
* HTML, CSS, JSON, YAML, XML
* Markdown, Plain Text
* And many more
### Multiple Language Versions
Share same content with different syntax views:
**Example: API Request**
Share link 1: JavaScript version
```javascript theme={null}
fetch('https://api.example.com/data');
```
Share link 2: Python version
```python theme={null}
requests.get('https://api.example.com/data')
```
Share link 3: cURL version
```bash theme={null}
curl https://api.example.com/data
```
Create separate share links for each syntax.
## Practical Use Cases
### For Developers
**Code Review with External Contractors:**
```
1. Create snippet with code needing review
2. Share link with contractor
```
**Open Source Contributions:**
```
1. Share code snippet publicly
2. Post link on GitHub, Twitter
3. Community reviews
4. Improve code based on feedback
```
### For Technical Writers
**Documentation Snippets:**
```
1. Write code examples for documentation
2. Share links in blog posts, articles
3. Readers copy code with proper syntax highlighting
4. Update snippet; all links reflect changes
```
### For Educators
**Tutorial Resources:**
```
1. Create tutorial with text + video
2. Share link with students
3. Students watch video and copy code
```
### For Sales & Marketing
**Demo Scripts:**
```
1. Create demo script with audio recording
2. Share with sales team via link
3. Reps listen to pitch delivery
4. Consistent messaging across team
```
### For Teams
**Knowledge Sharing:**
```
1. Document solution to problem
2. Share link in Slack channel
3. Team members access without needing Snippets AI
4. Can copy and adapt for their use
```
## Security Considerations
### What's Safe to Share
β
**Safe:**
* Example code (non-production)
* Tutorials and educational content
* Public documentation
* Marketing copy
* General prompts
β **Not Safe:**
* API keys or secrets
* Production credentials
* Personal information
* Company confidential data
* Private customer data
See [API Reference](/api-reference/snippets/create-snippet) for details.
## What's Next
Learn how to attach audio and video to snippets before sharing
Master syntax highlighting for better-looking shared snippets
Get notified when someone comments on your shared snippets
# Snippet Expansion & Shortcuts
Source: https://docs.getsnippets.ai/guides/snippet-expansion
Assign keyboard shortcuts to snippets for instant text expansion anywhere
## Overview
Snippet Expansion (also known as text expansion) lets you assign custom keyboard shortcuts to snippets that automatically expand when you type them. Type a short abbreviation like `/email`, and it instantly expands into your full email template-anywhere on your computer.
This is Snippets AI's TextExpander-style feature, supercharged with team awareness and workspace intelligence.
## Why Snippet Expansion Matters
Stop typing the same things repeatedly:
* **Speed**: Type 5 characters instead of 500
* **Consistency**: Same text every time, no typos
* **Universal**: Works in every app (email, Slack, code editors, browsers)
* **Muscle Memory**: Common snippets become automatic
* **Productivity Multiplier**: Save hours per week
## How It Works
### Setting Up a Shortcut
#### 1. **Open or Create Snippet**
Navigate to the snippet you want to assign a shortcut to.
#### 2. **Set Shortcut**
In snippet editor:
* Find "Shortcut" or "Abbreviation" field
* Enter your shortcut (e.g., `/hello`)
* Save snippet
#### 3. **Use Shortcut Anywhere**
In any application:
1. Type the shortcut: `/hello`
2. Shortcut is replaced with full snippet content
That's it! The magic happens automatically.
### Shortcut Format
**Recommended Format:**
```
/shortcut
```
**Examples:**
* `/email` - Email template
* `/sig` - Email signature
* `/addr` - Address
* `/meet` - Meeting notes template
* `/debug` - Debug log snippet
**Why `/` prefix?**
* Unlikely to type naturally in writing
* Easy to remember and type
* Visually distinct
* Doesn't conflict with normal punctuation
**Alternatives:**
* `:shortcut:` - Slack-style
* `//shortcut` - Comment-style
* `.shortcut` - Dot prefix
* `@shortcut` - Mention-style
Choose a convention and stick with it.
### Trigger Keys
Expansion happens when you type:
**Default Triggers:**
* `Space` - Most common
* `Enter` / `Return`
* `Tab`
**Configurable:**
Settings β Expansion β Trigger Keys
Some users prefer expansion only on `Tab` to avoid accidental expansions.
## Team-Specific Shortcuts
**Important:** Shortcuts are **team-specific** and **workspace-specific**.
### How It Works
```
Workspace A β Team 1:
Snippet: "Hello Team 1"
Shortcut: /hello
Workspace A β Team 2:
Snippet: "Hello Team 2"
Shortcut: /hello (same shortcut, different snippet)
```
**When you're in Team 1:**
* Typing `/hello` expands to "Hello Team 1"
**Switch to Team 2:**
* Typing `/hello` now expands to "Hello Team 2"
**Switch to Workspace B:**
* `/hello` may not work (different workspace)
* Or expands to different snippet if defined there
### Why Team-Specific?
This design allows:
* **Context-Aware Expansion**: Same shortcut, different content per context
* **No Conflicts**: Each team can define own shortcuts
* **Flexibility**: Reuse memorable shortcuts across teams
### Best Practices
**Unique Shortcuts for Universal Snippets**: If you want a shortcut to work
the same way everywhere, use a unique shortcut name that you only define once.
**Document Team Shortcuts**: Maintain a list of shortcuts for each team so
members know what's available.
**Namespace by Purpose**: Use prefixes like `/api-`, `/ui-`, `/prompt-` to
group related shortcuts.
## Example Use Cases
### Email Templates
**Shortcut: `/followup`**
```
Hi [Name],
Following up on our conversation last week about [topic].
I wanted to check if you had a chance to review my proposal.
Happy to answer any questions or hop on a call to discuss further.
Looking forward to hearing from you!
Best,
[Your Name]
```
Type `/followup` β Full email appears β Fill in bracketed fields.
### Code Snippets
**Shortcut: `/apiget`**
```javascript theme={null}
const response = await fetch('https://api.example.com/endpoint', {
method: 'GET',
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
});
const data = await response.json();
```
Type `/apiget` in VS Code β Full API call appears.
### Frequently Used Commands
**Shortcut: `/docker`**
```bash theme={null}
docker-compose down && docker-compose up -d --build && docker-compose logs -f
```
Type `/docker` in terminal β Command appears, press Enter to run.
### Meeting Notes
**Shortcut: `/meet`**
```markdown theme={null}
# Meeting Notes - [Date]
**Attendees:**
**Agenda:**
1.
2.
3.
**Discussion:**
**Action Items:**
- [ ]
- [ ]
**Next Meeting:**
```
Type `/meet` in Notion β Template appears β Fill in details.
### Customer Support Responses
**Shortcut: `/thanks`**
```
Thanks for reaching out!
I've looked into your issue and [solution/next steps].
Let me know if you have any other questions-happy to help!
Best regards,
Support Team
```
Type `/thanks` in Intercom β Response ready.
### Personal Information
**Shortcut: `/addr`**
```
123 Main Street
Apt 4B
San Francisco, CA 94102
```
**Shortcut: `/phone`**
```
+1 (555) 123-4567
```
Fill out forms in seconds.
### Prompt Engineering
**Shortcut: `/sys`**
```
You are an expert software engineer with deep knowledge of [language/framework].
Your responses should:
1. Be clear and concise
2. Include code examples
3. Explain your reasoning
4. Suggest best practices
Always format code with proper syntax highlighting.
```
Type `/sys` in ChatGPT β System prompt inserted.
## Advanced Features
### Dynamic Fields
Some snippet managers support dynamic fields (variables):
**Date/Time:**
```
Today's date: {date}
Current time: {time}
```
Expands to:
```
Today's date: 2025-10-12
Current time: 3:45 PM
```
**Clipboard:**
```
Here's the link: {clipboard}
```
Expands and includes current clipboard content.
**Cursor Position:**
```
function {cursor}() {
// Implementation
}
```
Cursor positioned at `{cursor}` after expansion.
Check Snippets AI documentation for supported dynamic fields.
### Multi-Line Expansions
Shortcuts work with multi-line content:
```
/header
ββββββββββββββββββββββββββββ
PROJECT NAME
ββββββββββββββββββββββββββββ
```
All formatting preserved.
### Nested Shortcuts
Expand one shortcut that contains another:
```
Shortcut: /greeting
Content: "Hello {name},"
Shortcut: /email
Content: "/greeting\n\nEmail body..."
```
(Check if Snippets AI supports nested expansion)
## Managing Shortcuts
### View All Shortcuts
**Settings β Snippets β Shortcuts**
See list of all active shortcuts:
* Shortcut abbreviation
* Snippet name
* Team/Workspace
* Last used
### Edit Shortcuts
Change shortcut without changing snippet:
1. Open snippet
2. Change shortcut field
3. Save
Old shortcut stops working; new one activates immediately.
### Disable Expansion
Temporarily disable snippet expansion:
**Method 1: Global Toggle**
* Settings β Expansion β Enable Snippet Expansion (toggle off)
**Method 2: Per-App Disable**
* Settings β Expansion β Excluded Apps
* Add apps where expansion shouldn't work (e.g., password managers)
### Shortcut Conflicts
If two snippets have same shortcut in same team:
* Warning appears when saving
* Last-saved shortcut takes precedence
* Resolve by changing one shortcut
## Best Practices
**Start with High-ROI Shortcuts**: Identify things you type 5+ times per day.
Those get shortcuts first.
**Memorable Shortcuts**: Use intuitive abbreviations. `/email` is better than
`/e1`.
**Consistent Prefix**: Use `/` for all shortcuts. Makes them easy to remember
and type.
**Document Shortcuts**: Keep a "Shortcuts Cheat Sheet" snippet that lists all
your shortcuts.
**Review Periodically**: Check Settings β Shortcuts monthly. Remove unused
shortcuts, add new ones.
## Snippet Expansion vs. Quick Access
### When to Use Snippet Expansion
β
**Use shortcuts when:**
* Typing same thing repeatedly
* Need instant expansion mid-sentence
* Muscle memory workflow (type without thinking)
* Short, frequently-used snippets
**Examples:**
* Email signatures
* Personal info (address, phone)
* Code boilerplate
* Common responses
### When to Use Quick Access
β
**Use Quick Access when:**
* Snippets change frequently
* Need to browse/search before inserting
* Longer, less-frequent snippets
* Want to preview before inserting
**Examples:**
* Complex code snippets
* Long-form templates
* Infrequent use cases
* Exploratory browsing
### Hybrid Approach
Use both:
* **Top 20 snippets:** Assign shortcuts (muscle memory)
* **Everything else:** Use Quick Access (search-driven)
## Troubleshooting
### Shortcut Not Expanding
If typing shortcut doesn't expand:
1. **Verify Shortcut Set**: Open snippet, check shortcut field is filled
2. **Check Team Context**: Are you in the right team/workspace?
3. **Expansion Enabled**: Settings β Expansion β Enabled?
4. **Trigger Key**: Did you press Space/Enter after typing?
5. **App Permissions**: Mac: System Settings β Privacy β Accessibility β Snippets AI
### Expansion in Wrong Places
If snippets expand when you don't want:
1. **Change Trigger**: Use Tab-only expansion (less accidental)
2. **Exclude Apps**: Settings β Expansion β Excluded Apps
3. **Longer Shortcuts**: Use longer abbreviations (less likely to type accidentally)
### Conflict with Other Apps
If using TextExpander, Alfred Snippets, or similar:
* **Disable Others**: Use only Snippets AI expansion (avoid conflicts)
* **Or Different Prefixes**: Snippets AI uses `/`, others use `::`
* **Coordinate**: Ensure no overlapping shortcuts
## What's Next
Learn Quick Access as an alternative to shortcuts for longer snippets
Understand team context for snippet expansion
Organize shortcuts by team for different contexts
# Switching Between Accounts
Source: https://docs.getsnippets.ai/guides/switch-accounts
Switch between different workspaces and accounts in the desktop app
## Overview
Snippets AI desktop app supports multiple account management, allowing you to switch between different workspaces and accounts without logging out. Perfect for freelancers, consultants, or anyone juggling personal and work accounts-keep everything organized and accessible with quick account switching.
This guide explains the account hierarchy and how to efficiently manage multiple accounts on desktop.
## Account Hierarchy
Understanding the structure:
```
π€ Account (Your Email/Identity)
ββ π’ Workspace (Company/Organization)
ββ π₯ Team (Department/Project)
ββ π Snippet
```
**Example:**
```
π€ john@personal.com (Personal Account)
ββ π’ Personal Workspace
ββ π₯ Side Projects Team
π€ john@company.com (Work Account)
ββ π’ Acme Corp Workspace
ββ π₯ Engineering Team
```
Each account is completely separate with its own workspaces, teams, and snippets.
## Why Multiple Accounts?
Common scenarios:
### Personal + Work
```
Personal Account:
- Side projects
- Learning resources
- Personal productivity
Work Account:
- Company snippets
- Team collaboration
- Client projects
```
### Multi-Company Consultants
```
Consultant Account:
- Client A workspace
- Client B workspace
- Personal workspace
```
### Testing & Development
```
Production Account:
- Real work snippets
Development Account:
- Testing features
- Experimental snippets
```
## How It Works
### Adding an Account
#### First Time Setup
1. **Install Snippets AI** desktop app
2. **Sign in** with first account (e.g., work email)
3. App opens to your workspace
#### Adding Second Account
1. **Click your profile** (top-left corner)
2. **Select "Add Account"**
3. **Sign in with second account** (e.g., personal email)
4. **Switch between accounts** anytime
### Switching Accounts
#### Method 1: Profile Menu (Primary)
1. **Click profile avatar** (top-left)
2. **See list of all signed-in accounts**
3. **Click account** to switch
4. **App refreshes** to that account's workspace
### Visual Indicators
**Current Account:**
* Profile photo in top-left
* Account email shown on hover
* Workspace name at top of sidebar
**Account Badge:**
* Color coding per account (customizable)
* Helps visually distinguish which account you're in
## Account-Specific Data
Each account is completely isolated:
### What's Separate
**Snippets:**
* Each account has its own snippet library
* No cross-contamination
**Workspaces & Teams:**
* Workspace membership per account
* Team permissions per account
**Favorites:**
* Global Favorites are per account
* Star snippets independently in each account
**Settings:**
* Notification preferences
* Theme/appearance
* Keyboard shortcuts (can differ per account)
**Quick Access:**
* Searches current account only
* Switch account to search different library
### What's Shared
**Desktop App:**
* One installation for all accounts
* Updates apply to all accounts
**System Preferences:**
* Accessibility permissions (one-time setup)
* File system access
**Window Position:**
* Window size/position (unless customized per account)
## Managing Multiple Accounts
### Account List
View all signed-in accounts:
**Profile Menu β Manage Accounts**
See list with:
* Account email
* Associated workspaces
* Last active time
* Sign out option per account
### Signing Out
**Sign out of one account:**
1. Profile Menu β Manage Accounts
2. Find account
3. Click "Sign Out"
4. Account removed from app (can re-add later)
## Workflows for Multiple Accounts
### Freelancer/Consultant
```
Morning (Client Work):
1. Switch to Client A account
2. Use client-specific snippets
3. Collaborate with client team
Afternoon (Client Work):
4. Switch to Client B account
5. Use different set of snippets
6. Separate context entirely
Evening (Personal):
7. Switch to personal account
8. Work on side projects
9. Personal snippets library
```
### Developer (Work + Personal)
```
Workday:
1. Sign in to work account
2. Company snippets available
3. Collaborate with team
4. Use company prompt library
Evenings/Weekends:
5. Switch to personal account
6. Side project snippets
7. Personal learning resources
8. Experimental code
```
### Testing/QA Scenario
```
Production Testing:
1. Sign in to test account A
2. Verify features work
3. Test snippet creation
Development Testing:
4. Switch to test account B
5. Test new features
6. Break things safely
Production Use:
7. Switch to real account
8. Actual work
9. No risk of test contamination
```
## Best Practices
**Use Work Email for Work**: Keep work and personal completely separate. Makes
offboarding cleaner if you leave a company.
**Limit Active Accounts**: Having 5+ accounts active gets confusing. Sign out
of accounts you rarely use.
**Visual Distinctions**: Use different profile photos for different accounts
to quickly identify which you're in.
**Set Appropriate Defaults**: Set your most-used account as default to
minimize switching on app launch.
## Troubleshooting
### Account Not Appearing
If an account doesn't show after adding:
1. **Workspace Access**: Verify workspace membership
2. **Refresh**: Restart Snippets AI
### Sign-In Issues
If can't sign in to second account:
1. **Sign Out First**: Sign out of current account, then sign in to new one or contact support if the issue persists.
## Web App vs. Desktop App
### Desktop App (Multiple Accounts Supported)
β
**Supported:**
* Multiple accounts simultaneously signed in
* Quick switching between accounts
* System tray access
* Desktop notifications per account
### Web App (Single Account Only)
β **Not Supported:**
* One account per browser session
* Must sign out to switch
* Use incognito/different browser for multiple accounts
**Recommendation:** Use desktop app if you need multiple accounts.
## What's Next
Learn how to switch between teams within a workspace
Set up teams to organize your workspace
Quick Access searches within your current account
# Switching Between Teams
Source: https://docs.getsnippets.ai/guides/switch-teams
Quickly switch between different teams in your workspace
## Overview
Snippets AI's workspace architecture uses a three-level hierarchy: Workspace β Teams β Snippets. Switching between teams lets you access different snippet collections within the same workspace, making it easy to context-switch between projects, departments, or use cases.
This guide shows you how to efficiently switch between teams and understand which team's snippets you're currently viewing.
## Understanding the Architecture
### The Hierarchy
```
π’ Workspace (Your Company/Organization)
ββ π₯ Team 1 (e.g., Frontend)
β ββ π Snippet collection
ββ π₯ Team 2 (e.g., Backend)
β ββ π Snippet collection
ββ π₯ Team 3 (e.g., Prompt Engineering)
ββ π Snippet collection
```
**Key Points:**
* You're always in **one workspace** at a time
* Each workspace has **multiple teams**
* Each team has its **own snippets**
* You can be a member of **multiple teams**
## How It Works
### Team Dropdown (Primary)
**In the Sidebar:**
1. Look at top of sidebar
2. See current team name with dropdown arrow
3. Click team name
4. Dropdown shows all your teams in this workspace
5. Click desired team
6. Snippet library updates to show that team's snippets
## What Changes When You Switch
### Visible Snippets
**Current Team Only:**
* Snippet library shows only current team's snippets
* Folders and tags from current team
* Search within team
**Not Affected:**
* Quick Access (shows all teams' snippets)
* Global Favorites (shows favorites from all teams)
* Workspace Search (searches all teams by default)
### Context Indicators
**Current Team Shown:**
* Team name in sidebar header
* Breadcrumbs at top of app
* Team badge on snippets (in search results)
### Snippet Expansion Shortcuts
**Important:** Snippet expansion shortcuts (like `/hello`) are **team-specific**.
**Example:**
```
Team: Frontend
Snippet: "React Component" β Shortcut: /rc
Team: Backend
Snippet: "API Route" β Shortcut: /rc (different snippet)
```
When you're in **Frontend team**, typing `/rc` expands Frontend's React Component.
When you switch to **Backend team**, typing `/rc` expands Backend's API Route.
**Workaround for Global Shortcuts:**
* Use unique shortcut names across teams
* Or use Quick Access instead (searches all teams)
## Common Team Structures
### By Department
```
π’ Company Workspace
ββ π₯ Frontend Team
ββ π₯ Backend Team
ββ π₯ DevOps Team
ββ π₯ Product Team
ββ π₯ Marketing Team
```
**Switch when:** Moving between different functional areas of work.
### By Project
```
π’ Agency Workspace
ββ π₯ Client A Project
ββ π₯ Client B Project
ββ π₯ Client C Project
ββ π₯ Internal Projects
```
**Switch when:** Moving between client projects or internal work.
### By Environment
```
π’ Engineering Workspace
ββ π₯ Production Snippets
ββ π₯ Staging Snippets
ββ π₯ Development Snippets
```
**Switch when:** Moving between different deployment environments.
### By Purpose
```
π’ AI Development Workspace
ββ π₯ ChatGPT Prompts
ββ π₯ Claude Prompts
ββ π₯ Code Snippets
ββ π₯ Documentation Templates
```
**Switch when:** Switching between different types of work.
## Team Switching Workflows
### Context Switching During Development
**Scenario:** Full-stack developer
```
Morning:
1. Switch to "Frontend Team"
2. Use React snippets via Quick Access
3. Insert component templates
Afternoon:
4. Switch to "Backend Team"
5. Use API route snippets
6. Insert database queries
Evening:
7. Switch to "DevOps Team"
8. Use deployment scripts
9. Insert CI/CD configs
```
### Project-Based Work
**Scenario:** Agency developer
```
Monday-Wednesday:
- Switch to "Client A Team"
- All snippets are Client A specific
- Use custom templates for this client
Thursday-Friday:
- Switch to "Client B Team"
- Different snippets, different context
- Use Client B branding and templates
```
### Learning & Production
**Scenario:** AI Engineer
```
Exploration:
- Switch to "Experimental Prompts Team"
- Try new prompt engineering techniques
- Test and iterate
Production:
- Switch to "Production Prompts Team"
- Use tested, approved prompts
- Maintain quality standards
```
## Team Permissions
### What You Can Do
Depends on your role in the team:
**Team Admin:**
* View, create, edit, delete any snippet
* Manage team members
* Configure team settings
* Delete team
**Team Editor:**
* View all snippets
* Create new snippets
* Edit own snippets
* Cannot delete team or manage members
**Team Viewer:**
* View snippets only
* Cannot create or edit
* Read-only access
### Switching to Teams You're Not In
If you see a team in Workspace Overview but can't switch to it:
* You're not a member of that team
* Ask team admin to add you
* Or join team (if self-service joining is enabled)
## Best Practices
**Use Keyboard Shortcuts**: Master `Cmd/Ctrl + T` for fast team switching.
Much faster than clicking.
**Keep Team Count Manageable**: Being in 10+ teams gets overwhelming. Join
only teams you actively use.
**Name Teams Clearly**: Use descriptive names so you know which team to switch
to without guessing.
**Default to Most-Used Team**: Set your primary team as default. Switch only
when needed.
**Use Quick Access for Cross-Team**: Don't switch teams just to grab one
snippet. Use Quick Access instead.
## Troubleshooting
### Can't Find a Team
If a team is missing:
1. **Check Workspace**: Are you in the right workspace? (See [Switch Accounts](/guides/switch-accounts))
2. **Team Membership**: Were you removed from the team? Check with admin.
3. **Team Deleted**: Team may have been deleted by admin.
### Wrong Team After Restart
If Snippets AI opens to wrong team:
1. **Set Default Team**: Settings β Teams β Set Default Team
2. **Last Active**: Or enable "Remember last active team" in settings
### Snippet Missing After Switch
If snippet disappears when you switch teams:
* Snippet belongs to previous team, not current team
* Switch back to original team to find it
* Or use Workspace Search (searches all teams)
## What's Next
Learn how to create new teams in your workspace
Learn how to switch between different workspaces and accounts
Use Quick Access to search across all teams without switching
# Syntax Highlighting
Source: https://docs.getsnippets.ai/guides/syntax-highlighting
Switch between different syntax formats for your snippets
## Overview
One of Snippets AI's most powerful features is its intelligent syntax highlighting and format switching. Whether you're working with JavaScript code, Markdown documentation, SQL queries, or AI prompts, Snippets AI automatically detects and highlights your content with the appropriate syntax-and lets you switch between formats instantly.
This guide shows you how to leverage syntax formatting to make your snippets more readable, organized, and powerful.
## Why Syntax Highlighting Matters
Proper syntax highlighting transforms how you work with snippets:
* **Better Readability**: Color-coded syntax makes code and prompts easier to scan and understand
* **Error Prevention**: Syntax highlighting helps you spot typos and mistakes before you use a snippet
* **Context Switching**: Quickly switch between formats as you work across different tools
* **Professional Organization**: Keep your snippet library clean and properly formatted
* **Team Consistency**: Ensure everyone on your team uses the same formatting standards
## Supported Syntax Formats
Snippets AI supports a wide range of syntax formats:
* **Programming Languages**: JavaScript, TypeScript, Python, Java, Go, Rust, Ruby, PHP, C++, C#, Swift, Kotlin
* **Web Technologies**: HTML, CSS, SCSS, JSON, XML, YAML
* **Database**: SQL, PostgreSQL, MongoDB
* **Markup**: Markdown, MDX, LaTeX
* **Shell**: Bash, Zsh, PowerShell
* **AI Prompts**: Specialized formatting for LLM prompts
* **Plain Text**: No syntax highlighting for general notes
## How It Works
### Step-by-Step Guide
#### 1. **Create or Open a Snippet**
Start with any snippet in your workspace-whether it's a new one or an existing snippet you want to format.
#### 2. **Choose Your Syntax Format**
Look for the syntax selector in the snippet editor (typically in the top-right corner or toolbar). Click it to see all available syntax formats.
The dropdown includes:
* A search bar to quickly find your desired format
* Recently used formats at the top
* All available syntax types organized by category
#### 3. **Switch Formats in Real-Time**
As shown in the video, you can switch between syntax formats instantly:
```javascript theme={null}
// Your snippet in JavaScript format
const fetchData = async () => {
const response = await fetch('/api/data');
return response.json();
};
```
β Switch to Python β
```python theme={null}
# Same snippet in Python format
async def fetch_data():
response = await fetch('/api/data')
return response.json()
```
The syntax highlighting updates immediately, helping you visualize how your snippet looks in different contexts.
#### 4. **Auto-Detection**
Snippets AI is smart enough to detect the syntax format automatically in most cases:
* Paste SQL code β Auto-detected as SQL
* Paste a markdown document β Auto-detected as Markdown
* Paste a JSON object β Auto-detected as JSON
You can always override the auto-detection by manually selecting a format.
#### 5. **Save with Format**
When you save a snippet, the chosen syntax format is stored with it. This means:
* The snippet always displays with the correct highlighting
* Team members see the same formatting
* API calls return the format information
* Exports maintain the proper syntax
## Practical Use Cases
### For Developers
**Debugging Workflows**
```javascript theme={null}
// Save debugging snippets with proper JS syntax
console.log('Debug point reached:', {
userId,
timestamp: Date.now(),
});
```
**SQL Queries**
```sql theme={null}
-- Store database queries with SQL highlighting
SELECT u.name, u.email, o.order_date
FROM users u
JOIN orders o ON u.id = o.user_id
WHERE o.status = 'completed'
ORDER BY o.order_date DESC;
```
**Configuration Files**
```yaml theme={null}
# Save config snippets with YAML syntax
services:
web:
image: nginx:latest
ports:
- '80:80'
```
### For AI Engineers & Prompt Engineers
**Structured Prompts**
Switch between plain text and Markdown for complex prompts:
```markdown theme={null}
# AI Agent Instructions
## Context
You are a helpful assistant specialized in technical documentation.
## Task
- Review the provided code
- Suggest improvements
- Explain any security concerns
## Output Format
Provide a numbered list of actionable recommendations.
```
**Multi-Language Examples**
Store the same prompt logic in different programming languages:
```python theme={null}
# Python version
def process_data(input_list):
return [x * 2 for x in input_list if x > 0]
```
```javascript theme={null}
// JavaScript version
function processData(inputList) {
return inputList.filter((x) => x > 0).map((x) => x * 2);
}
```
### For Product & Operations Teams
**API Documentation Snippets**
```json theme={null}
{
"endpoint": "/api/users",
"method": "POST",
"body": {
"name": "John Doe",
"email": "john@example.com"
}
}
```
**Shell Commands**
```bash theme={null}
# Deployment commands
docker build -t myapp:latest .
docker push myapp:latest
kubectl apply -f deployment.yaml
```
## Advanced Features
### Format-Specific Tools
Different syntax formats unlock different features:
* **Code Formats**: Line numbers, collapsible functions, variable highlighting
* **Markdown**: Live preview, heading navigation, link validation
* **JSON**: Auto-formatting, structure validation, collapsible objects
* **SQL**: Query formatting, keyword highlighting, table detection
### Copy with Syntax
When you copy a snippet to your clipboard, the syntax format is preserved:
1. Copy snippet from Snippets AI
2. Paste into your IDE or editor
3. Syntax highlighting carries over (in compatible editors)
## Best Practices
**Choose the Right Format**: Always select the syntax format that matches how
you'll use the snippet. This ensures proper highlighting and formatting when
you expand it.
**Use Markdown for Documentation**: For snippets that include instructions,
use Markdown to add headers, lists, and formatting that renders beautifully.
**Test Format Switching**: If you maintain the same snippet in multiple
languages (e.g., for API examples), save separate variations and use tags to
link them.
**Leverage Auto-Detection**: Let Snippets AI detect the format first, then
adjust if needed. This saves time and ensures consistency.
## Working with the API
Syntax formats are fully accessible via the API, enabling automation:
```javascript theme={null}
// Create a snippet with specific syntax
const response = await fetch('https://api.getsnippets.ai/v1/snippets', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Database Query',
content: 'SELECT * FROM users WHERE active = true;',
syntax: 'sql',
folder_id: 'your-folder-id',
}),
});
```
This allows you to:
* Programmatically create snippets with proper formatting
* Bulk update syntax formats across your library
* Export snippets in specific formats for documentation
* Build custom syntax highlighting in your own tools
## Format Comparison
Here's the same snippet in different formats to show how syntax switching helps:
**As JavaScript:**
```javascript theme={null}
const user = {
name: 'Alice',
role: 'Engineer',
active: true,
};
```
**As JSON:**
```json theme={null}
{
"name": "Alice",
"role": "Engineer",
"active": true
}
```
**As Python:**
```python theme={null}
user = {
"name": "Alice",
"role": "Engineer",
"active": True
}
```
Each format highlights differently, helping you understand the context at a glance.
## Next Steps
Now that you understand syntax highlighting:
1. Review your existing snippets and assign appropriate syntax formats
2. Experiment with switching formats to see which works best for your workflow
3. Create snippet templates with pre-set syntax for common use cases
4. Share formatted snippets with your team to maintain consistency
Learn how to store multimedia content in Snippets AI
See how to programmatically create snippets with syntax formatting
# Video & Audio Prompts
Source: https://docs.getsnippets.ai/guides/video-audio-prompts
Store and organize video and audio prompts in Snippets AI
## Overview
Snippets AI isn't just for text-it's designed to handle multimedia content seamlessly. Whether you're creating voice prompts, recording quick audio notes, or embedding video instructions, Snippets AI gives you a powerful way to store, organize, and reuse all types of content across your workflow.
This guide will show you how the UI handles video and audio prompts, making it easy to build a rich library of multimedia snippets that you can access instantly.
## Why Use Video & Audio Prompts?
Video and audio prompts open up new possibilities for how you work:
* **Voice-First Workflows**: Capture ideas and prompts using natural speech instead of typing
* **Richer Context**: Explain complex concepts with screen recordings or walkthroughs
* **Team Collaboration**: Share video tutorials or audio instructions with your team
* **Accessibility**: Provide alternative formats for different learning styles
* **Faster Creation**: Speak your prompts instead of typing them out
## How It Works
### Step-by-Step Guide
#### 1. **Create a New Snippet**
Start by creating a new snippet in any folder within your workspace. You can organize video and audio prompts just like text snippets-in folders by project, team, or use case.
#### 2. **Choose Your Media Type**
Snippets AI supports multiple content types:
* **Text prompts** (the default)
* **Audio recordings** captured via microphone
* **Video embeds** from external sources
* **Mixed content** combining text, code, and media
#### 3. **Add Your Video or Audio Content**
The UI provides an intuitive interface for adding multimedia:
* **For Audio**: Use the built-in voice input feature powered by Whisper to record audio directly
* **For Video**: Embed video URLs or upload screen recordings
* **Preview**: See a live preview of your media right in the snippet editor
#### 4. **Organize with Folders and Tags**
Just like text snippets, your video and audio prompts can be:
* Organized into folders for easy navigation
* Tagged with relevant keywords for quick search
* Versioned to track changes over time
* Shared with team members or kept private
#### 5. **Search and Access**
The powerful search functionality works across all media types:
* Search by title, description, or tags
* Filter by media type (video, audio, text)
* Access from the desktop app or via API
* Use keyboard shortcuts to find what you need instantly
## Practical Use Cases
### For Developers
* Record debugging walkthroughs
* Save SQL query explanations with voice notes
* Store video tutorials for common workflows
* Create audio prompts for code review standards
### For AI Engineers & Prompt Engineers
* Build a library of voice-activated prompts
* Save video demonstrations of prompt techniques
* Record thought processes for complex prompt engineering
* Share prompt strategies via video with your team
### For Teams
* Onboarding videos stored as snippets
* Audio instructions for repetitive tasks
* Screen recordings of bug reproductions
* Voice memos for quick team updates
### For Sales & Marketing
* Sales pitch recordings as reusable templates
* Customer demo videos organized by use case
* Audio scripts for outreach calls
* Video testimonials and case studies
## Best Practices
**Keep it Organized**: Create separate folders for different types of media
content (e.g., "Voice Prompts", "Tutorial Videos", "Audio Notes")
**Add Descriptions**: Always add a text description to your video and audio
snippets so they're searchable and provide context
**Use Tags Wisely**: Tag your media snippets with keywords like "onboarding",
"tutorial", "demo", or "walkthrough" for easier discovery
**Version Your Media**: When you update a video or audio prompt, Snippets AI
tracks the changes so you can always roll back if needed
## API Access for Media Prompts
Video and audio prompts are fully accessible via the Snippets AI API, enabling powerful automation:
```javascript theme={null}
// Fetch all video prompts from a folder
const response = await fetch('https://api.getsnippets.ai/v1/snippets', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
params: {
folder_id: 'your-folder-id',
type: 'video',
},
});
const videoSnippets = await response.json();
```
This allows you to:
* Programmatically retrieve video URLs for AI agents
* Build custom dashboards showing media content
* Automate media snippet creation from recordings
* Integrate with tools like VAPI or customer support systems
## Next Steps
Now that you understand how to work with video and audio prompts:
1. Try creating your first voice prompt using Whisper
2. Organize your media snippets into logical folders
3. Share a video snippet with your team to see collaboration in action
4. Explore the API to integrate media prompts into your workflows
Learn how to use different syntax formats for your text snippets
# Workspace Search
Source: https://docs.getsnippets.ai/guides/workspace-search
Search across all snippets, folders, and tags in your workspace with Slack-like search
## Overview
Workspace Search is Snippets AI's powerful, Slack-inspired search feature that lets you find any snippet, folder, tag, or favorited item across your entire workspace. With fuzzy matching, filters, and instant results, Workspace Search ensures you can locate exactly what you need in seconds-even in libraries with thousands of snippets.
Think of it as Spotlight or Cmd+K for your snippet library.
## Why Workspace Search Matters
As your library grows, browsing becomes impractical:
* **Speed**: Find snippets faster than browsing folders
* **Comprehensive**: Search across all teams, folders, tags
* **Fuzzy Search**: Don't need exact names-close matches work
* **Filters**: Narrow by type, team, date, author
* **Universal**: One search box for everything
## How It Works
### Opening Workspace Search
#### Method 1: Keyboard Shortcut (Fastest)
* **Mac**: `Cmd + P`
* **Windows/Linux**: `Ctrl + P`
Search dialog opens, ready to type.
#### Method 2: Search Bar
Click the search bar at top of the Snippets AI window.
#### Method 3: Menu
**File β Search Workspace** or **Edit β Find**
### Basic Search
1. **Open Workspace Search** (`Cmd/Ctrl + P`)
2. **Type your query**
* Snippet names
* Content keywords
* Tag names
* Folder names
3. **Results appear instantly** as you type
4. **Navigate results**:
* `β` / `β` arrows
* Or click with mouse
5. **Press Enter** or click to open snippet
### Search Scope
Workspace Search finds:
#### Snippets
* Snippet names
* Snippet content (full-text search)
* Snippet descriptions
#### Organizational Elements
* Folder names
* Tag names
* Team names
#### Metadata
* Authors (who created snippet)
* Dates (created, modified)
* Favorites status
#### Media
* Audio transcriptions
* Video descriptions
* Attached file names
## Advanced Search Features
### Fuzzy Matching
Don't need exact matches:
```
Search: "authflow"
Finds:
β "Authentication Flow"
β "Auth Workflow"
β "User Auth Flow Template"
```
Typo-tolerant and flexible.
### Search Operators
Use operators for precise searches:
#### Exact Match
```
Search: "react component"
Finds snippets with exact phrase "react component"
```
#### Exclude Terms
```
Search: react -hooks
Finds snippets with "react" but not "hooks"
```
#### Multiple Terms (AND)
```
Search: api authentication
Finds snippets containing both "api" AND "authentication"
```
#### Either Term (OR)
```
Search: typescript | javascript
Finds snippets with "typescript" OR "javascript"
```
### Filter by Author
Find snippets by creator:
```
author:sarah - Created by Sarah
author:me - Created by you
```
### Search Favorites Only
Search only favorited snippets across all workspaces:
```
is:favorite - Search favorites only
is:starred - Same as above
```
Or use "Global Favorites" filter in search UI.
**Use Case:**
```
Search: is:favorite react
Results: All your favorited React snippets across all workspaces
```
## Search Results
### Result Display
Each result shows:
```
π Snippet Name
π Folder > Subfolder
π·οΈ tag1, tag2, tag3
π€ Created by Sarah β’ Modified 2 days ago
π Preview: "const fetchData = async () => {...}"
```
**Highlighting:**
* Matched terms highlighted in yellow
* Easy to see why result matched
### Result Actions
Click result to open, or use quick actions:
**Hover Menu:**
* **Open** - Open snippet in editor
* **Copy** - Copy content to clipboard
* **Quick View** - Preview without opening
* **Share** - Generate share link
* **Add to Favorites** - Star the snippet
**Keyboard Shortcuts:**
* `Enter` - Open
### Sorting Results
Change result order:
**Sort Options:**
* **Relevance** (default) - Best matches first
* **Recently Modified** - Newest changes first
* **Recently Created** - Newest snippets first
* **Alphabetical** - A to Z
## Search Shortcuts & Tips
### Keyboard Navigation
Master Workspace Search without mouse:
```
Cmd/Ctrl + P Open/Close search
β / β Navigate results
Enter Open selected
Esc Close search
```
### Recent Searches
Workspace Search remembers recent queries:
1. Open search (`Cmd/Ctrl + P`)
2. Empty query shows recent searches
3. Click or arrow-key to recent query
4. Press Enter to search again
### Search Suggestions
As you type, suggestions appear:
* **Autocomplete**: Completes partial words
* **Did you mean?**: Suggests corrections for typos
* **Popular Searches**: Shows common queries
### Saved Searches
Save frequent searches:
1. Perform search with filters
2. Click "Save Search"
3. Name it (e.g., "My React Snippets")
4. Access from Search dropdown
**Saved Search Example:**
```
Name: "Frontend Team JS Snippets"
Query: team:Frontend tag:javascript modified:week
```
Click saved search to instantly re-run.
## Practical Workflows
### Finding Forgotten Snippets
**Scenario:** "I created a snippet about database queries last month..."
```
Search: database created:month author:me
Results: Shows your database snippets from last month
```
### Cross-Team Discovery
**Scenario:** "Did anyone create a React hook for auth?"
```
Search: react hook authentication
Results: Finds hooks across all teams you have access to
```
### Cleaning Up Duplicates
**Scenario:** "Find all 'API' snippets to consolidate"
```
Search: api
Sort by: Alphabetical
Review: Merge or delete duplicates
```
### Building Prompt Library
**Scenario:** "Find all ChatGPT prompts I've favorited"
```
Search: is:favorite chatgpt
Results: All your starred ChatGPT prompts
```
## Best Practices
**Use Cmd/Ctrl + P Constantly**: Make it muscle memory. Faster than browsing
folders 99% of the time.
**Tag Consistently**: Better tags = better search results. Establish tagging
conventions with your team.
**Descriptive Names**: Give snippets clear, searchable names. "React Auth
Hook" is better than "Hook 1".
**Save Common Searches**: If you search the same thing weekly, save it for
one-click access.
**Search First, Browse Second**: When looking for something, try search before
navigating folders. It's usually faster.
## Comparing Search Options
| Feature | Workspace Search | Quick Access | Favorites |
| -------- | ----------------- | --------------- | --------------- |
| Scope | Current workspace | All workspaces | Favorited only |
| Speed | Very fast | Instant | Instant |
| Filters | Extensive | Basic | None |
| Context | Full details | Quick preview | Quick preview |
| Best For | Deep research | Quick insertion | Frequent access |
**Use Workspace Search when:**
* Finding snippet to edit or review
* Exploring unfamiliar areas of library
* Using advanced filters
* Researching across teams
**Use Quick Access when:**
* Inserting snippet into another app
* Quick lookup while working
* Need snippet from any workspace
**Use Favorites when:**
* Accessing your most-used snippets
* Building personal toolkit
* One-click access to essentials
## What's Next
Learn about Quick Access for cross-app snippet insertion
Master favorites for instant access to key snippets
Organize snippets to make them more searchable
# Be Specific
Source: https://docs.getsnippets.ai/how-to-prompt/core-principles/be-specific
The principle of specificity is the absolute bedrock of effective prompting. Vague prompts lead to vague, generic, and often useless answers. The more detail, clarity, and direction you can provide, the more the LLM can narrow its focus and deliver exactly what you need.
### The Problem with Vague Prompts
When you give a model a vague prompt like "Tell me about dogs," you're forcing it to make a huge number of assumptions. It has to guess:
* **Topic:** Are you interested in dog breeds, dog training, the history of dog domestication, or famous dogs in movies?
* **Depth:** Do you want a single paragraph or a 2,000-word essay?
* **Audience:** Is this for a child, a veterinarian, or a potential first-time dog owner?
* **Format:** Should the output be a list, an article, or a poem?
The model will make a guess, but it's unlikely to be the one you wanted.
### From Vague to Hyper-Specific: A Case Study
Let's look at how we can iteratively refine a vague prompt into a powerful and specific one.
**Vague Prompt:**
```
Write a story.
```
**Slightly Better Prompt:**
```
Write a story about a detective.
```
*This is better, but still very broad. What kind of detective? What kind of story?*
**Good, Specific Prompt:**
```
Write a short story (around 500 words) about a hardboiled detective in 1940s New York City. The tone should be noir, with a sense of mystery and danger.
```
*This is much better. It specifies the genre, setting, tone, and length.*
**Excellent, Hyper-Specific Prompt:**
```
Write a 500-word short story in the style of Raymond Chandler. The protagonist is a cynical private investigator named Jack Corrigan, working in his dimly lit office in 1940s Manhattan. A mysterious woman in a red dress walks in, asking him to find her missing brother. The story should end on a cliffhanger.
```
*This prompt gives the model everything it needs: a specific style to emulate, a character, a setting, a plot hook, and a structural constraint (the cliffhanger ending).*
### Actionable Techniques for Achieving Specificity
Here are key techniques you should practice to make your prompts laser-focused.
* **Specify the Desired Length:** Don't just say "short" or "long." Give a word count ("about 200 words"), a sentence count ("in three sentences"), or a paragraph count ("in two paragraphs").
* **Define the Output Format:** Be explicit about the structure of the response.
* "Provide the answer as a JSON object with the keys 'name', 'capital', and 'population'."
* "Create a Markdown table with three columns: 'Feature', 'Benefit', and 'Example'."
* "Write a numbered list of the top 5 action items."
* **Set the Tone and Style:** How should the AI sound?
* "Use a formal, academic tone."
* "Write in a friendly, conversational, and encouraging style."
* "The tone should be witty and slightly sarcastic."
* **Provide Negative Constraints:** Sometimes it's just as important to tell the model what *not* to do.
* "Explain the concept of quantum physics without using any math."
* "Write a product description, but do not mention the price."
* "Summarize the article, excluding any information about the author's personal life."
By mastering the art of specificity, you move from getting random, hit-or-miss results to consistently getting the exact output you envision.
# Few-Shot Prompting
Source: https://docs.getsnippets.ai/how-to-prompt/core-principles/few-shot-prompting
Few-shot prompting is a powerful technique for guiding an LLM to produce a specific, structured output. It involves providing the model with several examples (the "few shots") of the task you want it to perform. This in-context learning helps the model understand the pattern, format, and nuances of your request far more effectively than a simple instruction.
### From Zero-Shot to Few-Shot
To understand few-shot prompting, it's helpful to first understand its counterpart, **zero-shot prompting**.
* **Zero-Shot Prompting:** This is what we've been doing in most of the previous examples. You give the model an instruction and expect it to perform the task without any prior examples. (e.g., "Summarize this article.") This works well for simple, common tasks.
* **Few-Shot Prompting:** When a task is more complex, novel, or requires a very specific output format, zero-shot prompting can fail. By providing 2-5 high-quality examples, you essentially "show, don't just tell" the model what you want.
### Why Few-Shot Prompting is a Game-Changer
Few-shot prompting is one of the most reliable ways to improve the accuracy and consistency of an LLM's output.
* **Pattern Recognition:** It forces the model to recognize the underlying pattern in your examples, making it much more likely to replicate that pattern in its own output.
* **Format Control:** It's the best way to get the model to produce output in a specific format, such as JSON, XML, or a custom-structured text format.
* **Task Specialization:** You are essentially creating a temporary, specialized model for your exact task, without the need for expensive fine-tuning.
### A Practical Case Study: Data Extraction
Imagine you have a block of unstructured text and you want to extract specific pieces of information into a structured format.
**Zero-Shot Prompt (Likely to Fail):**
```
Extract the name, company, and job title from the following text:
"John Doe, a Senior Software Engineer at Acme Corp, is leading the new AI initiative."
```
*The model might return a sentence, or it might not format the data correctly.*
**Few-Shot Prompt (Much More Reliable):**
```
Extract the name, company, and job title from the following texts.
Text: "Jane Smith is the CEO of Global Tech."
Output:
{
"name": "Jane Smith",
"company": "Global Tech",
"title": "CEO"
}
Text: "The new project will be managed by Mark Johnson, a Project Manager at Innovate Inc."
Output:
{
"name": "Mark Johnson",
"company": "Innovate Inc",
"title": "Project Manager"
}
Text: "John Doe, a Senior Software Engineer at Acme Corp, is leading the new AI initiative."
Output:
```
By providing two clear examples, you have given the model an unambiguous template to follow. It will now almost certainly return a perfectly formatted JSON object for the third example.
### Best Practices for Few-Shot Prompting
* **Quality over Quantity:** 2-3 high-quality, clear examples are better than 10 confusing ones.
* **Consistency is Key:** Ensure the format and structure of your examples are identical. Any inconsistency can confuse the model.
* **Use Realistic Examples:** The examples you provide should be representative of the real data the model will be working with.
* **Include Edge Cases:** If you know there are tricky edge cases in your data, include an example of how to handle them in your prompt.
Few-shot prompting is a fundamental skill for anyone looking to move beyond simple tasks and unlock the full power of LLMs for complex, structured work.
# Provide Context
Source: https://docs.getsnippets.ai/how-to-prompt/core-principles/provide-context
If specificity is the bedrock of good prompting, context is the scaffolding that supports it. Providing context means giving the LLM the background information it needs to understand the *world* of your request. Without context, the model is working in a vacuum; with it, the model can tailor its response to your specific situation, audience, and goals.
### Why Context is King
An LLM doesn't know who you are, what you're working on, or why you're asking a question. It only knows what you put in the prompt. Failing to provide context forces the model to make broad assumptions, which are often wrong.
Consider the prompt: "Summarize this." The model has to guess:
* **Audience:** Who is the summary for? A CEO? A 5th-grade student? A fellow researcher? The level of detail and language will be completely different for each.
* **Purpose:** Why are you summarizing it? To get the key financial data? To understand the main argument? To create a social media post?
* **Key Elements:** What parts of the text are most important to you? Should the summary focus on the methods, the results, or the conclusions?
### From No Context to Rich Context: A Case Study
Let's see how adding layers of context can dramatically improve the quality of an output.
**Prompt without Context:**
```
Explain how a blockchain works.
```
*This will produce a generic, technical definition.*
**Prompt with Audience Context:**
```
Explain how a blockchain works to a group of investors who have no technical background.
```
*Better. The model will now simplify the language and focus on the business implications.*
**Prompt with Audience and Purpose Context:**
```
Explain how a blockchain works to a group of investors who have no technical background. The goal is to help them understand the security and transparency benefits of the technology for supply chain management.
```
*Even better. The model will now tailor the explanation to a specific use case.*
**Prompt with Rich Context (Audience, Purpose, and Format):**
```
You are a technology consultant giving a presentation. Explain how a blockchain works to a group of investors with no technical background. Use a simple analogy to make it easy to understand. The goal is to highlight the security and transparency benefits of the technology for supply chain management. Please structure the explanation in three short paragraphs.
```
*This is an excellent prompt. It provides a persona, a target audience, a clear goal, a specific analogy requirement, and a formatting constraint. The resulting output will be highly targeted and useful.*
### The Golden Trio: Key Types of Context to Provide
While any background information can be helpful, there are three types of context that are almost always essential for high-quality responses.
1. **Audience Context:** Who is this for? The most important piece of context you can provide. Always define your audience.
* "Explain this to a team of senior software engineers."
* "Write this for a general audience with no prior knowledge of the topic."
* "This is for a potential customer who is skeptical about our product."
2. **Purpose Context:** Why are you making this request? What is the end goal?
* "The goal is to create a marketing email that drives clicks."
* "I need to understand the main arguments of this paper for a literature review."
* "This will be part of a technical documentation site for new users."
3. **Source Material Context:** If your prompt relates to a specific piece of information (an article, an email, a block of code), you must include it directly in the prompt. Don't assume the model has seen it before.
* "Based on the following article, what are the three main takeaways? \[Paste article here]"
* "Review the following code for bugs: \[Paste code here]"
Providing rich context is a skill that separates novice prompters from experts. By consistently thinking about your audience, purpose, and source material, you will elevate the quality of your AI interactions.
# Use Personas
Source: https://docs.getsnippets.ai/how-to-prompt/core-principles/use-personas
Assigning a persona to an LLM is one of the most powerfulβand enjoyableβprompting techniques. It allows you to fundamentally shift the model's tone, style, perspective, and area of expertise. By telling the model *who* it should be, you're not just asking for information; you're asking for a performance.
### The Power of a Persona
Without a persona, an LLM defaults to a neutral, "helpful assistant" voice. This is often fine, but it's rarely exceptional. A persona allows you to tap into the model's vast training data to simulate a specific character or expert, resulting in a richer, more nuanced, and more effective response.
A persona can help you:
* **Control the Tone and Style:** A prompt for a "Drill Sergeant" will produce a very different response than one for a "Soothing Yoga Instructor."
* **Focus on Specific Expertise:** A "Senior Tax Accountant" will analyze a financial problem differently than a "Startup Founder."
* **Increase Creativity:** Personas like "a cynical poet" or "a wildly optimistic inventor" can lead to much more interesting and unexpected outputs.
### From No Persona to Rich Persona: A Case Study
Let's see how applying a persona can transform a simple request.
**Standard Prompt:**
```
Explain the benefits of regular exercise.
```
*This will give a generic, factual list.*
**Prompt with a Simple Persona:**
```
You are a personal trainer. Explain the benefits of regular exercise.
```
*Better. The language will now be more motivational and action-oriented.*
**Prompt with a Detailed Persona:**
```
You are "Coach Dave," a super-enthusiastic and motivational personal trainer. Your goal is to get a client who is new to fitness excited about starting their journey. Explain the benefits of regular exercise in a way that is inspiring and easy to understand, focusing on energy levels and mood.
```
*This is excellent. The persona has a name, a personality, and a clear goal, which will result in a highly engaging and targeted response.*
**Prompt with an Expert Persona for a Technical Task:**
```
You are a senior cybersecurity analyst with 20 years of experience. Review the following Python code for potential security vulnerabilities. Provide a detailed analysis, citing specific CWEs (Common Weakness Enumerations) for any issues you find. The tone should be formal and professional.
[Python Code Here]
```
*This shows how personas aren't just for creative tasks. By assigning a highly specific expert persona, you can instruct the model to access a specialized domain of its knowledge and provide a much more rigorous and technical analysis.*
### Crafting an Effective Persona
A good persona prompt has three key elements:
1. **Role:** Who is the AI? (e.g., "You are a historian," "You are a travel blogger.")
2. **Expertise/Background:** What do they know? (e.g., "...specializing in ancient Rome," "...who focuses on budget travel in Southeast Asia.")
3. **Tone/Style:** How do they communicate? (e.g., "...with a formal, academic tone," "...with a fun, informal, and humorous style.")
### A Library of Persona Ideas
The possibilities are endless. Experiment with different personas to see what works best for your task.
* **Professional:** Software Engineer, CEO, Marketing Manager, Lawyer, Doctor, Financial Analyst.
* **Creative:** Novelist, Poet, Screenwriter, Artist, Musician.
* **Educational:** Teacher, University Professor, Tutor, Museum Tour Guide.
* **Fictional/Historical:** Sherlock Holmes, Albert Einstein, Jane Austen, A Stormtrooper.
By mastering the use of personas, you can unlock a new level of control and creativity in your interactions with LLMs.
# Introduction to Prompting
Source: https://docs.getsnippets.ai/how-to-prompt/introduction
Welcome to the world of AI prompting! This guide is designed to transform you from a beginner into a skilled communicator with large language models (LLMs). Mastering the art of the prompt is the single most important factor in unlocking the vast potential of artificial intelligence.
## What is a Prompt?
At its core, a **prompt** is a set of instructions given to an LLM to elicit a specific response. Itβs the way we communicate our intentions, questions, and desired tasks to the AI. A prompt can be as simple as a single question or as complex as a multi-page document with detailed instructions and examples.
Think of an LLM as an incredibly knowledgeable and versatile assistant who is always ready to help, but who needs to be told *exactly* what to do. The prompt is your way of providing those instructions.
## Why is Prompting a Superpower?
The quality of your prompt directly and dramatically impacts the quality of the AI's output. This is a critical concept to understand: the model isn't just "smart" on its own; its intelligence is unlocked by the skill of the user.
* **Precision and Relevance:** A well-crafted prompt guides the AI to provide a precise, relevant, and high-quality response, eliminating the vague and generic answers that often frustrate new users.
* **Control and Creativity:** Good prompting gives you fine-grained control over the AI's tone, style, format, and even its "personality." It's the difference between being a passenger and a pilot.
* **Efficiency and Productivity:** Mastering prompting can save you hours of work. You can automate tasks, generate creative ideas, and solve complex problems much faster than you could on your own.
## The Core Components of an Effective Prompt
While prompts can vary widely, the most effective ones often share a few key components. As you progress through this guide, you'll learn how to master each of these.
1. **Task:** What do you want the AI to do? Be explicit. (e.g., "Summarize this article," "Write a Python function," "Brainstorm ideas for a marketing campaign.")
2. **Context:** What background information does the AI need to know? (e.g., "This is for a presentation to a non-technical audience," "The user is a complete beginner.")
3. **Persona:** Who should the AI be? (e.g., "You are a friendly and encouraging tutor," "You are a skeptical financial analyst.")
4. **Format:** How should the AI present the information? (e.g., "Use a bulleted list," "Provide the answer in a JSON object," "Write in a formal, academic tone.")
5. **Examples:** Can you show the AI what you want? (This is known as "few-shot prompting" and is a very powerful technique.)
## What You'll Learn in This Guide
This guide is structured to take you on a journey from the fundamentals to more advanced techniques.
* **Core Prompting Principles:** We will dive deep into the essential skills that form the foundation of effective prompting.
* **Practical Examples:** You'll see how to apply these principles to real-world tasks that you can use in your daily work.
* **AI Prompt Library:** We've curated a collection of battle-tested prompts that you can copy and adapt for your own use.
By the end of this guide, you won't just know *what* a prompt is; you'll know *how* to craft prompts that consistently deliver exceptional results. Let's begin.
# Classification
Source: https://docs.getsnippets.ai/how-to-prompt/practical-examples/classification
Text classification is the process of assigning predefined categories or labels to text. It's a foundational task in natural language processing and one that LLMs can perform with remarkable accuracy. You can use classification for a huge range of applications, including sentiment analysis of customer feedback, topic categorization of news articles, spam detection in emails, and intent recognition in user queries.
### The Best Tool for the Job: Few-Shot Prompting
While you can sometimes get away with a zero-shot prompt for very simple classification tasks (e.g., "Is this review positive or negative?"), the most robust and reliable method is **few-shot prompting**.
As we covered in the Core Principles section, few-shot prompting allows you to "teach" the model the exact classification system you want it to use. This is critical because classification is often subjective and context-dependent. By providing clear examples, you remove ambiguity and ensure the model's output aligns with your specific needs.
### From Simple to Complex Classification: A Case Study
Let's look at how we can use few-shot prompting to build a sophisticated classifier for customer support tickets.
**Goal:** We want to classify incoming support tickets into three categories: `Technical Issue`, `Billing Inquiry`, and `General Question`.
**A Good Few-Shot Prompt:**
```
Please classify the following customer support tickets into one of three categories: Technical Issue, Billing Inquiry, or General Question.
Ticket: "Hi, I can't seem to log in to my account. I've reset my password but it's still not working."
Category: Technical Issue
Ticket: "Hello, I was wondering if you offer any discounts for non-profit organizations?"
Category: General Question
Ticket: "I think I was overcharged on my last invoice. Can you please check?"
Category: Billing Inquiry
Ticket: "My dashboard is showing an error message and I can't access my reports."
Category:
```
*This prompt is effective because it provides one clear example for each category. The model will see the pattern and correctly classify the final ticket as `Technical Issue`.*
**An Advanced Prompt with Edge Case Handling:**
Sometimes, a ticket might fit into more than one category. We can teach the model how to handle this.
```
Please classify the following customer support tickets. You can assign one or more of the following categories: Technical Issue, Billing Inquiry, General Question. Format the output as a JSON array.
Ticket: "Hi, I can't seem to log in to my account. I've reset my password but it's still not working."
Category: ["Technical Issue"]
Ticket: "I think I was overcharged on my last invoice. Can you also tell me what your business hours are?"
Category: ["Billing Inquiry", "General Question"]
Ticket: "My dashboard is showing an error message and I can't access my reports. This is preventing me from upgrading my account, which I'd like to do today."
Category:
```
*This is a much more sophisticated prompt. We've instructed the model to handle multiple categories and to output the result in a machine-readable JSON format. We also provided a tricky example that combines a billing and a general question. The model will now correctly classify the final ticket as `["Technical Issue", "Billing Inquiry"]`.*
### A Toolkit of Classification Techniques
* **Chain of Thought Classification:** For very complex classification tasks, you can ask the model to "think step by step."
* `For the following user comment, first identify the main topic of the comment, then decide if the sentiment is positive, negative, or neutral. Finally, assign one of the following categories...`
* **Fine-Grained Classification:** Don't be afraid to use a large number of categories. LLMs can handle dozens or even hundreds of categories if you provide clear examples.
* **Confidence Scoring:** For more advanced use cases, you can ask the model to provide a confidence score for its classification.
* `Classify the following text and provide a confidence score (from 0.0 to 1.0) for your answer.`
By leveraging few-shot prompting and these advanced techniques, you can build powerful and nuanced text classifiers for almost any application.
# Code Generation
Source: https://docs.getsnippets.ai/how-to-prompt/practical-examples/code-generation
Code generation is one of the most transformative applications of LLMs for developers. By treating the AI as a collaborative programming partner, you can accelerate your workflow, learn new technologies, and solve complex problems more efficiently. The key is to move beyond simple requests and adopt a structured approach to prompting for code.
### The Core Principles of Prompting for Code
Effective code generation relies on the same principles we've discussed, but with a technical focus.
1. **Be Explicit About the Language and Environment:** Always state the programming language, and if relevant, the framework, library, or runtime environment.
2. **Clearly Define Inputs and Outputs:** What data does the function or component take as input, and what should it return as output?
3. **Describe the Logic and Constraints:** Explain the "how." What are the steps the code should follow? Are there any performance or security constraints?
4. **Request Best Practices:** Ask the model to include comments, docstrings, error handling, and to follow idiomatic style guides.
### From Simple Snippet to Production-Ready Code: A Case Study
Let's see how to build a high-quality prompt for a common development task.
**Simple Prompt:**
```
Write a function to check if a string is a palindrome.
```
*This is too simple. It doesn't specify the language or any requirements.*
**Good Prompt:**
```
Write a Python function that checks if a given string is a palindrome.
```
*Better. It specifies the language. It will likely produce a working, but basic, function.*
**Excellent Prompt:**
```
Write a Python function called `is_palindrome` that takes a string as input and returns `True` if the string is a palindrome and `False` otherwise. The function should be case-insensitive and should ignore all non-alphanumeric characters.
```
*Now we're getting somewhere. We've defined the function name, the exact return values, and handled important edge cases (case-insensitivity and non-alphanumeric characters).*
**Professional-Grade Prompt:**
```
You are an expert Python developer who writes clean, efficient, and well-documented code.
Write a Python function called `is_palindrome` that takes a string as input and returns a boolean value indicating whether the string is a palindrome.
Requirements:
1. The comparison must be case-insensitive.
2. The function must ignore all spaces, punctuation, and any other non-alphanumeric characters.
3. The function should have a clear, PEP 257-compliant docstring that explains what it does, its parameters, and what it returns.
4. Include at least three example use cases in the docstring.
5. Add type hints for the function signature.
6. The function should be optimized for performance.
```
*This is a production-level prompt. It assigns an expert persona, provides a numbered list of clear, technical requirements, and explicitly asks for documentation, examples, and best practices like type hinting and optimization.*
### A Toolkit for the AI-Powered Developer
Integrate these techniques into your daily workflow.
* **Code Translation:** "Translate the following Python code into idiomatic Go. Pay attention to Go's error handling conventions."
* **Debugging and Explanation:** "I am getting a `TypeError` in this JavaScript code. Explain what is causing the error and how to fix it."
* **Refactoring:** "Refactor this Java code to be more modular and to use the Strategy design pattern."
* **API Integration:** "Write a TypeScript function that makes a POST request to the `/users` endpoint of the Stripe API to create a new customer. Please include error handling for network and API errors."
* **Unit Test Generation:** "Write a set of unit tests for the following C# function using the MSTest framework. Include tests for edge cases and invalid input."
By adopting a structured and detailed approach to prompting, you can leverage LLMs to write better code, faster.
# Creative Writing
Source: https://docs.getsnippets.ai/how-to-prompt/practical-examples/creative-writing
LLMs can be an extraordinary co-pilot for any creative writing endeavor. Whether you're a novelist suffering from writer's block, a marketer trying to craft a compelling brand story, or just someone looking to have fun with words, the AI can act as a tireless brainstorming partner, a versatile ghostwriter, and an endless source of inspiration.
### The AI as Your Creative Muse
The key to using an LLM for creative writing is to treat it not as a machine, but as a collaborator. You are the director, and the AI is your infinitely flexible actor. Your prompts set the stage, define the characters, and guide the narrative.
Successful creative prompting involves a delicate balance of providing clear constraints while also leaving room for the model to surprise you.
### From Vague Idea to Vivid Scene: A Case Study
Let's explore how to build a creative prompt that elicits a rich and evocative response.
**Vague Idea:**
```
Write a story about a futuristic city.
```
*This is far too broad and will result in a generic, clichΓ©-filled story.*
**Prompt with a Core Concept:**
```
Write a short story set in a futuristic city where plants have become sentient and integrated into the architecture.
```
*A much better starting point. We have a unique and interesting core concept.*
**Prompt with Character and Conflict:**
```
Write a short story about an old architect in a futuristic city where plants are sentient. He is one of the last people who remembers how to build with traditional, non-living materials, and he clashes with a younger generation that believes all construction should be a collaboration with the sentient flora.
```
*Excellent. Now we have a protagonist and a central conflict to drive the narrative.*
**A Prompt to Inspire Great Writing:**
```
You are a master science fiction author in the style of Ursula K. Le Guin. Write a 1,000-word story that is literary, thought-provoking, and melancholic in tone.
The story is about Kaelen, an elderly architect in a bio-luminescent city where buildings are grown from sentient, empathic fungi. Kaelen is one of the last humans who understands the cold, hard logic of steel and concrete. He feels alienated from the younger generation, who communicate with the city's "fungal consciousness." The central conflict arises when a new fungal plague threatens the city, and Kaelen's old, "dead" knowledge may be the only thing that can save it.
Focus on Kaelen's internal struggle: his loneliness, his pride in his craft, and his complex feelings about a world that has moved on without him.
```
*This is a professional-grade creative prompt. It establishes a specific authorial style, a rich setting, a compelling character, a clear conflict, and, most importantly, it directs the AI to focus on the emotional core of the story.*
### A Toolkit for the AI-Powered Writer
* **World-Building:** Use the AI as a world-building engine.
* `I'm writing a fantasy novel. Give me 10 detailed and unique customs for a society that lives in floating cities.`
* **Character Development:** Flesh out your characters by interviewing them.
* `You are the character Kaelen from my story. I am going to ask you some questions. What is your happiest memory? What are you most afraid of?`
* **Dialogue Generation:** Create more realistic and engaging dialogue.
* `Write a dialogue scene between a cynical, world-weary detective and a naive, optimistic rookie. The topic is the corrupt nature of the city's government.`
* **Iterative Storytelling:** Don't ask for the whole story at once. Write it chapter by chapter, or even paragraph by paragraph, guiding the AI as you go.
* `That's a great opening paragraph. In the next paragraph, have the mysterious woman reveal that her missing brother is a high-ranking politician.`
Creative writing with an LLM is a dance. Your prompts lead, but you must also be willing to follow the unexpected and interesting paths the AI reveals.
# Summarization
Source: https://docs.getsnippets.ai/how-to-prompt/practical-examples/summarization
Summarization is one of the most immediately useful applications of LLMs, allowing you to rapidly distill the key information from large volumes of text. However, moving beyond basic summarization requires a strategic approach. By mastering a few key techniques, you can transform the LLM from a simple text-shrinker into a sophisticated analysis tool.
### The Spectrum of Summarization
Summarization isn't a single task; it's a spectrum. The right technique depends on your goal.
* **Extractive Summarization:** This is the simplest form, where the model identifies and pulls out the most important sentences from the original text. It's fast and factual, but can sometimes feel disjointed.
* **Abstractive Summarization:** This is where LLMs truly shine. The model reads and understands the source text and then generates a *new* summary in its own words. This allows for more fluent, human-readable output and can even simplify complex topics.
By default, most LLMs will perform abstractive summarization, but you can guide them toward a more extractive style if needed.
### From Basic to Advanced Summarization: A Case Study
Let's explore how to add layers of control to a summarization prompt.
**Basic Prompt:**
```
Summarize this article:
[Article Text]
```
*This is a zero-shot prompt that gives the model full control over the length, focus, and style.*
**Prompt with Length Constraint:**
```
Summarize this article in no more than 100 words:
[Article Text]
```
*Better. We've added a crucial constraint to control the output size.*
**Prompt with Format and Focus Constraints:**
```
Summarize this article in three bullet points. Focus specifically on the financial and market-related outcomes.
[Article Text]
```
*Now we're getting powerful. We've dictated the format (bullet points) and told the model what specific information we care about, instructing it to ignore other aspects of the article.*
**Advanced Prompt with Persona and Audience:**
```
You are a senior financial analyst. Read the following news article and write a summary for a busy CEO. The summary should be a single, dense paragraph, starting with a clear "Bottom Line" statement. Focus exclusively on the strategic implications for our company and the market at large. Ignore any public relations or human-interest angles.
[Article Text]
```
*This is a professional-grade prompt. It assigns a persona, defines a specific audience (a busy CEO), dictates a highly specific format ("Bottom Line" statement), and provides both positive and negative constraints on the focus.*
### A Toolkit of Summarization Techniques
Keep these techniques in your back pocket to create the perfect summary for any situation.
* **Chain of Thought Summarization:** Ask the model to first identify the key points, and then summarize those points. This can improve the quality of the final summary.
* `First, pull out the top 5 most important arguments from this text. Then, write a one-paragraph summary based only on those five arguments.`
* **Multi-Perspective Summarization:** Ask for summaries from different points of view.
* `Summarize the attached meeting transcript from the perspective of the marketing team, and then summarize it again from the perspective of the engineering team.`
* **Interactive Summarization:** Don't just take the first output. Ask follow-up questions to dive deeper.
* `That's a good summary. Can you elaborate on the second bullet point?`
By moving beyond basic requests and applying these more advanced techniques, you can use LLMs to create highly tailored, insightful summaries that save you time and improve your understanding.